diff --git a/ci-templates/auto-rules/no-default.yml b/ci-templates/auto-rules/no-default.yml index 8e352a0c79be3a8e18c6ad6125d95f73b843129f..8dbd58fbe5f019291e26fed4d0fde8a02758df06 100644 --- a/ci-templates/auto-rules/no-default.yml +++ b/ci-templates/auto-rules/no-default.yml @@ -2,32 +2,15 @@ include: ci-templates/core.yml workflow: rules: - - if: $CI_COMMIT_BRANCH && $CI_COMMIT_REF_NAME =~ /^kinetic-.*/ + - if: $CI_COMMIT_REF_NAME =~ /^kinetic-.*/ variables: DEFAULT_DISTRO: "kinetic" - - if: $CI_COMMIT_BRANCH && $CI_COMMIT_REF_NAME =~ /^melodic-.*/ + - if: $CI_COMMIT_REF_NAME =~ /^melodic-.*/ variables: DEFAULT_DISTRO: "melodic" - - if: $CI_COMMIT_BRANCH && $CI_COMMIT_REF_NAME =~ /^noetic-.*/ + - if: $CI_COMMIT_REF_NAME =~ /^noetic-.*/ variables: DEFAULT_DISTRO: "noetic" - - if: $CI_COMMIT_TAG && $CI_COMMIT_REF_NAME =~ /^kinetic-.*/ - variables: - DEFAULT_DISTRO: "kinetic" - DEPLOY: "true" - - if: $CI_COMMIT_TAG && $CI_COMMIT_REF_NAME =~ /^melodic-.*/ - variables: - DEFAULT_DISTRO: "melodic" - DEPLOY: "true" - - if: $CI_COMMIT_TAG && $CI_COMMIT_REF_NAME =~ /^noetic-.*/ - variables: - DEFAULT_DISTRO: "noetic" - DEPLOY: "true" - - if: $CI_COMMIT_TAG - variables: - DEPLOY: "true" - - if: $CI_COMMIT_BRANCH - industrial_ci_kinetic: extends: .industrial_ci @@ -53,36 +36,14 @@ industrial_ci_noetic: - if: $DEFAULT_DISTRO == "noetic" - if: $BUILD_NOETIC - -ddeploy_kinetic: - extends: .ddeploy - rules: - - if: $DEPLOY && ($DEFAULT_DISTRO == "kinetic" || $BUILD_KINETIC) - exists: - - ddeploy.yaml - - if: $DEFAULT_DISTRO == "kinetic" || $BUILD_KINETIC - exists: - - ddeploy.yaml - when: manual - -ddeploy_melodic: - extends: .ddeploy - rules: - - if: $DEPLOY && ($DEFAULT_DISTRO == "melodic" || $BUILD_MELODIC) - exists: - - ddeploy.yaml - - if: $DEFAULT_DISTRO == "melodic" || $BUILD_MELODIC - exists: - - ddeploy.yaml - when: manual - -ddeploy_noetic: +ddeploy: extends: .ddeploy rules: - - if: $DEPLOY && ($DEFAULT_DISTRO == "noetic" || $BUILD_NOETIC) + - if: $CI_COMMIT_TAG exists: - ddeploy.yaml - - if: $DEFAULT_DISTRO == "noetic" || $BUILD_NOETIC - exists: + when: always + - exists: - ddeploy.yaml when: manual + allow_failure: true diff --git a/ci-templates/industrial-ci-templates.yml b/ci-templates/industrial-ci-templates.yml index 5140839980228bb535cfc0816f9e9d7592bf345d..27a601a8c60547d1329b9856b7459f8e6c54b066 100644 --- a/ci-templates/industrial-ci-templates.yml +++ b/ci-templates/industrial-ci-templates.yml @@ -41,10 +41,15 @@ # Run ddeploy - ddeploy --yaml ${DDEPLOY_YAML} # Get ID of image created by ddeploy - - DOCKER_ID=`docker images --format='{{.ID}}' | head -1` + - 'DOCKER_ID=$(docker images --format="{{.ID}}" | head -1)' # Tag and push - docker tag ${DOCKER_ID} ${DOCKER_PUSH_REGISTRY}/${DOCKER_PUSH_NAME}:${DOCKER_PUSH_TAG} - docker push ${DOCKER_PUSH_REGISTRY}/${DOCKER_PUSH_NAME}:${DOCKER_PUSH_TAG} # Tag and push latest - docker tag ${DOCKER_ID} ${DOCKER_PUSH_REGISTRY}/${DOCKER_PUSH_NAME}:latest - docker push ${DOCKER_PUSH_REGISTRY}/${DOCKER_PUSH_NAME}:latest + rules: + - if: $CI_COMMIT_TAG + when: always + - when: manual + allow_failure: true