2020-06-30 05:16:57 +02:00
|
|
|
# Pipeline for saiblog
|
|
|
|
# inspired by https://git.shivering-isles.com/shivering-isles/blog/-/blob/deploy/.gitlab-ci.yml
|
|
|
|
|
|
|
|
image: quay.io/sheogorath/build-ah-engine:latest
|
2020-01-08 11:01:52 +01:00
|
|
|
|
|
|
|
variables:
|
|
|
|
GIT_SUBMODULE_STRATEGY: recursive
|
2020-01-08 10:49:54 +01:00
|
|
|
|
|
|
|
stages:
|
|
|
|
- orthography
|
|
|
|
- build
|
|
|
|
- package
|
|
|
|
- test
|
|
|
|
#- deploy
|
|
|
|
|
|
|
|
spellcheck:
|
|
|
|
stage: orthography
|
2020-06-30 05:16:57 +02:00
|
|
|
image: docker.io/library/node:12.18.1
|
2020-01-08 10:49:54 +01:00
|
|
|
before_script:
|
|
|
|
- npm i -g markdown-spellcheck
|
|
|
|
script:
|
|
|
|
- mdspell -r -n -a --en-gb "content/posts/*.md" "content/posts/*.markdown"
|
|
|
|
|
|
|
|
build:
|
2020-06-30 05:16:57 +02:00
|
|
|
image: docker.io/cibuilds/hugo:0.73
|
2020-01-08 10:49:54 +01:00
|
|
|
stage: build
|
|
|
|
variables:
|
|
|
|
HUGO_ENV: production
|
|
|
|
LANG: C.UTF-8
|
|
|
|
before_script:
|
|
|
|
- hugo --minify --enableGitInfo
|
|
|
|
script:
|
|
|
|
- htmlproofer ./public --allow-hash-href --check-html --empty-alt-ignore --disable-external
|
|
|
|
artifacts:
|
|
|
|
untracked: true
|
|
|
|
paths:
|
2020-06-30 05:16:57 +02:00
|
|
|
- public
|
2020-01-08 10:49:54 +01:00
|
|
|
expire_in: 1 week
|
|
|
|
|
2020-06-30 05:16:57 +02:00
|
|
|
package:
|
2020-01-08 10:49:54 +01:00
|
|
|
stage: package
|
2020-06-30 05:16:57 +02:00
|
|
|
image: quay.io/sheogorath/build-ah-engine:latest
|
2020-01-08 10:49:54 +01:00
|
|
|
variables:
|
|
|
|
LANG: C.UTF-8
|
|
|
|
before_script:
|
2020-06-30 05:16:57 +02:00
|
|
|
- podman login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
|
2020-01-08 10:49:54 +01:00
|
|
|
script:
|
2020-06-30 05:16:57 +02:00
|
|
|
- podman build --pull -f _docker/Dockerfile -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" .
|
|
|
|
- podman push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
|
|
|
|
except:
|
2020-01-08 10:49:54 +01:00
|
|
|
- deploy
|
|
|
|
|
2020-06-30 05:16:57 +02:00
|
|
|
package-deploy:
|
2020-01-08 10:49:54 +01:00
|
|
|
stage: package
|
2020-06-30 05:16:57 +02:00
|
|
|
image: quay.io/sheogorath/build-ah-engine:latest
|
2020-01-08 10:49:54 +01:00
|
|
|
variables:
|
|
|
|
LANG: C.UTF-8
|
|
|
|
before_script:
|
2020-06-30 05:16:57 +02:00
|
|
|
- podman login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
|
2020-01-08 10:49:54 +01:00
|
|
|
script:
|
2020-06-30 05:16:57 +02:00
|
|
|
- podman build --pull -f _docker/Dockerfile -t "$CI_REGISTRY_IMAGE" .
|
|
|
|
- podman push "$CI_REGISTRY_IMAGE"
|
|
|
|
only:
|
2020-01-08 10:49:54 +01:00
|
|
|
- deploy
|
|
|
|
|
|
|
|
test:
|
|
|
|
stage: test
|
2020-06-30 05:16:57 +02:00
|
|
|
image: quay.io/sheogorath/build-ah-engine:latest
|
2020-01-08 10:49:54 +01:00
|
|
|
variables:
|
|
|
|
LANG: C.UTF-8
|
|
|
|
before_script:
|
2020-06-30 05:16:57 +02:00
|
|
|
- dnf install curl
|
2020-01-08 10:49:54 +01:00
|
|
|
script:
|
2020-06-30 05:16:57 +02:00
|
|
|
- podman run -d -p 80:80 --name testing $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
|
2020-01-08 10:49:54 +01:00
|
|
|
- sleep 5
|
2020-06-30 05:16:57 +02:00
|
|
|
- podman exec testing nginx -c /etc/nginx/nginx.conf -t
|
|
|
|
- curl http://localhost/status.txt | grep -q 'OK'
|
|
|
|
- podman stop testing
|
|
|
|
- podman rm testing
|
2020-01-08 10:49:54 +01:00
|
|
|
except:
|
|
|
|
- deploy
|
|
|
|
|
|
|
|
test-deploy:
|
|
|
|
stage: test
|
2020-06-30 05:16:57 +02:00
|
|
|
image: quay.io/sheogorath/build-ah-engine:latest
|
2020-01-08 10:49:54 +01:00
|
|
|
variables:
|
|
|
|
LANG: C.UTF-8
|
|
|
|
before_script:
|
2020-06-30 05:16:57 +02:00
|
|
|
- dnf install curl
|
2020-01-08 10:49:54 +01:00
|
|
|
script:
|
2020-06-30 05:16:57 +02:00
|
|
|
- podman run -d -p 80:80 --name testing $CI_REGISTRY_IMAGE:latest
|
2020-01-08 10:49:54 +01:00
|
|
|
- sleep 5
|
2020-06-30 05:16:57 +02:00
|
|
|
- podman exec testing nginx -c /etc/nginx/nginx.conf -t
|
|
|
|
- curl http://localhost/status.txt | grep -q 'OK'
|
|
|
|
- podman stop testing
|
|
|
|
- podman rm testing
|
2020-01-08 10:49:54 +01:00
|
|
|
only:
|
|
|
|
- deploy
|