added release version override option and tidied the documentation

This commit is contained in:
Tamás Gérczei 2020-05-13 07:26:50 +02:00
parent bcf898554d
commit 57fd74f61e
Signed by: tgerczei
GPG Key ID: 9E1246D452248DCE
2 changed files with 18 additions and 9 deletions

View File

@ -1,6 +1,7 @@
FROM golang:alpine AS buildenv
ARG VERSION="0.3.0"
ENV TEA_VERSION="${VERSION}"
ARG CGO_ENABLED="0"
ARG GOOS="linux"
@ -8,10 +9,10 @@ WORKDIR $GOPATH/src
RUN apk add --no-cache git && \
git config --global advice.detachedHead false && \
git clone --single-branch https://gitea.com/gitea/tea -b v${VERSION} && \
git clone --single-branch https://gitea.com/gitea/tea -b v${TEA_VERSION} && \
cd tea && \
go get -v . && \
go build -v -a -ldflags "-X main.Version=$VERSION" -o /tea .
go build -v -a -ldflags "-X main.Version=${TEA_VERSION}" -o /tea .
FROM scratch
LABEL maintainer="Tamás Gérczei <tamas@gerczei.eu>"

View File

@ -1,11 +1,19 @@
# tea: A command line tool to interact with Gitea servers
## tea: A command line tool to interact with Gitea servers
## Build
### Build
- docker build . -t gitea/tea:0.3.0
### Usage
- docker volume create tea
- alias tea='docker run --rm -v tea:/app gitea/tea:0.3.0'
- tea login add -n <name_this_login> -u <your_gitea_url> -t <your_gitea_application_token> -i
...or to build a specific release (see 'https://gitea.com/gitea/tea/releases'):
#### tea stores its configuration in a file named 'tea.yml', which the above will store on a volume named 'tea' so that it might persist
- export VERSION="<b>0.2.0</b>"
- docker build . -t "gitea/tea:${VERSION}" --build-arg VERSION="${VERSION}"
### Configuration
- docker volume create tea
- alias tea='docker run --rm -v tea:/app gitea/tea:<b><your_release></b>'
- tea login add -n <b><name_this_login></b> -u <b><your_gitea_url></b> -t <b><your_gitea_application_token></b> -i
### Usage
- tea
#### <i>tea stores its configuration in a file named 'tea.yml', which the above will store on a volume named 'tea' so that it might persist</i>