Verified Commit dc3e3dac authored by Ueli Banholzer's avatar Ueli Banholzer 🚀
Browse files

feat: build on gitlab and push to own mirror

parent 61df2de8
Pipeline #82885 passed with stage
in 19 minutes and 59 seconds
variables:
ALPINE_ARCH: x86_64
APORTS_SCRIPTS: /home/sandbox/scripts
DOCKER_BUILDKIT: 1
DOCKER_REGISTRY: registry.whatwedo.ch
DOCKER_REGISTRY_USERNAME: whatwedo
DOCKER_BUILD_TARGET: prod
DOCKER_BUILD_ROOT: .
DOCKER_HOST: tcp://docker:2375/
DOCKER_TLS_CERTDIR: ""
DOCKER_DRIVER: overlay2
GCP_PROJECT_ID: wwd-devops
build:
stage: build
image: ubuntu:20.04
services:
- name: docker:stable-dind
alias: docker
interruptible: true
only:
- wwd-mirror
script:
- ALPINE_VERSION_SLUG=v$ALPINE_VERSION
- PHP_VERSION_SLUG=php-$PHP_VERSION
- PA_BUILD_SLUG=v${ALPINE_VERSION}_$PHP_VERSION_SLUG_${PA_ARCH}
- PA_BUILD_PATH=repo/v$ALPINE_VERSION/$PHP_VERSION_SLUG/${PA_ARCH}
- apt update
- apt install docker.io docker-compose curl -y
- echo "" > .env
- echo "$APK_PRIVATE_KEY" > .abuild/php-alpine.rsa
- echo "$APK_PUBLIC_KEY" > .abuild/php-alpine.rsa.pub
- mkdir repo/v$ALPINE_VERSION
- docker-compose run sandbox buildrepo -a $APORTS_SCRIPTS -p $PHP_VERSION_SLUG
- curl -Lo google-cloud-sdk.tar.gz https://dl.google.com/dl/cloudsdk/release/google-cloud-sdk.tar.gz
- tar zxvf google-cloud-sdk.tar.gz && ./google-cloud-sdk/install.sh --usage-reporting=false --path-update=true
- PATH="google-cloud-sdk/bin:${PATH}"
- gcloud --quiet components update
- echo $GCP_SERVICE_KEY > ${HOME}/gcloud-service-key.json
- gcloud auth activate-service-account --key-file ${HOME}/gcloud-service-key.json
- gcloud config set project $GCP_PROJECT_ID
- gsutil -m rm -r gs://packages.whatwedo.ch/php-alpine/v$ALPINE_VERSION/$PHP_VERSION_SLUG/$PA_ARCH/** || true
- gsutil -m cp -R repo/v$ALPINE_VERSION/$PHP_VERSION_SLUG/${PA_ARCH}/* gs://packages.whatwedo.ch/php-alpine/v$ALPINE_VERSION/$PHP_VERSION_SLUG/${PA_ARCH}
parallel:
matrix:
# alpine-v3.12-php-8.0
- ALPINE_VERSION: "3.12"
PHP_VERSION: "8.0"
PHP_MINOR_VERSION: "8.0.1"
PA_ARCH: "x86_64"
# alpine-v3.12-php-7.4
- ALPINE_VERSION: "3.12"
PHP_VERSION: "7.4"
PHP_MINOR_VERSION: "7.4.14"
PA_ARCH: "x86_64"
# alpine-v3.11-php-8.0
- ALPINE_VERSION: "3.11"
PHP_VERSION: "8.0"
PHP_MINOR_VERSION: "8.0.1"
PA_ARCH: "x86_64"
# alpine-v3.11-php-7.4
- ALPINE_VERSION: "3.11"
PHP_VERSION: "7.4"
PHP_MINOR_VERSION: "7.4.14"
PA_ARCH: "x86_64"
# alpine-v3.11-php-7.3
- ALPINE_VERSION: "3.11"
PHP_VERSION: "7.3"
PHP_MINOR_VERSION: "7.3.26"
PA_ARCH: "x86_64"
# alpine-v3.10-php-7.4
- ALPINE_VERSION: "3.10"
PHP_VERSION: "7.4"
PHP_MINOR_VERSION: "7.4.14"
PA_ARCH: "x86_64"
# alpine-v3.10-php-7.3
- ALPINE_VERSION: "3.10"
PHP_VERSION: "7.3"
PHP_MINOR_VERSION: "7.3.26"
PA_ARCH: "x86_64"
# syntax version.
version: "3"
version: "3.4"
# volumes.
volumes:
......@@ -12,13 +12,13 @@ services:
# sandbox base image
sandbox:
# target image.
image: "codecasts/php-alpine:sandbox-v${ALPINE_VERSION}"
network_mode: host
# enable tty.
tty: true
# build config.
build:
context: "sandbox"
network: host
args:
ALPINE_VERSION: ${ALPINE_VERSION}
APK_MAINTAINER: ${APK_MAINTAINER}
......
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