Bitbucket Pipe for Golive
217
Send environment status changes and deployments to Apwide Golive Cloud.
send-deployment attaches the Jira issue keys found in the commits deployed since the previous release tag.
- pipe: apwide/golive-bitbucket:1.0.0
variables:
ACTION: "<string>" # set-status | send-deployment
GOLIVE_API_TOKEN: "<string>"
ENVIRONMENT_ID: "<string>"
# STATUS: "<string>" # set-status only
# VERSION: "<string>"
# BUILD_NUMBER: "<string>"
# TAG_PATTERN: "<string>"
# SINCE_REF: "<string>"
# ISSUE_KEYS: "<string>"
# JIRA_PROJECT_KEYS: "<string>"
# FALLBACK_COMMIT_DEPTH: "<int>"
# DEPLOYMENT_ATTRIBUTES: "<json>"
# GOLIVE_BASE_URL: "<string>"
# DRY_RUN: "<boolean>"
# DEBUG: "<boolean>"
| Variable | Usage |
|---|---|
ACTION (*) | set-status or send-deployment. |
GOLIVE_API_TOKEN (*) | Golive Cloud API token. Store it as a secured repository variable. |
ENVIRONMENT_ID (*) | Id of the Golive environment. |
STATUS | Status name to set. Required for set-status. |
VERSION | Version name sent to Golive. Default: $BITBUCKET_TAG itself (e.g. staging-11.18.0) when it matches TAG_PATTERN. |
BUILD_NUMBER | Default: $BITBUCKET_BUILD_NUMBER. |
TAG_PATTERN | Release tag naming, with {version} exactly once, e.g. v{version} or staging-{version}. {version} matches 1, 1.2, 1.2.3 or 1.2.3.4. |
SINCE_REF | Read issue keys from SINCE_REF..HEAD instead of looking up the previous tag. |
ISSUE_KEYS | Comma-separated keys to send as is. Disables git lookup. |
JIRA_PROJECT_KEYS | Comma-separated project keys to keep, e.g. ECOM,PAY. Recommended: removes false positives such as UTF-8. |
FALLBACK_COMMIT_DEPTH | Commits read when no previous tag is found. Default: 50. |
DEPLOYMENT_ATTRIBUTES | JSON object of Golive deployment attributes, e.g. '{"initiator": "Marvin"}'. Keys must exist in Golive. |
GOLIVE_BASE_URL | Must start with https:// and contain no credentials. Default: https://golive.apwide.net/api. |
DRY_RUN | Print the request without sending it. Default: false. |
DEBUG | Verbose logging. Default: false. |
(*) = required variable.
First match wins:
ISSUE_KEYS is set: sent as is.SINCE_REF is set: keys in SINCE_REF..HEAD.TAG_PATTERN is set: keys since the nearest earlier tag matching the pattern that HEAD can reach.
Tags on HEAD itself are ignored, so a v2.1.1 hotfix compares against v2.1.0, not against a v2.2.0 on main.FALLBACK_COMMIT_DEPTH commits, with a warning.Merge commit messages are included.
Tag pipeline: the tag (e.g. staging-11.18.0) is the version sent to Golive, and the change range runs from the
previous staging-* tag.
pipelines:
tags:
'staging-*':
- step:
name: Deploy to staging
deployment: staging
clone:
depth: full
script:
- ./deploy.sh
- pipe: apwide/golive-bitbucket:1.0.0
variables:
ACTION: send-deployment
GOLIVE_API_TOKEN: $GOLIVE_API_TOKEN
ENVIRONMENT_ID: "6"
TAG_PATTERN: "staging-{version}"
JIRA_PROJECT_KEYS: "ECOM,PAY"
Branch pipeline: explicit version, keys since the last v* release.
pipelines:
branches:
main:
- step:
name: Deploy to dev
clone:
depth: full
script:
- ./deploy.sh
- pipe: apwide/golive-bitbucket:1.0.0
variables:
ACTION: send-deployment
GOLIVE_API_TOKEN: $GOLIVE_API_TOKEN
ENVIRONMENT_ID: "4"
VERSION: "1.4.$BITBUCKET_BUILD_NUMBER"
TAG_PATTERN: "v{version}"
JIRA_PROJECT_KEYS: "ECOM"
Environment status from the step result:
- step:
name: Deploy to staging
script:
- ./deploy.sh
after-script:
- if [ "$BITBUCKET_EXIT_CODE" = "0" ]; then export GOLIVE_STATUS=Up; else export GOLIVE_STATUS=Down; fi
- pipe: apwide/golive-bitbucket:1.0.0
variables:
ACTION: set-status
GOLIVE_API_TOKEN: $GOLIVE_API_TOKEN
ENVIRONMENT_ID: "6"
STATUS: $GOLIVE_STATUS
Pin the full version in your pipeline, and upgrade by changing the number:
- pipe: apwide/golive-bitbucket:1.0.0
apwide/golive-bitbucket is the pipe's Bitbucket repository and 1.0.0 is a git tag in it. Pipelines reads pipe.yml
at that tag and runs the Docker image declared in its image: line, which has the same version.
To run an image directly, e.g. to test an unreleased build, use pipe: docker://apwide/golive-bitbucket:<tag>.
Every push to develop and main publishes apwide/golive-bitbucket:develop and apwide/golive-bitbucket:main for that
purpose. These images move with each push: never use them in production pipelines.
Versions follow semantic versioning: a new optional variable is a minor release, a renamed or removed variable is a major release.
clone: depth: full to the step.- git fetch --tags before the pipe.git tag --list. staging-1.0.0-rc1 and
staging-old do not match staging-{version}.ENVIRONMENT_ID.DRY_RUN: "true" to see the exact request.Content type
Image
Digest
sha256:125f9d72b…
Size
82.4 MB
Last updated
2 days ago
docker pull apwide/golive-bitbucket:main