File tree Expand file tree Collapse file tree 14 files changed +86
-29
lines changed
oci-cascaded-pipelines/same-region
trigger-build-from-deploy
trigger-deploy-from-build
trigger-deploy-from-deploy Expand file tree Collapse file tree 14 files changed +86
-29
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ All about devops pipelines using OCI Devops.
11
11
<details >
12
12
<summary >Cascaded Pipelines - click to expand</summary >
13
13
14
- * [ Cascaded Pipelines] ( ./oci-cascaded-pipelines )
14
+ * [ Cascaded Pipelines - With in the Region ] ( ./oci-cascaded-pipelines/same-region/ )
15
15
16
16
</details >
17
17
Original file line number Diff line number Diff line change
1
+ # OCI DevOps Cascaded Pipelines - Same Region
2
+
3
+ ## Objective
4
+ * Invocation of another build or deploy pipeline after the successful execution of build/deploy pipeline.
5
+
6
+ ## Prerequisites & References
7
+ This guide assumes that you already have required pipelines created to invoke them cascadly. You may refer to below links to create and setup pipelines.
8
+ * Reference Architecture - https://github.com/oracle-quickstart/oci-arch-ci-cd-devops
9
+ * Oracle DevOps Documentation - https://docs.oracle.com/en-us/iaas/Content/devops/using/home.htm
10
+ * IAM Policies - https://docs.oracle.com/en-us/iaas/Content/devops/using/devops_iampolicies.htm
11
+
12
+ ## Samples
13
+
14
+ Sample procedure and code snippets for the cascaded pipelines of the below scenarios.
15
+
16
+ * [ Trigger Build Pipeline from Build Pipeline] ( trigger-build-from-build )
17
+ * [ Trigger Deploy Pipeline from Build Pipeline] ( trigger-deploy-from-build )
18
+ * [ Trigger Build Pipeline from Deploy Pipeline] ( trigger-build-from-deploy )
19
+ * [ Trigger Deploy Pipeline from Deploy Pipeline] ( trigger-deploy-from-deploy )
20
+
21
+
Original file line number Diff line number Diff line change 9
9
** Step 1:**
10
10
Clone the repository code.
11
11
```
12
- $ git clone https://github.com/oracle-cloud-infra/oci-devops-cascaded-pipelines.git
12
+ $ git init oci-devops-coderepo-with-gitlab
13
+ $ cd oci-devops-coderepo-with-gitlab
14
+ $ git remote add origin https://github.com/oracle-devrel/oci-devops-examples
15
+ $ git config core.sparsecheckout true
16
+ $ echo "oci-pipeline-examples/oci-cascaded-pipelines/same-region/trigger-build-from-build/*">>.git/info/sparse-checkout
17
+ $ git pull --depth=1 origin main
13
18
```
14
19
15
20
** Step 2:**
16
21
Change to function directory.
17
22
```
18
- $ cd oci-devops-cascaded-pipelines/same-region/trigger-build-from-build/ node-function
23
+ $ cd node-function
19
24
```
20
25
21
26
** Step 3:**
22
- In ` func.js ` , update ` buildPipelineId ` and ` displayNamePrefixForNewRun ` with appropriate values as below.
27
+ In ` func.yaml ` , update ` build_pipeline_id ` and ` display_name_prefix_for_new_run ` with appropriate values as below.
23
28
24
29
```
25
- const buildPipelineId = "<target-build-pipeline-ocid>"
26
- const displayNamePrefixForNewRun = "AutoTriggeredCascadedPipeline_";
30
+ config:
31
+ build_pipeline_id: "<BUILD-PIPELINE-OCID>"
32
+ display_name_prefix_for_new_run: "AutoTriggeredCascade2_"
27
33
```
28
34
29
35
** Step 4:**
Original file line number Diff line number Diff line change @@ -2,8 +2,8 @@ const fdk = require('@fnproject/fdk');
2
2
const common = require ( "oci-common" ) ;
3
3
const devops = require ( "oci-devops" ) ;
4
4
5
- const buildPipelineId = "ocid1.devopsbuildpipeline.oc1.ap-hyderabad-1.amaaaaaak56z2vqazjgskjqjjdjqowrdn3d6eatvhsixvhzb2ozoje2qxh7q"
6
- const displayNamePrefixForNewRun = "AutoTriggeredCascade2_" ;
5
+ const buildPipelineId = process . env . build_pipeline_id ;
6
+ const displayNamePrefixForNewRun = process . env . display_name_prefix_for_new_run ;
7
7
8
8
fdk . handle ( async function ( input ) {
9
9
const provider = common . ResourcePrincipalAuthenticationDetailsProvider . builder ( ) ;
Original file line number Diff line number Diff line change @@ -5,3 +5,6 @@ runtime: node
5
5
build_image : fnproject/node:14-dev
6
6
run_image : fnproject/node:14
7
7
entrypoint : node func.js
8
+ config :
9
+ build_pipeline_id : " <BUILD-PIPELINE-OCID>"
10
+ display_name_prefix_for_new_run : " AutoTriggeredCascade2_"
Original file line number Diff line number Diff line change 10
10
** Step 1:**
11
11
Clone the repository code.
12
12
```
13
- $ git clone https://github.com/oracle-cloud-infra/oci-devops-cascaded-pipelines.git
13
+ $ git init oci-devops-coderepo-with-gitlab
14
+ $ cd oci-devops-coderepo-with-gitlab
15
+ $ git remote add origin https://github.com/oracle-devrel/oci-devops-examples
16
+ $ git config core.sparsecheckout true
17
+ $ echo "oci-pipeline-examples/oci-cascaded-pipelines/same-region/trigger-build-from-deploy/*">>.git/info/sparse-checkout
18
+ $ git pull --depth=1 origin main
14
19
```
15
20
16
21
** Step 2:**
17
22
Change to function directory.
18
23
```
19
- $ cd oci-devops-cascaded-pipelines/same-region/trigger-build-from-deploy/ node-function
24
+ $ cd node-function
20
25
```
21
26
22
27
** Step 3:**
23
- In ` func.js ` , update ` buildPipelineId ` and ` displayNamePrefixForNewRun ` with appropriate values as below.
28
+ In ` func.yaml ` , update ` build_pipeline_id ` and ` display_name_prefix_for_new_run ` with appropriate values as below.
24
29
25
30
```
26
- const buildPipelineId = "<target-build-pipeline-ocid>"
27
- const displayNamePrefixForNewRun = "AutoTriggeredCascadedPipeline_";
31
+ config:
32
+ build_pipeline_id: "<BUILD-PIPELINE-OCID>"
33
+ display_name_prefix_for_new_run: "AutoTriggeredCascadedPipeline_"
28
34
```
29
35
30
36
** Step 4:**
Original file line number Diff line number Diff line change @@ -2,8 +2,8 @@ const fdk = require('@fnproject/fdk');
2
2
const common = require ( "oci-common" ) ;
3
3
const devops = require ( "oci-devops" ) ;
4
4
5
- const buildPipelineId = "<target-build-pipeline-ocid>"
6
- const displayNamePrefixForNewRun = "AutoTriggeredCascadedPipeline_" ;
5
+ const buildPipelineId = process . env . build_pipeline_id ;
6
+ const displayNamePrefixForNewRun = process . env . display_name_prefix_for_new_run ;
7
7
8
8
fdk . handle ( async function ( input ) {
9
9
const provider = common . ResourcePrincipalAuthenticationDetailsProvider . builder ( ) ;
Original file line number Diff line number Diff line change @@ -5,3 +5,6 @@ runtime: node
5
5
build_image : fnproject/node:14-dev
6
6
run_image : fnproject/node:14
7
7
entrypoint : node func.js
8
+ config :
9
+ build_pipeline_id : " <BUILD-PIPELINE-OCID>"
10
+ display_name_prefix_for_new_run : " AutoTriggeredCascadedPipeline_"
Original file line number Diff line number Diff line change 9
9
** Step 1:**
10
10
Clone the repository code.
11
11
```
12
- $ git clone https://github.com/oracle-cloud-infra/oci-devops-cascaded-pipelines.git
12
+ $ git init oci-devops-coderepo-with-gitlab
13
+ $ cd oci-devops-coderepo-with-gitlab
14
+ $ git remote add origin https://github.com/oracle-devrel/oci-devops-examples
15
+ $ git config core.sparsecheckout true
16
+ $ echo "oci-pipeline-examples/oci-cascaded-pipelines/same-region/trigger-deploy-from-build/*">>.git/info/sparse-checkout
17
+ $ git pull --depth=1 origin main
13
18
```
14
19
15
20
** Step 2:**
16
21
Change to function directory.
17
22
```
18
- $ cd oci-devops-cascaded-pipelines/same-region/trigger-deploy-from-build/ node-function
23
+ $ cd node-function
19
24
```
20
25
21
26
** Step 3:**
22
- In ` func.js ` , update ` deployPipelineId ` and ` displayNamePrefixForNewRun ` with appropriate values as below.
27
+ In ` func.yaml ` , update ` deploy_pipeline_id ` and ` display_name_prefix_for_new_run ` with appropriate values as below.
23
28
24
29
```
25
- const deployPipelineId = "<target-deploy-pipeline-ocid>"
26
- const displayNamePrefixForNewRun = "AutoTriggeredCascadedPipeline_";
30
+ config:
31
+ deploy_pipeline_id: "<DEPLOY-PIPELINE-OCID>"
32
+ display_name_prefix_for_new_run: "AutoTriggeredCascade2_"
27
33
```
28
34
29
35
** Step 4:**
Original file line number Diff line number Diff line change @@ -2,8 +2,8 @@ const fdk = require('@fnproject/fdk');
2
2
const common = require ( "oci-common" ) ;
3
3
const devops = require ( "oci-devops" ) ;
4
4
5
- const deployPipelineId = "ocid1.devopsdeploypipeline.oc1.ap-hyderabad-1.amaaaaaak56z2vqavh6diwgyr4cbhqxrfmqqc6riohwyo7rvcje4vmfq5fbq" ;
6
- const displayNamePrefixForNewRun = "AutoTriggeredCascade2_" ;
5
+ const deployPipelineId = process . env . deploy_pipeline_id ;
6
+ const displayNamePrefixForNewRun = process . env . display_name_prefix_for_new_run ;
7
7
8
8
fdk . handle ( async function ( input ) {
9
9
const provider = common . ResourcePrincipalAuthenticationDetailsProvider . builder ( ) ;
You can’t perform that action at this time.
0 commit comments