gitlab-ce-arm64/.gitlab-ci.yml
2021-01-09 09:48:48 +00:00

55 lines
2.1 KiB
YAML

variables:
BASENAME: gitlab-ce-arm64v8
DOCKER_TLS_CERTDIR: ""
stages:
- check
- build
check:
image: docker:stable-git
stage: check
tags:
- docker
only:
- branches
script:
- apk add --no-cache --upgrade openssh-client bash curl coreutils
- git config --global user.email $GIT_USER_EMAIL && git config --global user.name $GIT_USER_NAME
- mkdir -p ~/.ssh && echo "$GITLAB_SSH_PRIV_KEY" > ~/.ssh/id_rsa && ssh-keyscan -H ${CI_SERVER_HOST} > ~/.ssh/known_hosts && chmod -R 0600 ~/.ssh/
- git fetch --tags && ./check-version.sh && ./create-tags.sh
- git push --tags https://${GITLAB_USER_LOGIN}:${PERSONAL_ACCESS_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}.git
build:
image: arm64v8/docker:stable-git
stage: build
services:
- name: arm64v8/docker:stable-dind
alias: docker
tags:
- aarch64
- docker
only:
- tags
before_script:
- docker info
script:
- apk add --no-cache --upgrade bash coreutils
# fetch dockerfile
- ./set-branch-name.sh && export BRANCH_NAME=$(cat branch_name) && echo ${BRANCH_NAME}
- git clone -b ${BRANCH_NAME} --depth=1 https://gitlab.com/gitlab-org/omnibus-gitlab.git
- cd ./omnibus-gitlab/docker
# write RELEASE
- echo "PACKAGECLOUD_REPO=gitlab-ce" > RELEASE && echo "RELEASE_PACKAGE=gitlab-ce" >> RELEASE && echo "RELEASE_VERSION=${CI_COMMIT_TAG}" >> RELEASE && echo "DOWNLOAD_URL=https://packages.gitlab.com/gitlab/gitlab-ce/packages/ubuntu/focal/gitlab-ce_${CI_COMMIT_TAG}_arm64.deb/download.deb" >> RELEASE
# use the same ubuntu version with the package
- sed -i 's/ubuntu:.*/ubuntu:focal/' ./Dockerfile
# missing package libatomic1 after version 13
- sed -i 's/less/less libatomic1/' ./Dockerfile
# build
- docker build -t ${DOCKER_NS}/${BASENAME}:${CI_COMMIT_TAG} -f ./Dockerfile ./
# latest tag
- cd ../../ && git fetch --tags && ./latest-tag.sh
# docker push
- docker login --username ${DOCKER_USERNAME} --password ${DOCKER_PASSWORD}
- docker images && docker push ${DOCKER_NS}/${BASENAME}