Skip to content

Commit

Permalink
Update all variable pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
anveshmuppeda committed Apr 20, 2024
1 parent 0adef9b commit 9c60b0e
Show file tree
Hide file tree
Showing 10 changed files with 132 additions and 0 deletions.
File renamed without changes.
16 changes: 16 additions & 0 deletions pipelines/variables/conditional-variables.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
trigger:
- main

# Define a user-defined variable
variables:
myVariable: true

# Define stages
stages:
- stage: Build
jobs:
- job: BuildJob
displayName: "Build Job"
steps:
- script: echo "This step will only run if myVariable is set to true"
condition: eq(variables['myVariable'], 'true')
11 changes: 11 additions & 0 deletions pipelines/variables/environment-variable.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
trigger:
- main

# Define stages
stages:
- stage: Build
jobs:
- job: BuildJob
displayName: "Build Job"
steps:
- script: echo "The current working directory is ${{ env.BUILD_SOURCESDIRECTORY }}"
23 changes: 23 additions & 0 deletions pipelines/variables/pipeline-level-variable.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Pipeline Variables

trigger: none
# - main

pool: kubernetes-self-hosted-agent

# Define a pipeline-level variable
variables:
pipelineVariable: "Hello from pipeline variable"

# Define stages and jobs
stages:
- stage: Build
jobs:
- job: BuildJob
steps:
- script: echo "$(pipelineVariable)"
- stage: Deploy
jobs:
- job: DeployJob
steps:
- script: echo Deploy Stage $(pipelineVariable)
11 changes: 11 additions & 0 deletions pipelines/variables/pre-defined-variable.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
trigger:
- main

# Define stages
stages:
- stage: Build
jobs:
- job: BuildJob
displayName: "Build Job"
steps:
- script: echo "Building on branch $(Build.SourceBranch)"
15 changes: 15 additions & 0 deletions pipelines/variables/secret-secure-variable.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
trigger:
- main

# Use a secure variable
variables:
secretVariable: $(superSecretVariable)

# Define stages
stages:
- stage: Build
jobs:
- job: BuildJob
displayName: "Build Job"
steps:
- script: echo $(secretVariable)
15 changes: 15 additions & 0 deletions pipelines/variables/user-defined-variables.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
trigger:
- main

# Define a user-defined variable
variables:
customVariable: "Hello from user-defined variable"

# Define stages
stages:
- stage: Build
jobs:
- job: BuildJob
displayName: "Build Job"
steps:
- script: echo $(customVariable)
15 changes: 15 additions & 0 deletions pipelines/variables/variable-group.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
trigger:
- main

# Reference a variable group
variables:
- group: myVariableGroup

# Define stages
stages:
- stage: Build
jobs:
- job: BuildJob
displayName: "Build Job"
steps:
- script: echo $(groupVariable)
15 changes: 15 additions & 0 deletions pipelines/variables/variable-template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
trigger:
- main

# Reference a variable template
variables:
- template: myVariableTemplate.yml

# Define stages
stages:
- stage: Build
jobs:
- job: BuildJob
displayName: "Build Job"
steps:
- script: echo $(templateVariable)
11 changes: 11 additions & 0 deletions pipelines/variables/variables-pipeline.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Define a pipeline-level variable
variables:
pipelineVariable: "Hello from pipeline variable"

# Define stages and jobs
stages:
- stage: Build
jobs:
- job: BuildJob
steps:
- script: echo $(pipelineVariable)

0 comments on commit 9c60b0e

Please sign in to comment.