| 1 |
stages: |
| 2 |
- pre-check |
| 3 |
- build |
| 4 |
- test |
| 5 |
- deploy |
| 6 |
|
| 7 |
|
| 8 |
include: |
| 9 |
- component: "gitlab.com/sequoia-pgp/common-ci/sequoia-pipeline@main" |
| 10 |
inputs: |
| 11 |
extra_features: ",subplot" |
| 12 |
|
| 13 |
variables: |
| 14 |
SEQUOIA_CRYPTO_POLICY: "" |
| 15 |
|
| 16 |
|
| 17 |
docker-build-push: |
| 18 |
# Official docker image. |
| 19 |
image: docker:stable |
| 20 |
stage: build |
| 21 |
services: |
| 22 |
- docker:dind |
| 23 |
tags: |
| 24 |
- docker |
| 25 |
- self-hosted |
| 26 |
before_script: |
| 27 |
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY |
| 28 |
script: |
| 29 |
- > |
| 30 |
docker build |
| 31 |
--no-cache |
| 32 |
--file Containerfile |
| 33 |
--target sq |
| 34 |
--tag "$IMAGE":latest |
| 35 |
. |
| 36 |
# smoke test |
| 37 |
- docker run "$IMAGE":latest --help |
| 38 |
- docker push "$IMAGE":latest |
| 39 |
after_script: [] |
| 40 |
only: |
| 41 |
refs: |
| 42 |
- /docker/i # refs containing 'docker' keyword |
| 43 |
- tags |
| 44 |
- web |
| 45 |
- schedules |
| 46 |
variables: |
| 47 |
CI_REGISTRY: "registry.gitlab.com" |
| 48 |
IMAGE: "$CI_REGISTRY/sequoia-pgp/sequoia-sq" |
| 49 |
DOCKER_HOST: tcp://docker:2376 |
| 50 |
|
| 51 |
pages: |
| 52 |
stage: build |
| 53 |
image: jampot.sequoia-pgp.org/sequoia-pgp/build-docker-image/trixie-pandoc:latest |
| 54 |
script: |
| 55 |
- ASSET_OUT_DIR=/tmp/assets cargo doc --no-deps -p sequoia-sq |
| 56 |
- mkdir public |
| 57 |
- mv -v target/doc public/impl |
| 58 |
|
| 59 |
# Man pages. |
| 60 |
- /tmp/assets/man-pages/man2html.sh --generate |
| 61 |
- mkdir public/man |
| 62 |
- mv -v $(for f in $(/tmp/assets/man-pages/man2html.sh --html-files); do echo /tmp/assets/man-pages/$f; done) public/man |
| 63 |
- echo "/sequoia-sq/man /sequoia-sqv/man/$(/tmp/assets/man-pages/man2html.sh --html-root) 302" >> public/_redirects |
| 64 |
|
| 65 |
- mkdir public/subplot |
| 66 |
- pandoc -s -o public/subplot/sq-subplot.html sq-subplot.md |
| 67 |
- pandoc -s -o public/subplot/sq-subplot.pdf sq-subplot.md |
| 68 |
|
| 69 |
- echo "/sequoia-sq/ /sequoia-sq/man/sq.1.html 302" > public/_redirects |
| 70 |
- echo "/sequoia-sq/impl /sequoia-sq/impl/sq/index.html 302" >> public/_redirects |
| 71 |
- echo "/sequoia-sq/subplot /sequoia-sq/subplot/sq-subplot.html 302" >> public/_redirects |
| 72 |
artifacts: |
| 73 |
paths: |
| 74 |
- public |
| 75 |
pages: false |
| 76 |
|
| 77 |
pages-deploy: |
| 78 |
stage: deploy |
| 79 |
image: jampot.sequoia-pgp.org/sequoia-pgp/build-docker-image/trixie-pandoc:latest |
| 80 |
script: echo "publishing" |
| 81 |
artifacts: |
| 82 |
paths: |
| 83 |
- public |
| 84 |
pages: true |
| 85 |
rules: |
| 86 |
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' |