Skip to content
Snippets Groups Projects

add a gitlab-ci runner

Merged Matti Picus requested to merge branch/preview into branch/default
1 unresolved thread
Files
2
.gitlab-ci.yml 0 → 100644
+ 31
0
stages:
- build
- deploy
html-build:
image: registry.heptapod.net/pypy/pypy/ci:v1
stage: build
script:
- make build
#deploy-test:
# image: registry.heptapod.net/octobus/ci-dockerfiles/ci-website
# stage: deploy
# script:
# - make build # use artefact eventually
# - netlify deploy --site=056ee9b4-122d-4b02-bf62-5a2fc9776196 --auth="$NETLIFY_AUTH_TOKEN" --dir="public"
deploy:
# On a merge, regenerate the content and commit it to the repo
image: registry.heptapod.net/pypy/pypy/ci:v1
stage: deploy
only:
- branch/default
script:
- set -ex
- make build
- hg add public
- hg commit public
    • @gracinet: does this look right? Do I need to add an hg push line as well?

      • Yes, but you found out before I came back.

        Did it work right away, then? No need to create a deploy key for that?

      • Right, it needs some kind of key. The CI fails with

        abort: http authorization required for https://foss.heptapod.net/pypy/pypy.org
      • Then you need to

        1. create a (SSH) deploy key with write permission: https://foss.heptapod.net/help/user/project/deploy_keys/index.md
        2. Give it to the pipelines for this project as a 'file' variable
        3. push over SSH using that key (either using hg --ssh 'ssh -i the-key or by preparing a .ssh/config)

        See also https://foss.heptapod.net/help/ci/ssh_keys/README.md

        Optionally, if you don't want a new pipeline to be triggered by that push, you can include [skip ci] in the first line of the commit message.

        (I thought that deploy tokens could have write permissions, but it's apparently only to push to the Docker and Package registries)

      • Not clear. Where does the public key go and where does the private key go?

      • The private key goes to pipeline variables, but forget about it, seems I read the doc too fast.

        Try adding a project access token with write_repository scope instead: https://foss.heptapod.net/pypy/pypy.org/-/settings/access_tokens

        • save the token immediately, it's only displayed once
        • the corresponding user name should be project_80_bot (you'll see it in the members list in case of doubt)
        • define a pipeline variable PYPY_WEBSITE_PUSH_TOKEN with the token (there's an option to avoid disclosing it in logs)
        • push to https://project_80_bo:
          PYPYWEBSITEPUSHTOKEN:{PYPY_WEBSITE_PUSH_TOKEN}:
          @foss.heptapod.net

        Bottom line, write deploy tokens seem to exist after all, I haven't yet, but if it doesn't work, that's a bug I will fix for 0.18.1 and/or 0.19.0 final).

      • Thanks that works. The [skip ci] is important, I went to sleep without adding it and got 250 extra commits.

      • Please register or sign in to reply
Please register or sign in to reply
- hg push
Loading