You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AIO.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,6 +22,7 @@
22
22
- Deploy using helmchart to an OKE on an artifact upload - https://github.com/oracle-devrel/oci-devops-examples/blob/main/oci-deployment-examples/oci_helm_function_deployment
23
23
- Deployment with Github actions - https://github.com/oracle-devrel/oci-devops-examples/blob/main/oci-deployment-examples/oci-devops-githubactions-deploy
24
24
- Devops related policies and groups - https://github.com/oracle-devrel/oci-devops-examples/blob/main/oci-config-examples/oci-devops-policies-groups
25
+
- How to use variables with managed `build stage` (OCI Build pipeline) or using `shell stage` (OCI Deployment pipeline) - https://github.com/oracle-devrel/oci-devops-examples/blob/main/oci-config-examples/oci-devops-variables-shell-buildpiepline
25
26
- Integrate Bitbucket.org repo with OCI Devops . - https://github.com/oracle-devrel/oci-devops-examples/blob/main/oci-coderepo-examples/oci-devops-coderepo-with-bitbucketcloud
26
27
- Integrate GITHUB.com repo with OCI Devops . - https://github.com/oracle-devrel/oci-devops-examples/blob/main/oci-coderepo-examples/oci-devops-coderepo-with-github
27
28
- Integrate GITLAB.com repo with OCI Devops . - https://github.com/oracle-devrel/oci-devops-examples/blob/main/oci-coderepo-examples/oci-devops-coderepo-with-gitlab
@@ -36,3 +37,4 @@
36
37
- Scanning code for vulnerabilities for Maven packages - https://github.com/oracle-devrel/oci-devops-examples/tree/main/oci-build-examples/oci-devops-vulnerability-audit-management
37
38
- Trigger build-pipeline based on GitHub repo file updates. - https://github.com/oracle-devrel/oci-devops-examples/blob/main/oci-coderepo-examples/oci-devops-trigger-from-github-repo
38
39
- Trigger build-pipeline from OCI Code repo on file modifications . - https://github.com/oracle-devrel/oci-devops-examples/blob/main/oci-coderepo-examples/oci-devops-coderepo-filebasedtrigger
Copy file name to clipboardExpand all lines: oci-config-examples/oci-devops-variables-shell-buildpiepline/README.md
+319-5Lines changed: 319 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,72 @@
1
+
### How to use variables with managed `build stage` (OCI Build pipeline) or using `shell stage` (OCI Deployment pipeline)
2
+
3
+
------
4
+
The procedure demonstrates some of the sample usage of variables within the build or shell stage. The format and usage of variables for the shell stage or managed build stage are similar.
5
+
6
+
* Specific instruction to clone only this example.
- Here we are using a URL to download a config file using the option `inputArtifacts`.
64
+
- the files that are downloaded using `inputArtifacts` will be available throughout the stage for all the steps.
65
+
- Execution result.
66
+

67
+
</details>
1
68
<details>
2
-
<summary>
69
+
<summary> Use of env/variables - Click to View details.</summary>
3
70
4
71
```yaml
5
72
version: 0.1
@@ -9,7 +76,7 @@ shell: bash
9
76
failImmediatelyOnError: true
10
77
env:
11
78
variables:
12
-
NAMESPACE: "ns-demo"
79
+
NAMESPACE: "initialNameSpace"
13
80
inputArtifacts:
14
81
- name: sample-kube-yaml
15
82
type: URL
@@ -23,26 +90,273 @@ steps:
23
90
command: |
24
91
echo "Step One.."
25
92
ls -ltr
93
+
echo ${NAMESPACE}
94
+
NAMESPACE="nameSpaceFromStepOne"
95
+
### The value of an env variable is changed here and the updated value will be available for further steps.
26
96
27
97
onFailure:
28
98
- type: Command
29
99
command: |
30
100
echo "Handled Failure for Step One"
31
101
timeoutInSeconds: 40
32
-
102
+
103
+
- type: Command
104
+
timeoutInSeconds: 600
105
+
name: "stepTwo"
106
+
command: |
107
+
echo "Step two"
108
+
ls -ltr
109
+
echo ${NAMESPACE}
110
+
111
+
onFailure:
112
+
- type: Command
113
+
command: |
114
+
echo "Handled Failure for Step One"
115
+
timeoutInSeconds: 40
116
+
```
117
+
- Details of steps.
118
+
- This follows a key-value pair.
119
+
- The key must follow POSIX environment variable compliant.
120
+
- The value can be any string.
121
+
- The scope of this variable is the execution of the build specification file. This means the value is available only within the stage across the steps.
122
+
- If the value of the variable contains a new line(\n) or carriage return(\r) character, then they are replaced with space in the subsequent steps.
123
+
- The change of value with a step is available for further steps as well.
124
+
- Execution result.
125
+

126
+
</details>
127
+
128
+
<details>
129
+
<summary>Use of env/vaultVariables - Click to View details.</summary>
0 commit comments