Skip to content

Commit e92f5ab

Browse files
committed
Add build_spec.yaml
1 parent fb50ce4 commit e92f5ab

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

‎build_spec.yaml‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
version: 0.1
2+
component: build
3+
timeoutInSeconds: 3600
4+
shell: bash
5+
failImmediatelyOnError: true
6+
env:
7+
variables:
8+
GENERIC_BUILD_PIPELINE_OCID: "ocid1.devopsbuildpipeline.oc1.iad.amaaaaaa2jd6obqazeiqmcdnextophmsh2n5a5zt5aoty5hrddd5n6b5rmhq"
9+
HELM_CHART_NAME: "share"
10+
GIT_REPO_URL: "https://github.com/CenterForOpenScience/SHARE.git"
11+
steps:
12+
- type: Command
13+
name: "Install jq"
14+
command: |
15+
VERSION=1.8.2
16+
PLATFORM=linux-amd64
17+
wget https://github.com/jqlang/jq/releases/download/jq-${VERSION}/jq-${PLATFORM} -O /usr/local/bin/jq &&\
18+
chmod +x /usr/local/bin/jq
19+
- type: Command
20+
name: "Trigger Generic CICD Pipes"
21+
command: |
22+
GIT_BRANCH="${OCI_PRIMARY_SOURCE_BRANCH_NAME}"
23+
GIT_COMMIT="${OCI_PRIMARY_SOURCE_COMMIT_HASH}"
24+
# Trigger generic pipes with vars/params
25+
build_run_arguments=$(jq -cn \
26+
--arg helm_chart_name "${HELM_CHART_NAME}" \
27+
--arg git_repo_url "${GIT_REPO_URL}" \
28+
--arg git_branch "${GIT_BRANCH}" \
29+
--arg git_commit "${GIT_COMMIT}" \
30+
'{"items": [
31+
{"name": "HELM_CHART_NAME", "value": $helm_chart_name},
32+
{"name": "GIT_REPO_URL", "value": $git_repo_url},
33+
{"name": "GIT_BRANCH", "value": $git_branch},
34+
{"name": "GIT_COMMIT", "value": $git_commit}
35+
]}')
36+
37+
oci devops build-run create \
38+
--build-pipeline-id "${GENERIC_BUILD_PIPELINE_OCID}" \
39+
--display-name "build-${HELM_CHART_NAME}-${GIT_BRANCH}-${GIT_COMMIT}" \
40+
--build-run-arguments "${build_run_arguments}"

0 commit comments

Comments
 (0)