This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
gitlab_satis [2018/08/18 23:23] – admin | gitlab_satis [2018/11/14 13:59] – [Optional] admin | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Using Gitlab and Satis to generate private composer Repository ====== | ====== Using Gitlab and Satis to generate private composer Repository ====== | ||
- | This is mainly a wrapper for [[https:// | + | [[https:// |
**Idea** | **Idea** | ||
Line 9: | Line 9: | ||
* < | * < | ||
* < | * < | ||
+ | * FIXME Run pipeline only if it is not already running, pile up all requests and run it only once. | ||
**Features** | **Features** | ||
Line 31: | Line 32: | ||
image: ochorocho/ | image: ochorocho/ | ||
script: | script: | ||
- | - mkdir public | + | - mkdir satis-build |
- gitlab-pages-satis | - gitlab-pages-satis | ||
+ | - mv satis-build public | ||
artifacts: | artifacts: | ||
paths: | paths: | ||
Line 42: | Line 44: | ||
===== Configuration ===== | ===== Configuration ===== | ||
+ | Go to User Settings -> Access Tokens, give it a name and allow api scope. Hit " | ||
==== Using Environment variable ==== | ==== Using Environment variable ==== | ||
Line 48: | Line 51: | ||
{{:: | {{:: | ||
- | ==== Using Config File ==== | + | === Using Config File === |
Add a config file to your repository. By default the script is looking for '' | Add a config file to your repository. By default the script is looking for '' | ||
Line 60: | Line 63: | ||
homepage: " | homepage: " | ||
output: " | output: " | ||
- | | + | |
template: '/ | template: '/ | ||
archive: true | archive: true | ||
Line 68: | Line 71: | ||
username: " | username: " | ||
password: " | password: " | ||
+ | build-dir: " | ||
</ | </ | ||
Line 75: | Line 79: | ||
==== Optional ==== | ==== Optional ==== | ||
+ | |||
+ | === Satis example template === | ||
+ | |||
+ | Use this template and set configuration (options -> template) if you want to modify ... | ||
+ | |||
+ | * the Twig template | ||
+ | * to use http instead of https | ||
+ | * and all other options that are not covered by [[https:// | ||
+ | |||
+ | <code javascript satis-template.json> | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | === Trigger on tag_push === | ||
Want to trigger your satis projects pipeline each time a Tag is created/ | Want to trigger your satis projects pipeline each time a Tag is created/ | ||
Line 90: | Line 118: | ||
payload = JSON.parse(STDIN.read) | payload = JSON.parse(STDIN.read) | ||
+ | |||
# Only run this code in case we are dealing with tag_push event | # Only run this code in case we are dealing with tag_push event | ||
Line 97: | Line 126: | ||
shaFile = "# | shaFile = "# | ||
- | # Get hash values | + | # Get refs to compare |
- | payloadHash | + | payloadCurrent |
- | payloadHashBefore | + | payloadBefore |
- | # Save before and after hash to compare | + | # Save refs to compare |
File.delete(shaFile) if File.exist? | File.delete(shaFile) if File.exist? | ||
- | File.write(shaFile, | + | File.write(shaFile, |
# Trigger Pipeline | # Trigger Pipeline | ||
- | | + | |
- | | + | |
end | end | ||
+ | |||
end | end | ||
</ | </ |