Z
Zerops4mo ago
5omas

Bitbucket

What is your experience with running a Bitbucket repository on Zerops? What is the easiest procedure for bitbucket? Are there any fundamental reasons why the procedure is not similar to that for github or gitlab?
1 Reply
Aleš
Aleš4mo ago
well, it's another integration to maintain.. GitLab is not working properly right now either, they decided to introduce a breaking change which turns lifetime tokens into 15 minute tokens, so a whole new flow has to be written around it if Bitbucket has a concept of runners / actions, the easiest thing to do is to simply create an action that triggers zcli push at the end, e.g. here's how it looks for GitLab (this creates a job on push to branch / new release)
.with_zcli:
before_script:
- curl -L https://zerops.io/zcli/install.sh | sh
- zcli login "$ZEROPS_ACCESS_TOKEN"

.deploy_base:
extends: .with_zcli
stage: deploy
when: manual
script:
- zcli push --serviceId=$DEPLOY_SERVICE_ID --versionName=$CI_COMMIT_TAG
interruptible: true

stages:
- deploy

deploy:dev:
extends: .deploy_base
variables:
DEPLOY_SERVICE_ID: 'XYZ'
only:
- branches

deploy:prod:
extends: .deploy_base
variables:
DEPLOY_SERVICE_ID: 'XYZ'
only:
- tags
when: on_success
.with_zcli:
before_script:
- curl -L https://zerops.io/zcli/install.sh | sh
- zcli login "$ZEROPS_ACCESS_TOKEN"

.deploy_base:
extends: .with_zcli
stage: deploy
when: manual
script:
- zcli push --serviceId=$DEPLOY_SERVICE_ID --versionName=$CI_COMMIT_TAG
interruptible: true

stages:
- deploy

deploy:dev:
extends: .deploy_base
variables:
DEPLOY_SERVICE_ID: 'XYZ'
only:
- branches

deploy:prod:
extends: .deploy_base
variables:
DEPLOY_SERVICE_ID: 'XYZ'
only:
- tags
when: on_success
down the road we might add more native integrations, but currently 99% of our users either use GitHub or have something custom that utilizes zcli

Did you find this page helpful?