Initial commit
This commit is contained in:
51
.build.yml
Normal file
51
.build.yml
Normal file
@@ -0,0 +1,51 @@
|
||||
image: fedora/31
|
||||
packages:
|
||||
- buildah
|
||||
- tar
|
||||
- bzip2
|
||||
- jq
|
||||
secrets:
|
||||
- 8294c8f8-b7f3-4597-bcec-2b4dc07b81fd
|
||||
- 1a720572-542f-4dc7-9d22-b6f82ed942da
|
||||
sources:
|
||||
- https://git.sr.ht/~avanier/gitea-resource
|
||||
tasks:
|
||||
- publish_image: |
|
||||
# install go-task/task
|
||||
curl -sL https://taskfile.dev/install.sh | sh
|
||||
|
||||
# move into repo
|
||||
cd gitea-resource || exit 1
|
||||
|
||||
# check if the current commit is tagged, otherwise gracefully abort the build
|
||||
grep -q -F "$(git rev-parse --verify HEAD)" <(git show-ref -d --tags) \
|
||||
|| exit 0
|
||||
|
||||
# setup the environment
|
||||
VERSION="$(cat VERSION)"
|
||||
MAJOR=$(cut -d '.' -f 1 VERSION)
|
||||
MINOR=$(cut -d '.' -f 1-2 VERSION)
|
||||
|
||||
# build and push base image
|
||||
buildah bud -f ./Dockerfile \
|
||||
--build-arg "VERSION=${VERSION}" \
|
||||
-t "quay.io/avanier/gitea-resource:${VERSION}-base" \
|
||||
-t "quay.io/avanier/gitea-resource:${MAJOR}-base" \
|
||||
-t "quay.io/avanier/gitea-resource:${MINOR}-base" \
|
||||
-t "quay.io/avanier/gitea-resource:latest-base"
|
||||
|
||||
for tag in {${VERSION},${MAJOR},${MINOR},latest}; do
|
||||
buildah push "quay.io/avanier/gitea-resource:${tag}-base"
|
||||
done
|
||||
|
||||
# build and push pr image
|
||||
buildah bud -f ./Dockerfile.pr \
|
||||
--build-arg "VERSION=${VERSION}" \
|
||||
-t "quay.io/avanier/gitea-resource:${VERSION}-pr" \
|
||||
-t "quay.io/avanier/gitea-resource:${MAJOR}-pr" \
|
||||
-t "quay.io/avanier/gitea-resource:${MINOR}-pr" \
|
||||
-t "quay.io/avanier/gitea-resource:latest-pr"
|
||||
|
||||
for tag in {${VERSION},${MAJOR},${MINOR},latest}; do
|
||||
buildah push "quay.io/avanier/gitea-resource:${tag}-pr"
|
||||
done
|
Reference in New Issue
Block a user