-
semantic-release-bot authored
# [3.0.0](https://gitlab.com/to-be-continuous/gcloud/compare/2.3.2...3.0.0) (2023-04-05) ### Features * **deploy:** redesign deployment strategy ([d03c9903](https://gitlab.com/to-be-continuous/gcloud/commit/d03c99033812d53a936b52ea9da06c0f7075a5dc)) ### BREAKING CHANGES * **deploy:** $AUTODEPLOY_TO_PROD no longer supported (replaced by $GCP_PROD_DEPLOY_STRATEGY - see doc)
semantic-release-bot authored# [3.0.0](https://gitlab.com/to-be-continuous/gcloud/compare/2.3.2...3.0.0) (2023-04-05) ### Features * **deploy:** redesign deployment strategy ([d03c9903](https://gitlab.com/to-be-continuous/gcloud/commit/d03c99033812d53a936b52ea9da06c0f7075a5dc)) ### BREAKING CHANGES * **deploy:** $AUTODEPLOY_TO_PROD no longer supported (replaced by $GCP_PROD_DEPLOY_STRATEGY - see doc)
gitlab-ci-gcloud.yml 18.55 KiB
# =========================================================================================
# Copyright (C) 2021 Orange & contributors
#
# This program is free software; you can redistribute it and/or modify it under the terms
# of the GNU Lesser General Public License as published by the Free Software Foundation;
# either version 3 of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License along with this
# program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
# Floor, Boston, MA 02110-1301, USA.
# =========================================================================================
# default workflow rules: Merge Request pipelines
workflow:
rules:
# prevent branch pipeline when an MR is open (prefer MR pipeline)
- if: '$CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS'
when: never
- when: always
variables:
# variabilized tracking image
TBC_TRACKING_IMAGE: "$CI_REGISTRY/to-be-continuous/tools/tracking:master"
# Default Docker image (can be overridden)
GCP_CLI_IMAGE: "gcr.io/google.com/cloudsdktool/cloud-sdk:latest"
GCP_SCRIPTS_DIR: "."
GCP_BASE_APP_NAME: "$CI_PROJECT_NAME"
GCP_REVIEW_ENVIRONMENT_SCHEME: "https"
# default: one-click deploy
GCP_PROD_DEPLOY_STRATEGY: manual
# default production ref name (pattern)
PROD_REF: '/^(master|main)$/'
# default integration ref name (pattern)
INTEG_REF: '/^develop$/'
# allowed stages depend on your template type (see: to-be-continuous.gitlab.io/doc/dev-guidelines/#stages)
stages:
- deploy
- production
.gcp-scripts: &gcp-scripts |
# BEGSCRIPT
set -e
function log_info() {
echo -e "[\\e[1;94mINFO\\e[0m] $*"
}
function log_warn() {
echo -e "[\\e[1;93mWARN\\e[0m] $*"
}
function log_error() {
echo -e "[\\e[1;91mERROR\\e[0m] $*"
}
function fail() {
log_error "$*"
exit 1
}
function assert_defined() {