mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-04 20:42:52 +00:00
ci: refine job and stage managment
This commit is contained in:
@@ -89,17 +89,10 @@ ci:
|
|||||||
services:
|
services:
|
||||||
- docker:dind
|
- docker:dind
|
||||||
script:
|
script:
|
||||||
- export CORE_VERSION=$(openstapps-projectmanagement get-used-version @openstapps/core)
|
- echo "YOU SHOULD OVERRIDE THIS SECTION"
|
||||||
- export VERSION=$(echo -n "$CI_BUILD_REF_NAME" | cut -c 2-)
|
- exit 1
|
||||||
- export IMAGETAG_BASE=$CI_REGISTRY_IMAGE
|
|
||||||
- export IMAGETAG_CORE_VERSION=$IMAGETAG_BASE:core-$CORE_VERSION
|
|
||||||
- export IMAGETAG_VERSION=$IMAGETAG_BASE:$VERSION
|
|
||||||
- export IMAGETAG_LATEST=$IMAGETAG_BASE:latest
|
|
||||||
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
|
|
||||||
- docker build -t $IMAGETAG_LATEST -t $IMAGETAG_VERSION -t $IMAGETAG_CORE_VERSION .
|
|
||||||
- docker push $IMAGETAG_BASE
|
|
||||||
only:
|
only:
|
||||||
- /(^v[0-9]+\.[0-9]+\.[0-9]+$|^master$|^develop$)/
|
- master
|
||||||
tags:
|
tags:
|
||||||
- gitlab-org-docker
|
- gitlab-org-docker
|
||||||
|
|
||||||
@@ -130,25 +123,48 @@ ci:
|
|||||||
tags:
|
tags:
|
||||||
- gitlab-org-docker
|
- gitlab-org-docker
|
||||||
|
|
||||||
#.build_template_f-u: &build_template_f-u
|
.publish_version_template: &publish_version_template
|
||||||
# before_script:
|
script:
|
||||||
# - Do what you gotta do
|
- export CORE_VERSION=$(openstapps-projectmanagement get-used-version @openstapps/core)
|
||||||
# tags:
|
- export VERSION=$(echo -n "$CI_BUILD_REF_NAME" | cut -c 2-)
|
||||||
# - gitlab-org-docker
|
- export IMAGETAG_BASE=$CI_REGISTRY_IMAGE
|
||||||
|
- export IMAGETAG_CORE_VERSION=$IMAGETAG_BASE:core-$CORE_VERSION
|
||||||
|
- export IMAGETAG_VERSION=$IMAGETAG_BASE:$VERSION
|
||||||
|
- export IMAGETAG_LATEST=$IMAGETAG_BASE:latest
|
||||||
|
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
|
||||||
|
- docker build -t $IMAGETAG_LATEST -t $IMAGETAG_VERSION -t $IMAGETAG_CORE_VERSION .
|
||||||
|
- docker push $IMAGETAG_BASE
|
||||||
|
|
||||||
|
.publish_branch_template: &publish_branch_template
|
||||||
|
script:
|
||||||
|
- export CORE_VERSION=$(openstapps-projectmanagement get-used-version @openstapps/core)
|
||||||
|
- export IMAGETAG_BASE=$CI_REGISTRY_IMAGE/$CI_BUILD_REF_NAME
|
||||||
|
- export IMAGETAG_CORE_VERSION=$IMAGETAG_BASE:core-$CORE_VERSION
|
||||||
|
- export IMAGETAG_LATEST=$IMAGETAG_BASE:latest
|
||||||
|
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
|
||||||
|
- docker build -t $IMAGETAG_LATEST -t $IMAGETAG_CORE_VERSION .
|
||||||
|
- docker push $IMAGETAG_BASE
|
||||||
|
|
||||||
# Jobs joining anchor templates with automatic publishing behaviour
|
# Jobs joining anchor templates with automatic publishing behaviour
|
||||||
# ! The jobname must end with ":" followed by the name for the registry branch
|
# ! The jobname must end with ":" followed by the name for the registry branch
|
||||||
publish:generic:
|
image:version:
|
||||||
<<: *publish_template_auto
|
<<: *publish_template_auto
|
||||||
|
<<: *publish_version_template
|
||||||
|
only:
|
||||||
|
- /^v[0-9]+\.[0-9]+\.[0-9]+$/
|
||||||
|
|
||||||
#publish:f-u:
|
image:master:
|
||||||
# <<: *publish_template_auto
|
<<: *publish_template_auto
|
||||||
# <<: *build_template_f-u
|
<<: *publish_branch_template
|
||||||
|
only:
|
||||||
|
- master
|
||||||
|
|
||||||
|
image:develop:
|
||||||
|
<<: *publish_template_auto
|
||||||
|
<<: *publish_branch_template
|
||||||
|
only:
|
||||||
|
- develop
|
||||||
|
|
||||||
# Jobs joining anchor templates with manual publishing behaviour
|
# Jobs joining anchor templates with manual publishing behaviour
|
||||||
custom:generic:
|
image:branch:
|
||||||
<<: *publish_template_manual
|
<<: *publish_template_manual
|
||||||
|
|
||||||
#custom:f-u:
|
|
||||||
# <<: *publish_template_manual
|
|
||||||
# <<: *build_template_f-u
|
|
||||||
|
|||||||
Reference in New Issue
Block a user