User Tools

Site Tools


gitlab-ci-release

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
gitlab-ci-release [2020/08/31 00:12] admingitlab-ci-release [2020/08/31 00:22] admin
Line 1: Line 1:
 ====== Gitlab CI create release ====== ====== Gitlab CI create release ======
  
-Example to create a PHP archive (phar) and link the generated artifact to the relase if a `Release Noteis set.+Example to create a PHP archive (phar) and link the generated artifact to the release if a **Release Note** is set.
  
   * ''create_version'' Build and attach files as artifacts.   * ''create_version'' Build and attach files as artifacts.
Line 7: Line 7:
   * ''release'' Attach file to relase if tag is a relase   * ''release'' Attach file to relase if tag is a relase
     * ''export $(xargs <build.env)'' - Exports env vars set in ''build.env'' file     * ''export $(xargs <build.env)'' - Exports env vars set in ''build.env'' file
 +
 +**Required to create a private token and set as environment variable $GITLAB_PRIVATE_TOKEN**
 +
 +Example:
  
 <code yaml .gitlab-ci.yml> <code yaml .gitlab-ci.yml>
Line 40: Line 44:
   dependencies:    dependencies: 
     - create_version     - create_version
 +  when: on_success
   only:   only:
     - tags     - tags
Line 50: Line 55:
       --data url="$CI_SERVER_URL/api/v4/projects/$CI_PROJECT_ID/jobs/$JOB_ARTIFACT_ID/artifacts/$PHAR_FILE_NAME"        --data url="$CI_SERVER_URL/api/v4/projects/$CI_PROJECT_ID/jobs/$JOB_ARTIFACT_ID/artifacts/$PHAR_FILE_NAME" 
       $CI_SERVER_URL/api/v4/projects/$CI_PROJECT_ID/releases/$CI_COMMIT_TAG/assets/links'       $CI_SERVER_URL/api/v4/projects/$CI_PROJECT_ID/releases/$CI_COMMIT_TAG/assets/links'
- 
 </code> </code>
gitlab-ci-release.txt · Last modified: 2020/08/31 00:51 by admin