mirror of
https://tangled.org/evan.jarrett.net/at-container-registry
synced 2026-09-19 08:44:14 +00:00
update workflow for buildah
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
# ATCR Release Pipeline for Tangled.org
|
||||
# Triggers on version tags and builds cross-platform binaries using GoReleaser
|
||||
# Triggers on version tags and builds cross-platform binaries using buildah
|
||||
|
||||
when:
|
||||
- event: ["manual"]
|
||||
@@ -10,46 +10,50 @@ engine: "nixery"
|
||||
|
||||
dependencies:
|
||||
nixpkgs:
|
||||
- git
|
||||
- go
|
||||
#- goreleaser
|
||||
- podman
|
||||
- buildah
|
||||
- chroot
|
||||
|
||||
environment:
|
||||
IMAGE_REGISTRY: atcr.io
|
||||
IMAGE_USER: evan.jarrett.net
|
||||
|
||||
steps:
|
||||
- name: Fetch git tags
|
||||
command: git fetch --tags --force
|
||||
|
||||
- name: Checkout tag for current commit
|
||||
- name: Setup build environment
|
||||
command: |
|
||||
CURRENT_COMMIT=$(git rev-parse HEAD)
|
||||
export TAG=$(git tag --points-at $CURRENT_COMMIT --sort=-version:refname | head -n1)
|
||||
if [ -z "$TAG" ]; then
|
||||
echo "Error: No tag found for commit $CURRENT_COMMIT"
|
||||
exit 1
|
||||
if ! grep -q "^root:" /etc/passwd 2>/dev/null; then
|
||||
echo "root:x:0:0:root:/root:/bin/sh" >> /etc/passwd
|
||||
fi
|
||||
echo "Found tag $TAG for commit $CURRENT_COMMIT"
|
||||
git checkout $TAG
|
||||
|
||||
- name: Build AppView Docker image
|
||||
- name: Login to registry
|
||||
command: |
|
||||
TAG=$(git describe --tags --exact-match 2>/dev/null || git tag --points-at HEAD | head -n1)
|
||||
podman login atcr.io -u evan.jarrett.net -p ${APP_PASSWORD}
|
||||
podman build -f Dockerfile.appview -t atcr.io/evan.jarrett.net/atcr-appview:${TAG} .
|
||||
podman push atcr.io/evan.jarrett.net/atcr-appview:${TAG}
|
||||
echo "${APP_PASSWORD}" | buildah login \
|
||||
--storage-driver vfs \
|
||||
-u "${IMAGE_USER}" \
|
||||
--password-stdin \
|
||||
${IMAGE_REGISTRY}
|
||||
|
||||
- name: Build Hold Docker image
|
||||
- name: Build and push AppView image
|
||||
command: |
|
||||
TAG=$(git describe --tags --exact-match 2>/dev/null || git tag --points-at HEAD | head -n1)
|
||||
podman login atcr.io -u evan.jarrett.net -p ${APP_PASSWORD}
|
||||
podman build -f Dockerfile.hold -t atcr.io/evan.jarrett.net/atcr-hold:${TAG} .
|
||||
podman push atcr.io/evan.jarrett.net/atcr-hold:${TAG}
|
||||
|
||||
# disable for now
|
||||
# - name: Tidy Go modules
|
||||
# command: go mod tidy
|
||||
buildah bud \
|
||||
--storage-driver vfs \
|
||||
--tag ${IMAGE_REGISTRY}/${IMAGE_USER}/atcr-appview:${TAG} \
|
||||
--tag ${IMAGE_REGISTRY}/${IMAGE_USER}/atcr-appview:latest \
|
||||
--file ./Dockerfile.appview \
|
||||
.
|
||||
|
||||
# - name: Install Goat
|
||||
# command: go install github.com/bluesky-social/goat@latest
|
||||
buildah push \
|
||||
--storage-driver vfs \
|
||||
${IMAGE_REGISTRY}/${IMAGE_USER}/atcr-appview:latest
|
||||
|
||||
# - name: Run GoReleaser
|
||||
# command: goreleaser release --clean
|
||||
- name: Build and push Hold image
|
||||
command: |
|
||||
buildah bud \
|
||||
--storage-driver vfs \
|
||||
--tag ${IMAGE_REGISTRY}/${IMAGE_USER}/atcr-hold:${TAG} \
|
||||
--tag ${IMAGE_REGISTRY}/${IMAGE_USER}/atcr-hold:latest \
|
||||
--file ./Dockerfile.hold \
|
||||
.
|
||||
|
||||
buildah push \
|
||||
--storage-driver vfs \
|
||||
${IMAGE_REGISTRY}/${IMAGE_USER}/atcr-hold:latest
|
||||
|
||||
Reference in New Issue
Block a user