commit 54d37e9580514852d1631552dda6f80b5634b3f5 Author: Vivianne Langdon Date: Fri Apr 15 23:10:58 2022 -0700 initial commit diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9b42ee7 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM alpine:latest + +ENV GITEA_USER=ci +ENV TEA_VERSION=0.8.0-r2 + +LABEL maintainer="Vivianne Langdon " + +RUN apk add --no-cache tea=${TEA_VERSION} --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community + +COPY init.sh . + +ENTRYPOINT ["./init.sh"] diff --git a/README.md b/README.md new file mode 100644 index 0000000..820d0bd --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +Simple image for [tea](https://gitea.com/gitea/tea), the cli for gitea, based on Alpine. + +view on [docker hub](https://hub.docker.com/r/vivicat/docker-gitea-tea) + +# Running +`tea` is set as the entrypoint executable, so just skip `tea` in the arguments when running, like so: +``` +docker run --rm vivicat/docker-gitea-tea help +``` + +# Environment variables + +These variables will auto-login to your instance before running commands. +* `GITEA_URL` - Set this to the URL of your instance +* `GITEA_TOKEN` - Set this to the gitea api token generated from User Settings > Applications > Manage Access Tokens +* `GITEA_USER=ci` - Optionally, set the name of the user for the `tea` session. + +# Complete example +``` +docker run --rm -e "GITEA_URL=http://example.com" -e "GITEA_TOKEN=deadbeefdeadbeefdeadbeefdeadbeef" vivicat/docker-gitea-tea repos +``` diff --git a/init.sh b/init.sh new file mode 100755 index 0000000..24b1565 --- /dev/null +++ b/init.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +if [ -n "$GITEA_USER" ] && [ -n "$GITEA_URL" ] && [ -n "$GITEA_TOKEN" ]; then + tea login add -n $GITEA_USER -u $GITEA_URL -t $GITEA_TOKEN +fi + +tea "$@"