4 Commits

Author SHA1 Message Date
Chris Evich
b591a3d7c5 Remove broken workflow rules
They were preventing builds on main and on tags.  Rather than try and
debug them, just kill them as they're mostly unnecessary for this repo.

Signed-off-by: Chris Evich <chris_gitlab@icuc.me>
2022-11-25 23:28:47 -05:00
Chris Evich
b21181a446 Fix build job not running on main or tag push
Signed-off-by: Chris Evich <chris_gitlab@icuc.me>
2022-11-25 23:26:35 -05:00
Chris Evich
c80dfffa14 Merge branch 'switch_to_buildah' into 'main'
Switch to using buildah

See merge request qontainers/pipglr!11
2022-11-26 04:20:51 +00:00
Chris Evich
cbb3eb0e22 Switch to using buildah
Observations show the runtime is about the same (since performance is mostly
storage-io bound.  However, buildah images are more compact and there
are simpler possibilities for build-caching available for future use.

Signed-off-by: Chris Evich <chris_gitlab@icuc.me>
2022-11-25 23:15:26 -05:00

View File

@@ -1,22 +1,39 @@
--- ---
stages: default:
- build image: quay.io/buildah/stable:v1.28.0
build:
stage: build
tags: tags:
- docker - docker
- linux - linux
image:
name: gcr.io/kaniko-project/executor:v1.6.0-debug envars:
entrypoint: ["/busybox/sh", "-c"] stage: test
script: |
echo "Select CI env. vars.:";
printenv | egrep '^CI_' | sort
commit_check:
stage: test
variables:
BADRX: '^(squash!)|(fixup!)'
script: |
dnf install -y git
shortlogtmp=$(mktemp -p '' commit_check_tmp_XXXX)
git log --oneline --no-show-signature "${CI_MERGE_REQUEST_DIFF_BASE_SHA}..HEAD" > "$shortlogtmp"
if egrep -q "$BADRX" "$shortlogtmp"; then
egrep "$BADRX" "$shortlogtmp"
die "Found the above commits matching '$BADRX'"
fi
build:
stage: deploy
variables:
BUILDAH_FORMAT: docker
BUILDAH_ISOLATION: chroot
STORAGE_DRIVER: vfs
before_script:
- echo "$CI_REGISTRY_PASSWORD" | buildah login -u "$CI_REGISTRY_USER" --password-stdin $CI_REGISTRY
script: script:
- 'mkdir -p /kaniko/.docker'
- 'echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json'
- |
echo "Select CI env. vars.:";
printenv | egrep '^CI_' | sort
# N/B: There could be more than one merge-request open with this branch's HEAD # N/B: There could be more than one merge-request open with this branch's HEAD
- | - |
IMAGE_TAG="${CI_COMMIT_BRANCH}"; IMAGE_TAG="${CI_COMMIT_BRANCH}";
@@ -28,12 +45,12 @@ build:
IMAGE_TAG="latest"; IMAGE_TAG="latest";
fi fi
echo "Building/Pushing to: ${CI_REGISTRY_IMAGE}:${IMAGE_TAG}"; echo "Building/Pushing to: ${CI_REGISTRY_IMAGE}:${IMAGE_TAG}";
- | - >-
/kaniko/executor \ buildah build \
--context $CI_PROJECT_DIR \ --label "org.opencontainers.image.source=${CI_PROJECT_URL}" \
--dockerfile $CI_PROJECT_DIR/Containerfile \ --label "org.opencontainers.image.revision=$CI_COMMIT_SHA" \
--destination "${CI_REGISTRY_IMAGE}:${IMAGE_TAG}" \ --label "org.opencontainers.image.created=$CI_JOB_STARTED_AT" \
--label "org.opencontainers.image.source=${CI_PROJECT_URL}" \ --label "org.opencontainers.image.version=${IMAGE_TAG}" \
--label "org.opencontainers.image.revision=$CI_COMMIT_SHA" \ -t "${CI_REGISTRY_IMAGE}:${IMAGE_TAG}" "$CI_PROJECT_DIR"
--label "org.opencontainers.image.created=$CI_JOB_STARTED_AT" \ - buildah images
--label "org.opencontainers.image.version=${IMAGE_TAG}" - buildah push "${CI_REGISTRY_IMAGE}:${IMAGE_TAG}"