mirror of
https://tangled.org/evan.jarrett.net/at-container-registry
synced 2026-09-26 04:04:15 +00:00
87 lines
2.2 KiB
YAML
87 lines
2.2 KiB
YAML
# ATCR Release Pipeline for Tangled.org
|
|
# Triggers on version tags and builds cross-platform binaries using buildah
|
|
|
|
when:
|
|
- event: ["push"]
|
|
tag: ["v*"]
|
|
|
|
engine: "buildah"
|
|
|
|
environment:
|
|
IMAGE_REGISTRY: atcr.io
|
|
IMAGE_USER: evan.jarrett.net
|
|
|
|
steps:
|
|
- name: Get tag for current commit
|
|
command: |
|
|
#test
|
|
# Fetch tags (shallow clone doesn't include them by default)
|
|
git fetch --tags
|
|
|
|
# Find the tag that points to the current commit
|
|
TAG=$(git tag --points-at HEAD | grep -E '^v[0-9]' | head -n1)
|
|
|
|
if [ -z "$TAG" ]; then
|
|
echo "Error: No version tag found for current commit"
|
|
echo "Available tags:"
|
|
git tag
|
|
echo "Current commit:"
|
|
git rev-parse HEAD
|
|
exit 1
|
|
fi
|
|
|
|
echo "Building version: $TAG"
|
|
echo "$TAG" > .version
|
|
|
|
- name: Setup registry credentials
|
|
command: |
|
|
mkdir -p ~/.docker
|
|
cat > ~/.docker/config.json <<EOF
|
|
{
|
|
"auths": {
|
|
"${IMAGE_REGISTRY}": {
|
|
"auth": "$(echo -n "${IMAGE_USER}:${APP_PASSWORD}" | base64)"
|
|
}
|
|
}
|
|
}
|
|
EOF
|
|
chmod 600 ~/.docker/config.json
|
|
|
|
- name: Build and push AppView image
|
|
command: |
|
|
TAG=$(cat .version)
|
|
|
|
buildah bud \
|
|
--storage-driver vfs \
|
|
--tag ${IMAGE_REGISTRY}/${IMAGE_USER}/atcr-appview:${TAG} \
|
|
--tag ${IMAGE_REGISTRY}/${IMAGE_USER}/atcr-appview:latest \
|
|
--file ./Dockerfile.appview \
|
|
.
|
|
|
|
buildah push \
|
|
--storage-driver vfs \
|
|
${IMAGE_REGISTRY}/${IMAGE_USER}/atcr-appview:${TAG}
|
|
|
|
buildah push \
|
|
--storage-driver vfs \
|
|
${IMAGE_REGISTRY}/${IMAGE_USER}/atcr-appview:latest
|
|
|
|
- name: Build and push Hold image
|
|
command: |
|
|
TAG=$(cat .version)
|
|
|
|
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:${TAG}
|
|
|
|
buildah push \
|
|
--storage-driver vfs \
|
|
${IMAGE_REGISTRY}/${IMAGE_USER}/atcr-hold:latest
|