Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve release workflow #257

Closed
wants to merge 90 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
c414edf
feat: improve release workflow
anbraten Jul 23, 2021
c6ad425
feat: use golang instead of drone/ca-certs image
anbraten Jul 24, 2021
42ecc0a
feat: improve and correct release config
anbraten Jul 24, 2021
c34ace4
fix: release correct cli
anbraten Jul 24, 2021
ee8fe2f
fix: enable cgo for woodpecker-server
anbraten Jul 24, 2021
44feaae
Update .woodpecker/.release.yml
anbraten Aug 1, 2021
67762e2
reactor: use tagged goreleaser image
anbraten Aug 1, 2021
7754133
refactor: bump alpine, add some docs
anbraten Aug 19, 2021
898e0d1
update makefile
anbraten Aug 19, 2021
e5d1e8e
release on push to master as well
anbraten Aug 20, 2021
3698c5d
deactivate branch master for testing
anbraten Aug 20, 2021
424342e
speed up test ci for testing xD
anbraten Aug 20, 2021
fce434e
fix depends on
anbraten Aug 20, 2021
db89fb3
fix cmd
anbraten Aug 20, 2021
fb35ffc
release snapshot for master
anbraten Aug 20, 2021
6b18df5
fix load tags
anbraten Aug 20, 2021
3dbaec9
try latest git plugin
anbraten Aug 20, 2021
e968268
disable test
anbraten Aug 20, 2021
1370c0e
disable test
anbraten Aug 20, 2021
5d2367f
disable tests
anbraten Aug 20, 2021
4bad7a3
git debug
anbraten Aug 20, 2021
e824645
rename job
anbraten Aug 20, 2021
ee1b0dc
Merge branch 'release'
anbraten Aug 20, 2021
70609fc
on master only
anbraten Aug 20, 2021
a69b4fe
add docker socket
anbraten Aug 20, 2021
9145cd7
trigger ci
anbraten Aug 20, 2021
c661a24
fix volumes
anbraten Aug 20, 2021
4dbd35e
trigger ci2
anbraten Aug 20, 2021
d012abe
trigger ci3
anbraten Aug 20, 2021
873d2a9
release next version
anbraten Aug 20, 2021
9830fc2
fixes
anbraten Aug 22, 2021
4934d17
feat: improve release workflow
anbraten Aug 23, 2021
5c9fe72
fix: use node image
anbraten Aug 23, 2021
4a4105f
fix: add git
anbraten Aug 23, 2021
d58fe8e
feat: improve release workflow
anbraten Aug 24, 2021
a96f439
fix: use correct version
anbraten Aug 24, 2021
fdf8048
thing
anbraten Aug 24, 2021
4320a70
feat: trigger ci
anbraten Aug 24, 2021
06f1bf1
fix: indent when correctly
anbraten Aug 24, 2021
f59f31e
fix: test entrypoint
anbraten Aug 24, 2021
d7fcb9e
fix: correct build
anbraten Aug 24, 2021
7ee0c61
fix: use proper shell
anbraten Aug 24, 2021
c27072a
fix: improve docker build
anbraten Aug 26, 2021
41333ec
fix: escape vars
anbraten Aug 26, 2021
9c872d7
fix: un-escape vars
anbraten Aug 26, 2021
ad4fa87
fix: move comment
anbraten Aug 26, 2021
bb34475
fix: test version check
anbraten Aug 26, 2021
1bae904
ci: remove labels of release files
anbraten Aug 26, 2021
a2d0e62
cI: skip release if not update
anbraten Aug 26, 2021
92a1cbe
feat: skip last check if not needed
anbraten Aug 26, 2021
56205fa
feat: improve release flow
anbraten Aug 27, 2021
2d238d6
feat: use improved kaniko image
anbraten Aug 27, 2021
573aae4
fix: correct ci syntax
anbraten Aug 27, 2021
2d7e43c
fix: correct release test commands
anbraten Aug 28, 2021
a8073f0
fix: correct kaniko image
anbraten Aug 28, 2021
9090253
fix: make script exectuable
anbraten Aug 28, 2021
7e26731
fix: correct build-script
anbraten Aug 28, 2021
704d904
feat: trigger ci
anbraten Aug 28, 2021
8e4c1c5
fix: correct var
anbraten Aug 28, 2021
f347f7c
fix: exit script directly after error
anbraten Aug 28, 2021
ba653b5
Merge branch 'woodpecker-ci:master' into release
anbraten Aug 28, 2021
43d0a61
feat: run ci on master only
anbraten Aug 28, 2021
09c4620
Merge branch 'release' of github.com:anbraten/woodpecker into release
anbraten Aug 28, 2021
08ef704
Merge branch 'master' into release
6543 Aug 29, 2021
484a2bb
Merge remote-tracking branch 'upstream/master' into release
anbraten Aug 30, 2021
f75957e
improve release flow
anbraten Aug 31, 2021
dd4fc68
Merge branch 'woodpecker-ci:master' into release
anbraten Aug 31, 2021
5393575
add helm release
anbraten Aug 31, 2021
5bf4178
fix helm release
anbraten Aug 31, 2021
e291e03
Merge branch 'release' of github.com:anbraten/woodpecker into release
anbraten Aug 31, 2021
d24d8d9
remove unused ci file
anbraten Aug 31, 2021
6a45f55
update
anbraten Sep 1, 2021
a6ef381
cleanup changes
anbraten Sep 1, 2021
e4ff4f7
Merge branch 'master' into release
anbraten Sep 10, 2021
aca9497
Merge remote-tracking branch 'upstream/master' into release
anbraten Sep 11, 2021
0c5ea22
remove helm changes
anbraten Sep 11, 2021
4fc8557
Merge branch 'master' into release
anbraten Sep 19, 2021
14ce161
Merge remote-tracking branch 'upstream/master' into release
anbraten Sep 21, 2021
c678356
Merge remote-tracking branch 'upstream/master' into release
anbraten Sep 23, 2021
8d52ec9
undo change
anbraten Sep 23, 2021
875e9b5
Merge branch 'master' into release
anbraten Sep 24, 2021
fc3cfb3
Merge remote-tracking branch 'upstream/master' into release
anbraten Sep 28, 2021
2bacde5
Merge remote-tracking branch 'origin/master' into release
anbraten Oct 4, 2021
86edcdb
Merge remote-tracking branch 'upstream/master' into release
anbraten Oct 4, 2021
aea8805
remove old command
anbraten Oct 4, 2021
fe2fb1f
merge flows
anbraten Oct 4, 2021
bf99805
Merge remote-tracking branch 'upstream/master' into release
anbraten Oct 4, 2021
9cefae4
remove unrelated changes
anbraten Oct 4, 2021
c45d176
remove more unrelated changes
anbraten Oct 4, 2021
bf8954d
undo unrelated change
anbraten Oct 4, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 25 additions & 74 deletions .woodpecker/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,93 +61,44 @@ pipeline:
commands:
- make release-cli

publish-server:
build-docker-server:
group: docker
image: plugins/docker
repo: woodpeckerci/woodpecker-server
dockerfile: docker/Dockerfile.server
image: anbraten/kaniko:v1.6.0-debug
secrets: [docker_username, docker_password]
# TODO: only release as next after 0.15.0 got released
tag: [next, latest]
when:
branch: master
event: push

publish-server-alpine:
group: docker
image: plugins/docker
repo: woodpeckerci/woodpecker-server
dockerfile: docker/Dockerfile.server.alpine
secrets: [ docker_username, docker_password ]
# TODO: only release as next-alpine after 0.15.0 got released
tag: [next-alpine, latest-alpine]
environment:
- IMAGE_TYPE=server
commands:
- export WOODPECKER_VERSION=$(make version)
- .woodpecker/scripts/build-docker-image.sh
when:
event: [push, tag]
branch: master
event: push

publish-agent:
build-docker-agent:
group: docker
image: plugins/docker
repo: woodpeckerci/woodpecker-agent
dockerfile: docker/Dockerfile.agent
image: anbraten/kaniko:v1.6.0-debug
secrets: [docker_username, docker_password]
# TODO: only release as next after 0.15.0 got released
tag: [next, latest]
when:
branch: master
event: push

publish-agent-alpine:
group: docker
image: plugins/docker
repo: woodpeckerci/woodpecker-agent
dockerfile: docker/Dockerfile.agent.alpine
secrets: [ docker_username, docker_password ]
# TODO: only release as next-alpine after 0.15.0 got released
tag: [next-alpine, latest-alpine]
environment:
- IMAGE_TYPE=agent
commands:
- export WOODPECKER_VERSION=$(make version)
- .woodpecker/scripts/build-docker-image.sh
when:
event: [push, tag]
branch: master
event: push

release-server:
build-docker-cli:
group: docker
image: plugins/docker
repo: woodpeckerci/woodpecker-server
dockerfile: docker/Dockerfile.server
image: anbraten/kaniko:v1.6.0-debug
secrets: [docker_username, docker_password]
tag: [latest, "${DRONE_TAG}"]
when:
event: tag

release-server-alpine:
group: docker
image: plugins/docker
repo: woodpeckerci/woodpecker-server
dockerfile: docker/Dockerfile.server.alpine
secrets: [ docker_username, docker_password ]
tag: [latest-alpine, "${DRONE_TAG}-alpine"]
when:
event: tag

release-agent:
group: docker
image: plugins/docker
repo: woodpeckerci/woodpecker-agent
dockerfile: docker/Dockerfile.agent
secrets: [docker_username, docker_password]
tag: [latest, "${DRONE_TAG}"]
when:
event: tag

release-agent-alpine:
group: docker
image: plugins/docker
repo: woodpeckerci/woodpecker-agent
dockerfile: docker/Dockerfile.agent.alpine
secrets: [ docker_username, docker_password ]
tag: [latest-alpine, "${DRONE_TAG}-alpine"]
environment:
- IMAGE_TYPE=cli
commands:
- export WOODPECKER_VERSION=$(make version)
- .woodpecker/scripts/build-docker-image.sh
when:
event: tag
event: [push, tag]
branch: master

checksums:
image: golang:1.16
Expand Down
52 changes: 52 additions & 0 deletions .woodpecker/scripts/build-docker-image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#! /bin/sh

set -e

REGISTRY="docker.io"
IMAGE="woodpeckerci/woodpecker-$IMAGE_TYPE"
PATH_BINARY="./dist/${IMAGE_TYPE}_linux_amd64/woodpecker-$IMAGE_TYPE"
PATH_CONTEXT="./dist/docker-woodpecker-$IMAGE_TYPE"
PATH_DOCKERFILE="./docker/Dockerfile.$IMAGE_TYPE"

echo "Building $IMAGE_TYPE => $IMAGE:$WOODPECKER_VERSION ..."

# setup credentials
mkdir -p /kaniko/.docker
echo "{\"auths\":{\"$DOCKER_REGISTRY\":{\"username\":\"$DOCKER_USERNAME\",\"password\":\"$DOCKER_PASSWORD\"}}}" \
> /kaniko/.docker/config.json

echo "Preparing build context ..."
mkdir -p $PATH_CONTEXT/
cp $PATH_BINARY $PATH_CONTEXT/
cp $PATH_DOCKERFILE $PATH_CONTEXT/Dockerfile

# prepare alpine version
mkdir -p $PATH_CONTEXT-alpine/
cp $PATH_BINARY $PATH_CONTEXT-alpine/
cp $PATH_DOCKERFILE.alpine $PATH_CONTEXT-alpine/Dockerfile

if "$WOODPECKER_VERSION" == "next"; then
echo "Building pre-release (next) image ..."
/kaniko/executor \
--context $PATH_CONTEXT/ \
--destination $IMAGE:next

echo "Building pre-release (next) alpine image ..."
/kaniko/executor \
--context $PATH_CONTEXT-alpine/ \
--destination $IMAGE:next-alpine
else
echo "Building image ..."
/kaniko/executor \
--context $PATH_CONTEXT/ \
--destination $IMAGE:latest \
--destination $IMAGE:$WOODPECKER_VERSION

echo "Building alpine image ..."
/kaniko/executor \
--context $PATH_CONTEXT-alpine/ \
--destination $IMAGE:latest-alpine \
--destination $IMAGE:$WOODPECKER_VERSION-alpine
fi

echo "Done"
2 changes: 1 addition & 1 deletion docker/Dockerfile.agent.alpine
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FROM alpine:3.14
RUN apk add -U --no-cache ca-certificates

ENV GODEBUG=netdns=go
ADD dist/agent/linux_amd64/woodpecker-agent /bin/
ADD ./woodpecker-agent /bin/

EXPOSE 3000
HEALTHCHECK CMD ["/bin/woodpecker-agent", "ping"]
Expand Down
14 changes: 14 additions & 0 deletions docker/Dockerfile.cli
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# use golang image to copy ssl certs later
FROM golang:1.16

FROM scratch
ENV GODEBUG=netdns=go
EXPOSE 3000
HEALTHCHECK CMD ["/bin/woodpecker-cli", "ping"]

# copy certs from golang:1.16 image
COPY --from=0 /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt

ADD ./woodpecker-cli /bin/

ENTRYPOINT ["/bin/woodpecker-cli"]
12 changes: 12 additions & 0 deletions docker/Dockerfile.cli.alpine
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM alpine:3.14.1

RUN apk add -U --no-cache ca-certificates

ENV GODEBUG=netdns=go
ADD ./woodpecker-cli /bin/

EXPOSE 3000
HEALTHCHECK CMD ["/bin/woodpecker-cli", "ping"]

ENTRYPOINT ["/bin/woodpecker-cli"]

5 changes: 5 additions & 0 deletions docker/Dockerfile.kaniko-builder
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# docker/: docker build -t anbraten/kaniko:v1.6.0-debug -f Dockerfile.kaniko-builder .

FROM gcr.io/kaniko-project/executor:v1.6.0-debug
RUN ["/busybox/mkdir", "-p", "/bin"]
RUN ["/busybox/ln", "-s", "/busybox/sh", "/bin/sh"]
2 changes: 1 addition & 1 deletion docker/Dockerfile.server.alpine
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ ENV WOODPECKER_DATABASE_DATASOURCE=/var/lib/drone/drone.sqlite
ENV WOODPECKER_DATABASE_DRIVER=sqlite3
ENV XDG_CACHE_HOME=/var/lib/drone

ADD dist/server/linux_amd64/woodpecker-server /bin/
ADD ./woodpecker-server /bin/

ENTRYPOINT ["/bin/woodpecker-server"]