Skip to content
Snippets Groups Projects
Commit 02b854a3 authored by Kwangjin Lee's avatar Kwangjin Lee
Browse files

Update .gitlab-ci.yml file

parent cd455877
No related branches found
No related tags found
1 merge request!367test publish build
Pipeline #245589 failed
...@@ -46,6 +46,7 @@ deploy-draft: ...@@ -46,6 +46,7 @@ deploy-draft:
needs: ["build-book"] needs: ["build-book"]
script: script:
- | - |
BUILD_JOB_ID=$(curl -s -H "PRIVATE-TOKEN: $CI_JOB_TOKEN" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/pipelines/${CI_PIPELINE_ID}/jobs?scope[]=success" | jq '.[] | select(.name=="build-book") | .id')
curl -X POST https://mude.citg.tudelft.nl/hooks/book-deploy-draft \ curl -X POST https://mude.citg.tudelft.nl/hooks/book-deploy-draft \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-H "X-Gitlab-Token: glpat-m4CzsDqHnXNn3Pf5Whyd" \ -H "X-Gitlab-Token: glpat-m4CzsDqHnXNn3Pf5Whyd" \
...@@ -55,7 +56,7 @@ deploy-draft: ...@@ -55,7 +56,7 @@ deploy-draft:
"status": "success", "status": "success",
"ref": "main" "ref": "main"
}, },
"build_job_id": "'$CI_JOB_ID'" "build_job_id": "'$BUILD_JOB_ID'"
}' }'
environment: environment:
name: draft name: draft
...@@ -68,6 +69,7 @@ deploy-production: ...@@ -68,6 +69,7 @@ deploy-production:
needs: ["build-book"] needs: ["build-book"]
script: script:
- | - |
BUILD_JOB_ID=$(curl -s -H "PRIVATE-TOKEN: $CI_JOB_TOKEN" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/pipelines/${CI_PIPELINE_ID}/jobs?scope[]=success" | jq '.[] | select(.name=="build-book") | .id')
curl -X POST https://mude.citg.tudelft.nl/hooks/book-deploy-production \ curl -X POST https://mude.citg.tudelft.nl/hooks/book-deploy-production \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-H "X-Gitlab-Token: glpat-m4CzsDqHnXNn3Pf5Whyd" \ -H "X-Gitlab-Token: glpat-m4CzsDqHnXNn3Pf5Whyd" \
...@@ -77,7 +79,7 @@ deploy-production: ...@@ -77,7 +79,7 @@ deploy-production:
"status": "success", "status": "success",
"ref": "publish" "ref": "publish"
}, },
"build_job_id": "'$CI_JOB_ID'" "build_job_id": "'$BUILD_JOB_ID'"
}' }'
environment: environment:
name: production name: production
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment