'Bitbucket pipeline - assign custom variables
I would like to assign custom variables using bash commands
image: alpine
pipelines:
default:
- step:
name: docker-login
services:
- docker
script:
- docker login --username $DOCKER_USERNAME --password $DOCKER_PASSWORD
- echo "logged in to docker hub"
- echo $VERSION
variables:
VERSION: cat ./version.txt
- step:
name: build-image
services:
- docker
script:
- echo "running docker image test"
- step:
name: 'set ssh env'
script:
- pipe: atlassian/ssh-run:0.4.0
variables:
SSH_USER: $SSH_USER
SERVER: '$HOST'
COMMAND: 'pwd'
I am not getting the output of the file.. what is the correct syntax?
Solution 1:[1]
"Setup environment variables in bitbucket-pipelines.yml" is currently an open suggestion gathering interest on Bitbucket Cloud: BCLOUD-17453
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Blake Gearin |
