Update CI script for release-branch workflow

This commit is contained in:
Romain Thouvenin 2024-04-02 11:17:27 +02:00
parent 4581af5e9f
commit 08b5af7511
2 changed files with 13 additions and 6 deletions

View File

@ -40,19 +40,26 @@ build:
DOCKER_TLS_CERTDIR: ''
services:
- docker:dind
rules:
- if: $CI_COMMIT_TAG
variables:
VERSION: $CI_COMMIT_TAG
- if: $CI_COMMIT_BRANCH =~ /^release/ || $CI_PIPELINE_SOURCE == "web"
variables:
VERSION: $CI_COMMIT_BRANCH
before_script:
- echo -n $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY
script:
- export VERSION=$(docker run --rm -v "$PWD":/usr/src/app:ro -w /usr/src/app node:slim node -p "require('./package.json').version")
- docker pull $CI_REGISTRY_IMAGE:latest || true
- >
docker build
--pull
--cache-from $CI_REGISTRY_IMAGE:latest
--tag $CI_REGISTRY_IMAGE:$VERSION
--tag $CI_REGISTRY_IMAGE:latest
.
- docker push $CI_REGISTRY_IMAGE:$VERSION
- docker push $CI_REGISTRY_IMAGE:latest
only:
- main
- >
if [ $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH ]; then
docker tag $CI_REGISTRY_IMAGE:$VERSION $CI_REGISTRY_IMAGE:latest
docker push $CI_REGISTRY_IMAGE:latest
fi

View File

@ -1,6 +1,6 @@
{
"name": "@mobicoop/matcher",
"version": "1.5.5",
"version": "1.6.0",
"description": "Mobicoop V3 Matcher",
"author": "sbriat",
"private": true,