Verified Commit 7ee6e849 authored by Olivier Benz's avatar Olivier Benz
Browse files

Merge branch 'master' into freeze-version

parents ecd036d4 da49a238
......@@ -9,7 +9,7 @@
if [[ $CI_COMMIT_BRANCH == "master" ]]; then
export CI_APP_TAG=${CI_APP_TAG:-latest}
elif [[ $CI_COMMIT_BRANCH == "freeze-version" ]]; then
export CI_APP_TAG=${CI_APP_TAG:-4.1.3}
export CI_APP_TAG=${CI_APP_TAG:-$R_VERSION}
else
export CI_APP_TAG=${CI_APP_TAG:-$CI_COMMIT_SHA}
fi
......@@ -17,9 +17,7 @@
echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER
--password-stdin $CI_REGISTRY
- >
export VERSION_MAJ_MIN_PAT=`sed -n
"s|.*r-ver:\([[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+\).*|\1|p"
r-ver/$CI_APP_TAG.Dockerfile | head -1`
export VERSION_MAJ_MIN_PAT=$R_VERSION
export VERSION_MAJ_MIN=`echo $VERSION_MAJ_MIN_PAT |
sed -n "s|\([[:digit:]]\+\.[[:digit:]]\+\).*|\1|p"`
......@@ -35,6 +33,7 @@
variables:
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: "/certs"
R_VERSION: "4.2.0"
before_script:
- *before-script-build
......@@ -45,10 +44,12 @@ build:latest-linux-amd64:
- os:linux
script:
- >
cd r-ver && docker build --pull --build-arg NCPUS=$((`nproc`/2+1))
cd base && docker build --pull
--build-arg R_VERSION
--build-arg NCPUS=$((`nproc`/2+1))
-t $CI_APP_REPO:$CI_APP_TAG-linux-amd64
-t $CI_APP_REPO:$VERSION_MAJ_MIN_PAT-linux-amd64
-f $CI_APP_TAG.Dockerfile .
-f latest.Dockerfile .
- |
docker build -t $CI_APP_REPO:$CI_APP_TAG-root-linux-amd64 \
-t $CI_APP_REPO:$VERSION_MAJ_MIN_PAT-root-linux-amd64 -<<EOF
......@@ -59,7 +60,7 @@ build:latest-linux-amd64:
rules:
- if: $CI_COMMIT_BRANCH == "master" && $CI_BUILD_PLATFORMS =~ /(linux\/amd64)/
changes:
- r-ver/latest.Dockerfile
- base/latest.Dockerfile
build:latest-linux-arm64v8:
extends: .build
......@@ -68,10 +69,12 @@ build:latest-linux-arm64v8:
- os:linux
script:
- >
cd r-ver && docker build --pull --build-arg NCPUS=$((`nproc`/2+1))
cd base && docker build --pull
--build-arg R_VERSION
--build-arg NCPUS=$((`nproc`/2+1))
-t $CI_APP_REPO:$CI_APP_TAG-linux-arm64v8
-t $CI_APP_REPO:$VERSION_MAJ_MIN_PAT-linux-arm64v8
-f $CI_APP_TAG.Dockerfile .
-f latest.Dockerfile .
- |
docker build -t $CI_APP_REPO:$CI_APP_TAG-root-linux-arm64v8 \
-t $CI_APP_REPO:$VERSION_MAJ_MIN_PAT-root-linux-arm64v8 -<<EOF
......@@ -82,7 +85,7 @@ build:latest-linux-arm64v8:
rules:
- if: $CI_COMMIT_BRANCH == "master" && $CI_BUILD_PLATFORMS =~ /(linux\/arm64\/v8)/
changes:
- r-ver/latest.Dockerfile
- base/latest.Dockerfile
build:version-linux-amd64:
extends: .build
......@@ -91,21 +94,21 @@ build:version-linux-amd64:
- os:linux
script:
- >
cd r-ver && docker build --pull --build-arg NCPUS=$((`nproc`/2+1))
cd base && docker build --pull
--build-arg R_VERSION
--build-arg NCPUS=$((`nproc`/2+1))
-t $CI_APP_REPO:$CI_APP_TAG-linux-amd64
-f $CI_APP_TAG.Dockerfile .
-f $R_VERSION.Dockerfile .
- |
docker build -t $CI_APP_REPO:$CI_APP_TAG-root-linux-amd64 -<<EOF
FROM $CI_APP_REPO:$CI_APP_TAG-linux-amd64
USER root
EOF
- |
docker push $CI_APP_REPO:$CI_APP_TAG-linux-amd64
docker push $CI_APP_REPO:$CI_APP_TAG-root-linux-amd64
- docker push -a $CI_APP_REPO
rules:
- if: $CI_COMMIT_BRANCH == "freeze-version" && $CI_BUILD_PLATFORMS =~ /(linux\/amd64)/
changes:
- r-ver/4.1.3.Dockerfile
- base/$R_VERSION.Dockerfile
build:version-linux-arm64v8:
extends: .build
......@@ -114,21 +117,21 @@ build:version-linux-arm64v8:
- os:linux
script:
- >
cd r-ver && docker build --pull --build-arg NCPUS=$((`nproc`/2+1))
cd base && docker build --pull
--build-arg R_VERSION
--build-arg NCPUS=$((`nproc`/2+1))
-t $CI_APP_REPO:$CI_APP_TAG-linux-arm64v8
-f $CI_APP_TAG.Dockerfile .
-f $R_VERSION.Dockerfile .
- |
docker build -t $CI_APP_REPO:$CI_APP_TAG-root-linux-arm64v8 -<<EOF
FROM $CI_APP_REPO:$CI_APP_TAG-linux-arm64v8
USER root
EOF
- |
docker push $CI_APP_REPO:$CI_APP_TAG-linux-arm64v8
docker push $CI_APP_REPO:$CI_APP_TAG-root-linux-arm64v8
- docker push -a $CI_APP_REPO
rules:
- if: $CI_COMMIT_BRANCH == "freeze-version" && $CI_BUILD_PLATFORMS =~ /(linux\/arm64\/v8)/
changes:
- r-ver/4.1.3.Dockerfile
- base/$R_VERSION.Dockerfile
build-manifest:latest-linux-multiarch:
extends: .build
......@@ -186,7 +189,7 @@ build-manifest:latest-linux-multiarch:
rules:
- if: $CI_COMMIT_BRANCH == "master"
changes:
- r-ver/latest.Dockerfile
- base/latest.Dockerfile
build-manifest:version-linux-multiarch:
extends: .build
......@@ -211,7 +214,7 @@ build-manifest:version-linux-multiarch:
rules:
- if: $CI_COMMIT_BRANCH == "freeze-version"
changes:
- r-ver/4.1.3.Dockerfile
- base/$R_VERSION.Dockerfile
trigger-latest-build:
extends: .build
......@@ -222,9 +225,9 @@ trigger-latest-build:
script:
- curl -X POST -F token=$JUPYTERLAB_R_TIDYVERSE -F ref=master https://gitlab.b-data.ch/api/v4/projects/167/trigger/pipeline
rules:
- if: $CI_COMMIT_REF_NAME == "master"
- if: $CI_COMMIT_BRANCH == "master"
changes:
- r-ver/latest.Dockerfile
- base/latest.Dockerfile
trigger-version-build:
extends: .build
......@@ -235,6 +238,6 @@ trigger-version-build:
script:
- curl -X POST -F token=$JUPYTERLAB_R_TIDYVERSE -F ref=freeze-version https://gitlab.b-data.ch/api/v4/projects/167/trigger/pipeline
rules:
- if: $CI_COMMIT_REF_NAME == "freeze-version"
- if: $CI_COMMIT_BRANCH == "freeze-version"
changes:
- r-ver/4.1.3.Dockerfile
- base/$R_VERSION.Dockerfile
Supports Markdown
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