switch $TYPE logic to work during tests

THe recent changes were a bit short-sighted, not putting into
consideration all labels and different behaviour during testing. This
final commit should fix building for all versions, be it snapshot, a
release snapshot or a regular point release.

Signed-off-by: Paul Spooren <mail@aparcar.org>
pull/79/head
Paul Spooren 2021-02-27 19:49:39 -10:00
parent 9d87aec468
commit f7a375b9dc
5 changed files with 13 additions and 12 deletions

View File

@ -5,7 +5,8 @@ build-imagebuilder_x86-64:
script: |
bash docker-imagebuilder.sh
TARGET=$(echo "$CI_JOB_NAME" | cut -d _ -f 2-)
docker tag "$DOCKER_IMAGE:$TARGET" \
VERSION="${VERSION:-snapshot}"
docker tag "$DOCKER_IMAGE:$TARGET-$VERSION" \
"$DOCKER_IMAGE:imagebuilder-$TARGET-$CI_COMMIT_REF_SLUG"
docker push "$DOCKER_IMAGE:imagebuilder-$TARGET-$CI_COMMIT_REF_SLUG"

View File

@ -1,4 +1,3 @@
build-rootfs_x86-64:
extends: .build
except:
@ -9,7 +8,8 @@ build-rootfs_x86-64:
script: |
bash docker-rootfs.sh
TARGET=$(echo "$CI_JOB_NAME" | cut -d _ -f 2-)
docker tag "$DOCKER_IMAGE:$TARGET" \
VERSION="${VERSION:-snapshot}"
docker tag "$DOCKER_IMAGE:$TARGET-$VERSION" \
"$DOCKER_IMAGE:rootfs-$TARGET-$CI_COMMIT_REF_SLUG"
docker push "$DOCKER_IMAGE:rootfs-$TARGET-$CI_COMMIT_REF_SLUG"

View File

@ -1,29 +1,29 @@
rootfs_x86-64:
deploy-rootfs_x86-64:
extends: .deploy-rootfs
variables:
ARCH: x86_64
rootfs_x86-generic:
deploy-rootfs_x86-generic:
extends: .deploy-rootfs
variables:
ARCH: i386_pentium4
rootfs_x86-geode:
deploy-rootfs_x86-geode:
extends: .deploy-rootfs
variables:
ARCH: i386_pentium-mmx
rootfs_armvirt-32:
deploy-rootfs_armvirt-32:
extends: .deploy-rootfs
variables:
ARCH: arm_cortex-a15_neon-vfpv4
rootfs_armvirt-64:
deploy-rootfs_armvirt-64:
extends: .deploy-rootfs
variables:
ARCH: aarch64_cortex-a53
rootfs_malta-be:
deploy-rootfs_malta-be:
extends: .deploy-rootfs
variables:
ARCH: mips_24kc

View File

@ -7,7 +7,7 @@ export_variables() {
export JOB
TARGET="${TARGET:-$JOB}"
export TARGET
TYPE=$(echo "$CI_JOB_NAME" | cut -d _ -f 1)
TYPE=$(echo "$CI_JOB_NAME" | cut -d _ -f 1 | cut -d - -f 2)
export TYPE
export VERSION="${VERSION:-snapshot}"
export DOCKERFILE="${DOCKERFILE:-Dockerfile}"

View File

@ -12,7 +12,7 @@ gen_targets_sdk() {
ARCH=$(echo "$LINE" | cut -d ' ' -f 1)
TARGETS=$(echo "$LINE" | cut -d ' ' -f 2-)
echo "
sdk_$ARCH:
deploy-sdk_$ARCH:
extends: .deploy-sdk
variables:
TARGETS: \"$TARGETS\""
@ -23,7 +23,7 @@ gen_targets_imagebuilder() {
perl ./scripts/dump-target-info.pl targets | while read -r LINE; do
TARGET=$(echo "$LINE" | cut -d ' ' -f 1 | tr '/' '-')
echo "
imagebuilder_$TARGET:
deploy-imagebuilder_$TARGET:
extends: .deploy-imagebuilder"
done
}