2022-06-05 10:01:53 +05:30
|
|
|
stages:
|
2022-06-06 10:24:43 +05:30
|
|
|
- dependencies
|
2022-06-06 12:44:11 +05:30
|
|
|
- build
|
|
|
|
- publish
|
2022-06-06 10:16:20 +05:30
|
|
|
|
2022-06-06 10:24:43 +05:30
|
|
|
variables:
|
2022-06-06 10:16:20 +05:30
|
|
|
TZ: "UTC"
|
|
|
|
GIT_DEPTH: "1"
|
|
|
|
|
2022-06-06 10:24:43 +05:30
|
|
|
.build-job: &build-job
|
2022-06-07 06:14:23 +05:30
|
|
|
image: docker.io/library/debian:buster
|
2022-06-06 10:16:20 +05:30
|
|
|
needs: [ ]
|
|
|
|
before_script:
|
|
|
|
- apt -qq update
|
2022-06-06 10:48:58 +05:30
|
|
|
- apt install -y --no-install-recommends -qq build-essential ca-certificates cmake curl libreadline-dev libsystemd-dev tar
|
2022-06-06 10:24:43 +05:30
|
|
|
|
|
|
|
lua:
|
|
|
|
<<: *build-job
|
|
|
|
stage: dependencies
|
2022-06-06 10:48:58 +05:30
|
|
|
script: make -C deps/lua
|
2022-06-06 10:16:20 +05:30
|
|
|
artifacts:
|
2022-06-06 13:21:31 +05:30
|
|
|
expire_in: 7 days
|
|
|
|
paths: [ "deps/lua/lua-dist.tar.gz" ]
|
2022-06-05 10:01:53 +05:30
|
|
|
|
2022-06-06 10:24:43 +05:30
|
|
|
pcre2:
|
|
|
|
<<: *build-job
|
|
|
|
stage: dependencies
|
2022-06-06 10:48:58 +05:30
|
|
|
script: make -C deps/pcre2
|
2022-06-06 10:24:43 +05:30
|
|
|
artifacts:
|
2022-06-06 13:21:31 +05:30
|
|
|
expire_in: 7 days
|
|
|
|
paths: [ "deps/pcre2/pcre2-dist.tar.gz" ]
|
2022-06-05 10:01:53 +05:30
|
|
|
|
2022-06-06 10:24:43 +05:30
|
|
|
quictls:
|
|
|
|
<<: *build-job
|
|
|
|
stage: dependencies
|
|
|
|
script: make -C deps/quictls
|
|
|
|
artifacts:
|
2022-06-06 13:21:31 +05:30
|
|
|
expire_in: 7 days
|
|
|
|
paths: [ "deps/quictls/quictls-dist.tar.gz" ]
|
2022-06-05 10:01:53 +05:30
|
|
|
|
2022-06-06 10:24:43 +05:30
|
|
|
haproxy:
|
|
|
|
<<: *build-job
|
2022-06-06 12:44:11 +05:30
|
|
|
stage: build
|
2022-06-06 11:22:47 +05:30
|
|
|
script:
|
2022-06-06 13:21:31 +05:30
|
|
|
- apt install -y --no-install-recommends -qq bzip2 git
|
|
|
|
- mkdir deps/lua/dist && tar -C deps/lua/dist -xf deps/lua/lua-dist.tar.gz
|
|
|
|
- mkdir deps/pcre2/dist && tar -C deps/pcre2/dist -xf deps/pcre2/pcre2-dist.tar.gz
|
|
|
|
- mkdir deps/quictls/dist && tar -C deps/quictls/dist -xf deps/quictls/quictls-dist.tar.gz
|
2022-06-06 11:22:47 +05:30
|
|
|
- make -C haproxy
|
2022-06-06 10:24:43 +05:30
|
|
|
needs:
|
|
|
|
- job: lua
|
|
|
|
artifacts: true
|
|
|
|
- job: pcre2
|
|
|
|
artifacts: true
|
|
|
|
- job: quictls
|
|
|
|
artifacts: true
|
|
|
|
artifacts:
|
2022-06-06 13:21:31 +05:30
|
|
|
expire_in: 7 days
|
|
|
|
paths: [ "haproxy/dist", "haproxy/haproxy-dist.tar.gz" ]
|
2022-06-06 12:44:11 +05:30
|
|
|
|
|
|
|
docker:
|
|
|
|
stage: publish
|
|
|
|
image:
|
|
|
|
name: gcr.io/kaniko-project/executor:debug
|
|
|
|
entrypoint: [ "" ]
|
|
|
|
before_script:
|
|
|
|
- mkdir -p /kaniko/.docker
|
|
|
|
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"gitlab-ci-token\",\"password\":\"$CI_JOB_TOKEN\"}}}" > /kaniko/.docker/config.json
|
|
|
|
script: |
|
|
|
|
set -eu
|
|
|
|
|
|
|
|
export HAPROXY_VER="2.6"
|
2022-06-06 12:54:06 +05:30
|
|
|
export DEBIAN_CODENAME="bullseye"
|
|
|
|
|
2022-06-06 12:44:11 +05:30
|
|
|
export JOB_TIMESTAMP="$(date -D '%Y-%m-%dT%H:%M:%S%Z' -d "$CI_JOB_STARTED_AT" +'%Y%m%d-%H%M')"
|
|
|
|
|
|
|
|
echo "Building image with"
|
2022-06-06 12:54:06 +05:30
|
|
|
echo " -> haproxy version: $HAPROXY_VER"
|
2022-06-06 12:44:11 +05:30
|
|
|
echo " -> debian codename: $DEBIAN_CODENAME"
|
|
|
|
echo " -> git commit hash: $CI_COMMIT_SHORT_SHA"
|
|
|
|
echo " -> build timestamp: $JOB_TIMESTAMP"
|
|
|
|
|
|
|
|
export IMAGE_TAG_UNIQUE="$HAPROXY_VER-$DEBIAN_CODENAME-$CI_COMMIT_SHORT_SHA-$JOB_TIMESTAMP"
|
|
|
|
export IMAGE_TAG_ROLLING_COMMIT="git-$CI_COMMIT_SHORT_SHA"
|
|
|
|
export IMAGE_TAG_ROLLING_GITREF="$CI_COMMIT_REF_SLUG"
|
|
|
|
|
|
|
|
export IMAGE_TAG_VERSIONS="$HAPROXY_VER-$DEBIAN_CODENAME"
|
|
|
|
if [ "$CI_COMMIT_REF_NAME" != "$CI_DEFAULT_BRANCH" ]; then
|
|
|
|
export IMAGE_TAG_VERSIONS="branch-$CI_COMMIT_REF_SLUG-$IMAGE_TAG_VERSIONS"
|
|
|
|
echo "Git reference $CI_COMMIT_REF_NAME is not the default branch. Rewriting git rolling tag as $IMAGE_TAG_VERSIONS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "***"
|
|
|
|
echo "Will build and push image as:"
|
|
|
|
echo "- $CI_REGISTRY_IMAGE:$IMAGE_TAG_UNIQUE"
|
|
|
|
echo "- $CI_REGISTRY_IMAGE:$IMAGE_TAG_ROLLING_COMMIT"
|
|
|
|
echo "- $CI_REGISTRY_IMAGE:$IMAGE_TAG_ROLLING_GITREF"
|
|
|
|
echo "- $CI_REGISTRY_IMAGE:$IMAGE_TAG_VERSIONS"
|
|
|
|
echo "***"
|
|
|
|
|
|
|
|
(
|
|
|
|
set -x;
|
|
|
|
/kaniko/executor \
|
|
|
|
--context . \
|
|
|
|
--dockerfile Dockerfile \
|
|
|
|
--build-arg "CANONICAL_VERSION=$IMAGE_TAG_UNIQUE" \
|
|
|
|
--destination "$CI_REGISTRY_IMAGE:$IMAGE_TAG_UNIQUE" \
|
|
|
|
--destination "$CI_REGISTRY_IMAGE:$IMAGE_TAG_ROLLING_COMMIT" \
|
|
|
|
--destination "$CI_REGISTRY_IMAGE:$IMAGE_TAG_ROLLING_GITREF" \
|
|
|
|
--destination "$CI_REGISTRY_IMAGE:$IMAGE_TAG_VERSIONS" \
|
|
|
|
--single-snapshot
|
|
|
|
)
|
|
|
|
needs:
|
|
|
|
- job: quictls
|
|
|
|
artifacts: true
|
|
|
|
- job: haproxy
|
|
|
|
artifacts: true
|
2022-06-06 13:21:31 +05:30
|
|
|
|
|
|
|
pkg:quictls:
|
|
|
|
image: docker.io/curlimages/curl:latest
|
|
|
|
stage: publish
|
|
|
|
needs:
|
|
|
|
- job: quictls
|
|
|
|
artifacts: true
|
|
|
|
script: |
|
|
|
|
set -eu
|
2022-06-07 08:36:13 +05:30
|
|
|
|
2022-06-06 13:21:31 +05:30
|
|
|
PKG_VER=1.1.1o
|
|
|
|
if [ "$CI_COMMIT_REF_NAME" != "$CI_DEFAULT_BRANCH" ]; then
|
|
|
|
export PKG_VER="branch-$CI_COMMIT_REF_SLUG"
|
|
|
|
echo "Git reference $CI_COMMIT_REF_NAME is not the default branch. Setting version to $PKG_VER"
|
|
|
|
fi
|
2022-06-07 08:36:13 +05:30
|
|
|
|
|
|
|
curl -fsSL \
|
2022-06-06 13:21:31 +05:30
|
|
|
-H"JOB-TOKEN: $CI_JOB_TOKEN" \
|
|
|
|
--upload-file "deps/quictls/quictls-dist.tar.gz" \
|
|
|
|
"${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/quictls/$PKG_VER/quictls.tar.gz"
|
|
|
|
variables:
|
|
|
|
GIT_STRATEGY: none
|
|
|
|
|
|
|
|
pkg:haproxy:
|
|
|
|
image: docker.io/curlimages/curl:latest
|
|
|
|
stage: publish
|
|
|
|
needs:
|
|
|
|
- job: haproxy
|
|
|
|
artifacts: true
|
|
|
|
script: |
|
|
|
|
set -eu
|
2022-06-07 08:36:13 +05:30
|
|
|
|
2022-06-06 13:21:31 +05:30
|
|
|
PKG_VER=2.6.0
|
|
|
|
if [ "$CI_COMMIT_REF_NAME" != "$CI_DEFAULT_BRANCH" ]; then
|
|
|
|
export PKG_VER="branch-$CI_COMMIT_REF_SLUG"
|
|
|
|
echo "Git reference $CI_COMMIT_REF_NAME is not the default branch. Setting version to $PKG_VER"
|
|
|
|
fi
|
2022-06-07 08:36:13 +05:30
|
|
|
|
|
|
|
curl -fsSL \
|
2022-06-06 13:21:31 +05:30
|
|
|
-H"JOB-TOKEN: $CI_JOB_TOKEN" \
|
|
|
|
--upload-file "haproxy/haproxy-dist.tar.gz" \
|
|
|
|
"${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/haproxy/$PKG_VER/haproxy.tar.gz"
|
|
|
|
variables:
|
|
|
|
GIT_STRATEGY: none
|
2022-06-07 11:44:34 +05:30
|
|
|
|
|
|
|
deb:haproxy:
|
|
|
|
<<: *build-job
|
|
|
|
stage: build
|
|
|
|
script:
|
|
|
|
- apt install -y --no-install-recommends -qq bzip2 devscripts debhelper git pkg-config
|
|
|
|
- mkdir deps/lua/dist && tar -C deps/lua/dist -xf deps/lua/lua-dist.tar.gz
|
|
|
|
- mkdir deps/pcre2/dist && tar -C deps/pcre2/dist -xf deps/pcre2/pcre2-dist.tar.gz
|
|
|
|
- mkdir deps/quictls/dist && tar -C deps/quictls/dist -xf deps/quictls/quictls-dist.tar.gz
|
|
|
|
- make -C haproxy
|
|
|
|
needs:
|
|
|
|
- job: lua
|
|
|
|
artifacts: true
|
|
|
|
- job: pcre2
|
|
|
|
artifacts: true
|
|
|
|
- job: quictls
|
|
|
|
artifacts: true
|