Update .gitlab-ci.yml file
This commit is contained in:
parent
0240eb2562
commit
5ba46cb3b3
1 changed files with 32 additions and 15 deletions
|
|
@ -20,6 +20,7 @@
|
||||||
stages:
|
stages:
|
||||||
- lint # List of stages for jobs, and their order of execution
|
- lint # List of stages for jobs, and their order of execution
|
||||||
- build
|
- build
|
||||||
|
- deploy
|
||||||
- release
|
- release
|
||||||
|
|
||||||
lint_job:
|
lint_job:
|
||||||
|
|
@ -65,27 +66,15 @@ build_job:
|
||||||
when: on_success
|
when: on_success
|
||||||
expire_in: 60 days
|
expire_in: 60 days
|
||||||
|
|
||||||
|
deploy_job:
|
||||||
|
stage: deploy
|
||||||
release_job:
|
image: "alpine:latest"
|
||||||
stage: release
|
|
||||||
image: "registry.gitlab.com/gitlab-org/release-cli:latest"
|
|
||||||
needs:
|
needs:
|
||||||
- job: build_job
|
- job: build_job
|
||||||
artifacts: true
|
artifacts: true
|
||||||
rules:
|
rules:
|
||||||
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "push"
|
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "push"
|
||||||
when: on_success
|
when: on_success
|
||||||
release:
|
|
||||||
tag_name: 'v0.$CI_PIPELINE_IID'
|
|
||||||
description: 'v0.$CI_PIPELINE_IID create by pipeline'
|
|
||||||
ref: '$CI_COMMIT_SHA'
|
|
||||||
assets:
|
|
||||||
links:
|
|
||||||
- name: APK
|
|
||||||
url: '${CI_PROJECT_URL}/-/jobs/${BUILD_JOB_ID}/artifacts/file/${RELEASE_APK}'
|
|
||||||
- name: Download APK
|
|
||||||
url: $url
|
|
||||||
script:
|
script:
|
||||||
- apk add curl jq
|
- apk add curl jq
|
||||||
- content=$(curl https://api.dropbox.com/oauth2/token -d grant_type=refresh_token -d refresh_token=$REFRESH_TOKEN -d client_id=$CLIENT_KEY -d client_secret=$CLIENT_SECRET)
|
- content=$(curl https://api.dropbox.com/oauth2/token -d grant_type=refresh_token -d refresh_token=$REFRESH_TOKEN -d client_id=$CLIENT_KEY -d client_secret=$CLIENT_SECRET)
|
||||||
|
|
@ -97,5 +86,33 @@ release_job:
|
||||||
- |
|
- |
|
||||||
content=$(curl -X POST https://api.dropboxapi.com/2/sharing/create_shared_link_with_settings --header "Authorization: Bearer $token" --header "Content-Type: application/json" --data @data.json)
|
content=$(curl -X POST https://api.dropboxapi.com/2/sharing/create_shared_link_with_settings --header "Authorization: Bearer $token" --header "Content-Type: application/json" --data @data.json)
|
||||||
- url=$(echo $content | jq -r ".url")
|
- url=$(echo $content | jq -r ".url")
|
||||||
|
- echo APK_URL=$url >> urlEnv.env
|
||||||
|
artifacts:
|
||||||
|
untracked: false
|
||||||
|
when: on_success
|
||||||
|
expire_in: 30 days
|
||||||
|
reports:
|
||||||
|
dotenv: urlEnv.env
|
||||||
|
|
||||||
|
|
||||||
|
release_job:
|
||||||
|
stage: release
|
||||||
|
image: "registry.gitlab.com/gitlab-org/release-cli:latest"
|
||||||
|
needs:
|
||||||
|
- job: deploy_job
|
||||||
|
artifacts: true
|
||||||
|
rules:
|
||||||
|
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "push"
|
||||||
|
when: on_success
|
||||||
|
release:
|
||||||
|
tag_name: 'v0.$CI_PIPELINE_IID'
|
||||||
|
description: 'v0.$CI_PIPELINE_IID create by pipeline'
|
||||||
|
ref: '$CI_COMMIT_SHA'
|
||||||
|
assets:
|
||||||
|
links:
|
||||||
|
- name: Download APK
|
||||||
|
url: $APK_URL
|
||||||
|
script:
|
||||||
|
- echo deploying
|
||||||
|
|
||||||
|
|
||||||
Reference in a new issue