From d15c642f9190d17f20c1a779cacda181f72cc64b Mon Sep 17 00:00:00 2001 From: Anbraten Date: Mon, 4 Oct 2021 23:47:21 +0200 Subject: [PATCH] Release cli images (#404) * release cli images * update docs Co-authored-by: 6543 <6543@obermui.de> --- .woodpecker/main.yml | 42 ++++++++++++++++++++++++++++++++++++ docker/Dockerfile.cli | 16 ++++++++++++++ docker/Dockerfile.cli.alpine | 11 ++++++++++ docs/docs/80-downloads.md | 4 ++-- 4 files changed, 71 insertions(+), 2 deletions(-) create mode 100644 docker/Dockerfile.cli create mode 100644 docker/Dockerfile.cli.alpine diff --git a/.woodpecker/main.yml b/.woodpecker/main.yml index 940d63a6c..45ed5531b 100644 --- a/.woodpecker/main.yml +++ b/.woodpecker/main.yml @@ -109,6 +109,28 @@ pipeline: branch: master event: push + publish-cli: + group: docker + image: plugins/docker + repo: woodpeckerci/woodpecker-cli + dockerfile: docker/Dockerfile.cli + secrets: [docker_username, docker_password] + tag: [next] + when: + branch: master + event: push + + publish-cli-alpine: + group: docker + image: plugins/docker + repo: woodpeckerci/woodpecker-cli + dockerfile: docker/Dockerfile.cli.alpine + secrets: [ docker_username, docker_password ] + tag: [next-alpine] + when: + branch: master + event: push + release-server: group: docker image: plugins/docker @@ -149,6 +171,26 @@ pipeline: when: event: tag + release-cli: + group: docker + image: plugins/docker + repo: woodpeckerci/woodpecker-cli + dockerfile: docker/Dockerfile.cli + secrets: [docker_username, docker_password] + tag: [latest, "${DRONE_TAG}"] + when: + event: tag + + release-cli-alpine: + group: docker + image: plugins/docker + repo: woodpeckerci/woodpecker-cli + dockerfile: docker/Dockerfile.cli.alpine + secrets: [ docker_username, docker_password ] + tag: [latest-alpine, "${DRONE_TAG}-alpine"] + when: + event: tag + checksums: image: golang:1.16 commands: diff --git a/docker/Dockerfile.cli b/docker/Dockerfile.cli new file mode 100644 index 000000000..ad4e476d4 --- /dev/null +++ b/docker/Dockerfile.cli @@ -0,0 +1,16 @@ +# docker build --rm -f docker/Dockerfile.cli -t woodpeckerci/woodpecker-cli . + +# use golang image to copy ssl certs later +FROM golang:1.16 + +FROM scratch + +# copy certs from golang:1.16 image +COPY --from=0 /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt + +ENV GODEBUG=netdns=go +ADD dist/cli/linux_amd64/woodpecker-cli /bin/ + +HEALTHCHECK CMD ["/bin/woodpecker-cli", "ping"] + +ENTRYPOINT ["/bin/woodpecker-cli"] diff --git a/docker/Dockerfile.cli.alpine b/docker/Dockerfile.cli.alpine new file mode 100644 index 000000000..d91ceb63b --- /dev/null +++ b/docker/Dockerfile.cli.alpine @@ -0,0 +1,11 @@ +# docker build --rm -f docker/Dockerfile.cli.alpine -t woodpeckerci/woodpecker-cli . + +FROM alpine:3.14 +RUN apk add -U --no-cache ca-certificates + +ENV GODEBUG=netdns=go +ADD dist/cli/linux_amd64/woodpecker-cli /bin/ + +HEALTHCHECK CMD ["/bin/woodpecker-cli", "ping"] + +ENTRYPOINT ["/bin/woodpecker-cli"] diff --git a/docs/docs/80-downloads.md b/docs/docs/80-downloads.md index 07ddff396..f2195e5c5 100644 --- a/docs/docs/80-downloads.md +++ b/docs/docs/80-downloads.md @@ -7,7 +7,7 @@ ## Docker images Image variants: -* The `next` version is based on the current master branch +* The `next` images are based on the current master branch * The `latest` is same as next (will change after v0.15.0 release to be latest stable release) * The `x.x.x` version images are stable releases @@ -20,7 +20,7 @@ docker pull woodpeckerci/woodpecker-server:latest-alpine docker pull woodpeckerci/woodpecker-agent:latest docker pull woodpeckerci/woodpecker-agent:latest-alpine -# TODO: cli +# cli docker pull woodpeckerci/woodpecker-cli:latest docker pull woodpeckerci/woodpecker-cli:latest-alpine ```