-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0adef9b
commit 9c60b0e
Showing
10 changed files
with
132 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |