A fruitful image that puts together several tools to make Continuous Deliveries and Continuous Deployments on Bitbucket Pipelines easy.
A tiny script that removes scope from your variables. Use this if you have mixed environment variables set in your system. There is no need to do additional variable mapping, which can save your pipeline definition size.
export STAGING_MYSQL_PASSWORD=password123
descope-env staging
echo $MYSQL_PASSWORD
# password123
First argument to this script is the actual environment. It can be omitted and passed as PROJECT_ENVIRONMENT
env variable instead. If none is set, descope-env considers it the staging environment. If the variable BITBUCKET_TAG
contains semver tag, it is considered the production environment.
Given package.json
is present in the working directory, the descope-env
will apply any key/value pairs from the env
section into current environment.
Also a tiny script that initializes Terraform Google Cloud Storage Backend and sets up a service account based on the credentials stored in TF_VAR_GOOGLE_CREDENTIALS
. It takes no arguments. Make sure the TF_VAR_BUCKET_TERRAFORM
contains the terraform state bucket.
definitions:
steps:
- step: &deploy
name: Deploy Infrastructure
image: optimics/terraform:0.4
script:
- . descope-env
- init-gcs
- terraform validate
- terraform apply --input=false --auto-approve
branches:
master:
- step: *deploy
tags:
'v*':
- step: *deploy