Hi all..
So basically I have workspace variable called ASYS_DOCKER_HUB_USER, the value is "audser", the project name is "https://bitbucket.org/kurobits/api-audser", now in my pipeline I have the following:
- echo $BITBUCKET_REPO_SLUG
witch I would expect to produce: api-audser
but it produces:
so basically it's replacing part of the slug with the name of a variable that has the same value as part of the actual slug, any ideas as why this could be happening?
TIA
G'day, @fmq
Welcome to the community!
Is the variable a secure variable? If it is, the echo command will not display its value in the logs, as secure variables are not exposed in this manner.
In summary, when you set a variable as secure, any attempt to echo it during the build steps will not reveal its value, ensuring its confidentiality
Regards,
Syahrul
Hey Syahrul
Well there are two variables in play here, on is a standard Bitbucket pipeline variable (BITBUCKET_REPO_SLUG) that represents the Slug of the repository and the one that I’m trying to use (the echo is only for demonstration purposes of what happens) , I would asume it’s not a secure variable, the second variable is a secure variable (ASYS_DOCKER_HUB_USER) that it’s value just so happens to be the same as part of the value for the repo slug, so, when I try to use the repo slug it will print out the NAME of the other variable.
Let’s assume that:
$BITBUCKET_REPO_SLUG=api-audser
$ASYS_DOCKER_HUB_USER=audser
any attempt of using $BITBUCKET_REPO_SLUG in the pipeline will turn out as:
api-$ASYS_DECOKER_HUB_USER (instead of api-audser)
It is a very strange behavior.
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @fmq
Thanks for clarifying.
This behavior is expected. The reason is that the pipeline detects "audser" as a secure variable because you configured "$ASYS_DOCKER_HUB_USER" as such. Therefore, when you echo "$BITBUCKET_REPO_SLUG", it returns "api-$ASYS_DOCKER_HUB_USER" because "audser" is considered a secure variable, and thus, it is masked.
We have a feature request on this that I highly suggest you Vote and Watch them at:
https://jira.atlassian.com/browse/BCLOUD-23354
Regards,
Syahrul
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.