I tried to get the variables of a triggered pipeline in the Dynamic pipeline, but cannot find a way to do it. How can I get the pipeline variable values from the forge app, the request or event does not contain it.
Also,
'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}'
Is suppose to return the variables of a given pipeline, but I only get
"has_variables": false
and do not return my variables.
const res = await api
.asApp()
.requestBitbucket(route`/2.0/repositories/${workspaceUuid}/${repoSlug}/pipelines/${pipelineId}`, {
headers: {
'Accept': 'application/json'
}
})
This is the pipeline I am triggering, Note that I am using the Custom pipeline
pipelines:
default:
- step:
name: 'Deployment to Staging'
script:
- echo "Your deployment to staging script goes here..."
- step:
name: 'Deployment to Production'
script:
- set -e
- echo "Your deployment to production script goes here..."
custom:
testpipe:
- variables:
- name: Force
default: "no"
allowed-values:
- "no"
- "yes"
- name: env
- step:
script:
- cat test.txt
- echo $Force
Solved! Go to Solution.
Sorry if my question was unclear. Let me rephrase the question.
I want to get the Provided variables in a pipeline.
testpipe:
- variables:
- name: Force
default: "no"
allowed-values:
- "no"
- "yes"
- name: env
For example value I passed for the env variable or the selected value for the Forced variable. These are called pipeline variables right.
My goal is to change the runner tags based on user inputs. Is it possible?
Oh I see! My bad for not fully understanding the request here.
You are right that the variables are currently not available in either the request or the REST APIs.
I went ahead and created this ticket for tracking this suggestion:
https://jira.atlassian.com/browse/BCLOUD-23395
At this stage, there is no alternative that I can suggest @Nuwan Udara
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.