2020-07-22 22:47:20 +08:00
|
|
|
variables:
|
2021-03-17 18:15:11 +08:00
|
|
|
BASENAME: ${CI_PROJECT_NAME}v8
|
2020-07-22 22:47:20 +08:00
|
|
|
DOCKER_TLS_CERTDIR: ""
|
|
|
|
|
|
|
|
stages:
|
|
|
|
- check
|
|
|
|
- build
|
|
|
|
|
|
|
|
check:
|
2021-07-09 10:07:53 +08:00
|
|
|
image: docker:git
|
2020-07-22 22:47:20 +08:00
|
|
|
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
|
2020-12-10 10:45:55 +08:00
|
|
|
- mkdir -p ~/.ssh && echo "$GITLAB_SSH_PRIV_KEY" > ~/.ssh/id_rsa && ssh-keyscan -H ${CI_SERVER_HOST} > ~/.ssh/known_hosts && chmod -R 0600 ~/.ssh/
|
2020-11-24 17:07:19 +08:00
|
|
|
- git fetch --tags && ./check-version.sh && ./create-tags.sh
|
2020-12-10 11:45:19 +08:00
|
|
|
- git push --tags https://${GITLAB_USER_LOGIN}:${PERSONAL_ACCESS_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}.git
|
2020-07-22 22:47:20 +08:00
|
|
|
|
|
|
|
build:
|
2023-05-29 10:12:22 +08:00
|
|
|
image: docker:git
|
2020-07-22 22:47:20 +08:00
|
|
|
stage: build
|
|
|
|
services:
|
2023-05-29 10:12:22 +08:00
|
|
|
- name: docker:dind
|
2020-07-22 22:47:20 +08:00
|
|
|
alias: docker
|
|
|
|
tags:
|
|
|
|
- aarch64
|
|
|
|
- docker
|
|
|
|
only:
|
|
|
|
- tags
|
|
|
|
before_script:
|
|
|
|
- docker info
|
|
|
|
script:
|
|
|
|
- apk add --no-cache --upgrade bash coreutils
|
|
|
|
# fetch dockerfile
|
2021-01-11 21:20:29 +08:00
|
|
|
- BRANCH_NAME=$(echo ${CI_COMMIT_TAG} | sed 's/\-/\+/') && echo ${BRANCH_NAME}
|
2023-07-18 23:54:26 +08:00
|
|
|
- if [ ! -z "$httpProxy" ]; then git config --global http.proxy $httpProxy; fi
|
2020-12-10 13:34:47 +08:00
|
|
|
- git clone -b ${BRANCH_NAME} --depth=1 https://gitlab.com/gitlab-org/omnibus-gitlab.git
|
2020-07-22 22:47:20 +08:00
|
|
|
- cd ./omnibus-gitlab/docker
|
|
|
|
# write RELEASE
|
2020-11-24 17:07:19 +08:00
|
|
|
- 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
|
2020-11-24 17:58:36 +08:00
|
|
|
# missing package libatomic1 after version 13
|
2021-07-08 17:24:37 +08:00
|
|
|
- sed -i 's/\-recommends/\-recommends libatomic1/' Dockerfile
|
2021-01-11 21:20:29 +08:00
|
|
|
# debian has /etc/os-release instead of /etc/lsb-release
|
|
|
|
- sed -i 's/lsb-release/os-release/' assets/setup
|
2020-11-24 17:58:36 +08:00
|
|
|
# build
|
2021-01-11 21:20:29 +08:00
|
|
|
- docker build -t ${DOCKER_NS}/${BASENAME}:${CI_COMMIT_TAG} -f Dockerfile ./
|
2020-07-22 22:47:20 +08:00
|
|
|
# latest tag
|
2020-11-24 17:07:19 +08:00
|
|
|
- cd ../../ && git fetch --tags && ./latest-tag.sh
|
2020-07-22 22:47:20 +08:00
|
|
|
# docker push
|
|
|
|
- docker login --username ${DOCKER_USERNAME} --password ${DOCKER_PASSWORD}
|
2021-07-09 10:52:49 +08:00
|
|
|
- docker images && docker push -a ${DOCKER_NS}/${BASENAME}
|