Loading .gitlab-ci.yml +31 −2 Original line number Diff line number Diff line stages: - static_tests - build - production - deployment ci_linter: image: golang:1.15.2-alpine3.12 Loading Loading @@ -30,7 +30,7 @@ documentation: - public/ pages: stage: production stage: deployment script: - echo 'Deploying on Gitlab pages' needs: Loading @@ -41,3 +41,32 @@ pages: - public rules: - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' # See https://docs.gitlab.com/ee/api/releases/ # We can only control the link to the hub, the release is still storing the source code release: image: curlimages/curl:7.72.0 stage: deployment script: > for JOB in jobs/*; do JOB=$(basename ${JOB}) for VERSION in jobs/${JOB}/versions/*; do VERSION=$(basename ${VERSION} .md) curl --header 'Content-Type: application/json' --header "JOB-TOKEN: ${CI_JOB_TOKEN}" \ --data "{ \ \"name\": \"${JOB}-${VERSION}\", \ \"tag_name\": \"${JOB}-${VERSION}\", \ \"description\": \"$(cat jobs/${JOB}/versions/${VERSION}.md)\", \ \"assets\": { \ \"links\": [ \ { \"name\": \"Hub link\", \ \"url\": \"https://jobs.go2scale.io/${VERSION}/${JOB}.yml\" \ } \ ] \ } \ }" \ --request POST https://gitlab.com/api/v4/projects/go2scale%2Fhub/releases done done rules: - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' No newline at end of file Loading
.gitlab-ci.yml +31 −2 Original line number Diff line number Diff line stages: - static_tests - build - production - deployment ci_linter: image: golang:1.15.2-alpine3.12 Loading Loading @@ -30,7 +30,7 @@ documentation: - public/ pages: stage: production stage: deployment script: - echo 'Deploying on Gitlab pages' needs: Loading @@ -41,3 +41,32 @@ pages: - public rules: - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' # See https://docs.gitlab.com/ee/api/releases/ # We can only control the link to the hub, the release is still storing the source code release: image: curlimages/curl:7.72.0 stage: deployment script: > for JOB in jobs/*; do JOB=$(basename ${JOB}) for VERSION in jobs/${JOB}/versions/*; do VERSION=$(basename ${VERSION} .md) curl --header 'Content-Type: application/json' --header "JOB-TOKEN: ${CI_JOB_TOKEN}" \ --data "{ \ \"name\": \"${JOB}-${VERSION}\", \ \"tag_name\": \"${JOB}-${VERSION}\", \ \"description\": \"$(cat jobs/${JOB}/versions/${VERSION}.md)\", \ \"assets\": { \ \"links\": [ \ { \"name\": \"Hub link\", \ \"url\": \"https://jobs.go2scale.io/${VERSION}/${JOB}.yml\" \ } \ ] \ } \ }" \ --request POST https://gitlab.com/api/v4/projects/go2scale%2Fhub/releases done done rules: - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' No newline at end of file