Commit f7484ba7 authored by Eric Timmons's avatar Eric Timmons

Update CI

parent d8146d3b
Pipeline #2107 passed with stage
in 39 seconds
# include:
# - project: 'cl-docker-images/ci-helpers'
# file: '/cl-docker-images-default-pipeline.yml'
include:
- template: 'Workflows/Branch-Pipelines.gitlab-ci.yml'
- project: 'cl-docker-images/ci-helpers'
file: '/cl-docker-images-default-pipeline-v2.yml'
variables:
CANONICAL_NAMESPACE: daewok
CL_DOCKER_IMAGES_AMD64: "1"
CL_DOCKER_IMAGES_ARM64V8: "1"
CL_DOCKER_IMAGES_WINAMD64: "1"
WINDOWS_PARENT_IMAGES: "openjdk:15-windowsservercore-1809;openjdk:11-windowsservercore-1809;openjdk:8-windowsservercore-1809;openjdk:15-windowsservercore-ltsc2016;openjdk:11-windowsservercore-ltsc2016;openjdk:8-windowsservercore-ltsc2016"
stages:
- update nightly
- generate manifest
- build
- push
- put shared
- readme
##############################################################################
# Nightly version updater
Update nightly images:
stage: update nightly
image: alpine
script:
- apk add git openssh-client jq curl ca-certificates bash
- ./update.sh nightly
- |
if git diff --quiet; then
exit 0
fi
- NEW_COMMIT="$(grep -e "^ENV ABCL_COMMIT" nightly/buster/jdk-11/Dockerfile | cut -d" " -f 3)"
- mkdir -p ~/.ssh
- ssh-keyscan "$CI_SERVER_HOST" > ~/.ssh/known_hosts
- git remote add origin-ssh "git@$CI_SERVER_HOST:$CI_PROJECT_PATH.git"
- git add .
- git config user.name "$GITLAB_USER_NAME"
- git config user.email "$GITLAB_USER_EMAIL"
- git commit -m "Update nightly to commit $NEW_COMMIT"
- chmod 600 $NIGHTLY_DEPLOY_PRIVATE_KEY
- GIT_SSH_COMMAND="ssh -i $NIGHTLY_DEPLOY_PRIVATE_KEY" git push origin-ssh HEAD:$CI_COMMIT_BRANCH
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule" && $SCHEDULE_TYPE == "nightly-update"'
##############################################################################
# Fixup manifest
Generate manifest:
stage: generate manifest
script:
- mkdir -p build
- |
echo "GitFetch: refs/heads/$CI_COMMIT_REF_NAME" > "build/$CI_PROJECT_NAME"
- |
./generate-stackbrew-library.sh all >> "build/$CI_PROJECT_NAME"
- sed -i "s/github.com/gitlab.common-lisp.net/" "build/$CI_PROJECT_NAME"
artifacts:
paths:
- build/
tags:
- bashbrew-amd64
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule" && $SCHEDULE_TYPE == "nightly-update"'
when: never
- when: on_success
##############################################################################
# Build
.Bashbrew build Linux:
stage: build
variables:
BASHBREW_NAMESPACE: $CANONICAL_NAMESPACE
BASHBREW_LIBRARY: $CI_PROJECT_DIR/build
BASHBREW_CACHE: $CI_PROJECT_DIR/cache/bashbrew
BASHBREW_DEBUG: "true"
script:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker info
- mkdir -p cache
- |
parents="$(bashbrew cat --format '{{- range $.Entries -}}
{{- if not ($.SkipConstraints .) -}}
{{- $.DockerFroms . | join "\n" -}}
{{- "\n" -}}
{{- end -}}
{{- end -}}' $CI_PROJECT_NAME \
| { grep -vE '^$|^scratch$|^'"$CANONICAL_NAMESPACE/$CI_PROJECT_NAME"'(:|$)' || true; } \
| sort -u)"
- echo "$parents"
- |
for parent in $parents; do
echo "Pulling $parent"
docker pull --platform=$DOCKER_PLATFORM "$parent"
done
- retry -t 3 -d 60 -- bashbrew build $CI_PROJECT_NAME
- docker images
- bashbrew tag --target-namespace=$CANONICAL_NAMESPACE$ARCH$CI_PIPELINE_IID $CI_PROJECT_NAME
cache:
paths:
- cache
key: $ARCH
.Bashbrew build win:
stage: build
variables:
BASHBREW_NAMESPACE: $CANONICAL_NAMESPACE
BASHBREW_LIBRARY: $CI_PROJECT_DIR/build
BASHBREW_CACHE: $CI_PROJECT_DIR/cache/bashbrew
BASHBREW_DEBUG: "true"
ARCH: winamd64
BASHBREW_ARCH: windows-amd64
script:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker info
# Make the user specify the parent images. I don't feel like figuring out
# how to automatically figure them out using powershell.
- $parentArray = $WINDOWS_PARENT_IMAGES.split(";")
- foreach ($parent in $parentArray){ docker pull $parent }
- bashbrew --constraint windowsservercore-ltsc2016 --constraint windowsservercore-1809 build $CI_PROJECT_NAME
- docker images
- bashbrew --constraint windowsservercore-ltsc2016 --constraint windowsservercore-1809 tag --target-namespace=$CANONICAL_NAMESPACE$ARCH$CI_PIPELINE_IID $CI_PROJECT_NAME
cache:
paths:
- cache
key: $ARCH
tags:
- bashbrew-winamd64
Bashbrew build - amd64:
extends: .Bashbrew build Linux
variables:
ARCH: amd64
BASHBREW_ARCH: amd64
DOCKER_PLATFORM: linux/amd64
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule" && $SCHEDULE_TYPE == "nightly-update"'
when: never
- if: '$CL_DOCKER_IMAGES_AMD64 && $CI_COMMIT_REF_PROTECTED == "true"'
tags:
- bashbrew-amd64
Bashbrew build - arm64:
extends: .Bashbrew build Linux
variables:
ARCH: arm64v8
BASHBREW_ARCH: arm64v8
DOCKER_PLATFORM: linux/arm64
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule" && $SCHEDULE_TYPE == "nightly-update"'
when: never
- if: '$CL_DOCKER_IMAGES_ARM64V8 && $CI_COMMIT_REF_PROTECTED == "true"'
tags:
- bashbrew-arm64v8
Bashbrew build - arm32v7:
extends: .Bashbrew build Linux
variables:
ARCH: arm32v7
BASHBREW_ARCH: arm32v7
DOCKER_PLATFORM: linux/arm/v7
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule" && $SCHEDULE_TYPE == "nightly-update"'
when: never
- if: '$CL_DOCKER_IMAGES_ARM32V7 && $CI_COMMIT_REF_PROTECTED == "true"'
tags:
- bashbrew-arm32v7
Bashbrew build - winamd64:
extends: .Bashbrew build win
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule" && $SCHEDULE_TYPE == "nightly-update"'
when: never
- if: '$CL_DOCKER_IMAGES_WINAMD64 && $CI_COMMIT_REF_PROTECTED == "true"'
##############################################################################
# Push
.Bashbrew push Linux:
stage: push
variables:
BASHBREW_NAMESPACE: $CANONICAL_NAMESPACE
BASHBREW_LIBRARY: $CI_PROJECT_DIR/build
BASHBREW_CACHE: $CI_PROJECT_DIR/cache/bashbrew
BASHBREW_DEBUG: "true"
script:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker info
- mkdir -p cache
- bashbrew --namespace=$CANONICAL_NAMESPACE$ARCH$CI_PIPELINE_IID tag --target-namespace=$CANONICAL_NAMESPACE$ARCH $CI_PROJECT_NAME
- retry -t 3 -d 60 -- bashbrew --namespace=$CANONICAL_NAMESPACE$ARCH push $CI_PROJECT_NAME
cache:
paths:
- cache
key: $ARCH
.Bashbrew push win:
stage: push
variables:
BASHBREW_NAMESPACE: $CANONICAL_NAMESPACE
BASHBREW_LIBRARY: $CI_PROJECT_DIR/build
BASHBREW_CACHE: $CI_PROJECT_DIR/cache/bashbrew
BASHBREW_DEBUG: "true"
ARCH: winamd64
BASHBREW_ARCH: windows-amd64
script:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker info
- bashbrew --constraint windowsservercore-ltsc2016 --constraint windowsservercore-1809 --namespace=$CANONICAL_NAMESPACE$ARCH$CI_PIPELINE_IID tag --target-namespace=$CANONICAL_NAMESPACE$ARCH $CI_PROJECT_NAME
- bashbrew --constraint windowsservercore-ltsc2016 --constraint windowsservercore-1809 --namespace=$CANONICAL_NAMESPACE$ARCH push $CI_PROJECT_NAME
cache:
paths:
- cache
key: $ARCH
tags:
- bashbrew-winamd64
Bashbrew push - amd64:
extends: .Bashbrew push Linux
variables:
ARCH: amd64
BASHBREW_ARCH: amd64
DOCKER_PLATFORM: linux/amd64
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule" && $SCHEDULE_TYPE == "nightly-update"'
when: never
- if: ($CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH) && $CL_DOCKER_IMAGES_AMD64
tags:
- bashbrew-amd64
Bashbrew push - arm64:
extends: .Bashbrew push Linux
variables:
ARCH: arm64v8
BASHBREW_ARCH: arm64v8
DOCKER_PLATFORM: linux/arm64
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule" && $SCHEDULE_TYPE == "nightly-update"'
when: never
- if: ($CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH) && $CL_DOCKER_IMAGES_ARM64V8
tags:
- bashbrew-arm64v8
Bashbrew push - arm32v7:
extends: .Bashbrew push Linux
variables:
ARCH: arm32v7
BASHBREW_ARCH: arm32v7
DOCKER_PLATFORM: linux/arm/v7
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule" && $SCHEDULE_TYPE == "nightly-update"'
when: never
- if: ($CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH) && $CL_DOCKER_IMAGES_ARM32V7
tags:
- bashbrew-arm32v7
Bashbrew push - winamd64:
extends: .Bashbrew push win
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule" && $SCHEDULE_TYPE == "nightly-update"'
when: never
- if: ($CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH) && $CL_DOCKER_IMAGES_WINAMD64
##############################################################################
# Put shared
Bashbrew put-shared:
stage: put shared
put-shared clfoundation:
extends: Bashbrew put-shared
variables:
BASHBREW_NAMESPACE: $CANONICAL_NAMESPACE
BASHBREW_LIBRARY: $CI_PROJECT_DIR/build
BASHBREW_CACHE: $CI_PROJECT_DIR/cache/bashbrew
BASHBREW_DEBUG: "true"
script:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker info
- mkdir -p cache
- retry -t 3 -d 60 -- bashbrew --arch-namespace amd64=${CANONICAL_NAMESPACE}amd64 --arch-namespace arm32v7=${CANONICAL_NAMESPACE}arm32v7 --arch-namespace arm64v8=${CANONICAL_NAMESPACE}arm64v8 --arch-namespace windows-amd64=${CANONICAL_NAMESPACE}winamd64 put-shared "$CI_PROJECT_NAME"
tags:
- bashbrew-amd64
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule" && $SCHEDULE_TYPE == "nightly-update"'
when: never
- if: ($CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH)
cache:
paths:
- cache
key: put-shared
BASHBREW_NAMESPACE: clfoundation
##############################################################################
# Readme
Pushrm:
# We have to take the long way around to do this because Gitlab CI does not
# allow creating a job with no script. Ideally we would just use the
# container's entrypoint to do the work for us. We can't even override the
# entrypoint because the pushrm image is FROM scratch which doesn't have a
# shell... Watch https://gitlab.com/gitlab-org/gitlab/-/issues/19717
stage: readme
script:
- docker info
- ./generate-readme.sh < build/$CI_PROJECT_NAME > build/hub-description.md
- |
docker run -i \
-v $(pwd):/app \
-e DOCKER_USER=$DOCKER_README_USERNAME -e DOCKER_PASS="$DOCKER_README_PASSWORD" \
chko/docker-pushrm:1 \
--file /app/build/hub-description.md \
--debug \
$CANONICAL_NAMESPACE/$CI_PROJECT_NAME
artifacts:
paths:
- build/hub-description.md
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule" && $SCHEDULE_TYPE == "nightly-update"'
when: never
- if: ($CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH)
tags:
- bashbrew-amd64
Pushrm clfoundation:
extends: Pushrm
variables:
README_NAMESPACE: clfoundation
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment