Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision |
gitlab_satis [2018/08/18 20:55] – admin | gitlab_satis [2018/10/10 15:06] – admin |
---|
====== Using Gitlab and Satis to gernerate private composer Repository ====== | ====== Using Gitlab and Satis to generate private composer Repository ====== |
| |
This is mainly a wrapper for [[https://github.com/mborne/satis-gitlab|mborne/satis-gitlab]] inteded to make it easy to use with minimal and simple configuration. Best used together with Gitlab. I'm using Gitlab Pages behind **Apache**, nginx is the default/recommended way to use Gitlab Pages with. | [[https://github.com/ochorocho/gitlab-pages-satis|This]] is mainly a wrapper for [[https://github.com/mborne/satis-gitlab|mborne/satis-gitlab]] intended to make it easy to use with minimal and simple configuration. Best used together with Gitlab. <del>I'm using Gitlab Pages behind **Apache**,</del> NGINX is the default/recommended way to use Gitlab Pages with. |
| |
**Idea** | **Idea** |
| |
* <del>.satisinclude - file to activate certain projects for satis</del> Works in latest master [[https://github.com/ochorocho/satis-gitlab|ochorocho/satis-gitlab]] | * <del>.satisinclude - file to activate certain projects for satis</del> Works in latest master [[https://github.com/ochorocho/satis-gitlab|ochorocho/satis-gitlab]] -- see [[https://github.com/mborne/satis-gitlab/pull/21|pull request]] |
* <del>Integrate webhook ??? when tag created</del> See section [[gitlab_satis#optional|optional]] | * <del>Integrate webhook ??? when tag created</del> See section [[gitlab_satis#optional|optional]] |
* <del>Download zips in Satis ??? So no key auth is required??!?!?</del> add ''archive: true'' and *.tar-Files for Tags will be saved in ''./dist/'' Folder. Branches still point to Git Repo. | * <del>Download zips in Satis ??? So no key auth is required??!?!?</del> add ''archive: true'' and *.tar-Files for Tags will be saved in ''./dist/'' Folder. Branches still point to Git Repo. |
* Multiple packages, which one is preferred? | * <del>Multiple packages, which one is preferred?</del> Depends on the loading order of your defined repositories in composer.json |
| * FIXME Run pipeline only if it is not already running, pile up all requests and run it only once. |
| |
**Features** | **Features** |
image: ochorocho/gitlab-pages-satis:latest | image: ochorocho/gitlab-pages-satis:latest |
script: | script: |
- mkdir public | - mkdir satis-build |
- gitlab-pages-satis | - gitlab-pages-satis |
| - mv satis-build public |
artifacts: | artifacts: |
paths: | paths: |
===== Configuration ===== | ===== Configuration ===== |
| |
| Go to User Settings -> Access Tokens, give it a name and allow api scope. Hit "Create personal access token" and copy it to your configuration (arguments -> gitlab-token). See below ... |
==== Using Environment variable ==== | ==== Using Environment variable ==== |
| |
{{::gitlab-satis-config.png?1000|Gitlab Satis Configuration}} | {{::gitlab-satis-config.png?1000|Gitlab Satis Configuration}} |
| |
==== Using Config File ==== | === Using Config File === |
| |
Add a config file to your repository. By default the script is looking for ''config.yml'' file. If you want to change that simply call the script this way ''gitlab-pages-satis /path/to/custom_config.yml'' | Add a config file to your repository. By default the script is looking for ''config.yml'' file. If you want to change that simply call the script this way ''gitlab-pages-satis /path/to/custom_config.yml'' |
homepage: "https://satis.example.org" | homepage: "https://satis.example.org" |
output: "satis.json" | output: "satis.json" |
| use-file-to-include: '.satisinclude' |
| template: '/path/to/satis-template.example.json' |
archive: true | archive: true |
basic-auth: | basic-auth: |
username: "admin" | username: "admin" |
password: "password" | password: "password" |
| build-dir: "satis-build" |
</code> | </code> |
| |
| |
==== 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://github.com/mborne/satis-gitlab|mborne/satis-gitlab]] |
| |
| <code javascript satis-template.json> |
| { |
| "name": "SATIS repository", |
| "homepage": "http://localhost/satis/", |
| "require": [], |
| "require-dependencies": true, |
| "require-dev-dependencies": true, |
| "config": { |
| "secure-http": false // Not required for https |
| }, |
| "twig-template": "template/index.html.twig" |
| } |
| </code> |
| |
| === Trigger on tag_push === |
| |
Want to trigger your satis projects pipeline each time a Tag is created/deleted ? | Want to trigger your satis projects pipeline each time a Tag is created/deleted ? |