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:
|
|
|
|
- build
|
|
|
|
- package
|
|
|
|
- test
|
2021-01-02 21:34:32 +01:00
|
|
|
- deploy
|
2020-01-08 10:49:54 +01:00
|
|
|
|
|
|
|
build:
|
2023-09-02 23:57:48 +02:00
|
|
|
image: docker.io/library/node:20.5
|
2020-01-08 10:49:54 +01:00
|
|
|
stage: build
|
2023-09-03 00:02:57 +02:00
|
|
|
interruptible: true
|
2020-01-08 10:49:54 +01:00
|
|
|
before_script:
|
2023-09-02 23:58:31 +02:00
|
|
|
- npm install -g pnpm
|
2022-10-23 12:08:29 +02:00
|
|
|
- pnpm config set store-dir .pnpm-store
|
2020-01-08 10:49:54 +01:00
|
|
|
script:
|
2022-10-23 12:08:29 +02:00
|
|
|
- pnpm install # install dependencies
|
|
|
|
- pnpm run build
|
|
|
|
cache:
|
|
|
|
key:
|
|
|
|
files:
|
|
|
|
- pnpm-lock.yaml
|
|
|
|
paths:
|
|
|
|
- .pnpm-store
|
2023-09-03 00:21:55 +02:00
|
|
|
artifacts:
|
|
|
|
untracked: true
|
|
|
|
exclude: !dist/**
|
|
|
|
paths:
|
|
|
|
- dist
|
|
|
|
expire_in: 1 week
|
2020-01-08 10:49:54 +01:00
|
|
|
|
2020-06-30 05:16:57 +02:00
|
|
|
package:
|
2020-01-08 10:49:54 +01:00
|
|
|
stage: package
|
2023-09-03 00:02:57 +02:00
|
|
|
interruptible: true
|
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
|
2021-09-14 05:09:49 +00:00
|
|
|
tags:
|
2023-10-14 01:10:19 +02:00
|
|
|
- privileged-ram-4gb
|
2020-01-08 10:49:54 +01:00
|
|
|
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:
|
2023-10-14 01:10:19 +02:00
|
|
|
- podman build --pull -f .docker/Dockerfile -t "$CI_REGISTRY_IMAGE" -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" .
|
2020-06-30 05:16:57 +02:00
|
|
|
- podman push "$CI_REGISTRY_IMAGE"
|
2023-10-14 01:10:19 +02:00
|
|
|
- podman push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
|
2020-01-08 10:49:54 +01:00
|
|
|
|
|
|
|
test:
|
|
|
|
stage: test
|
2023-09-03 00:02:57 +02:00
|
|
|
interruptible: true
|
2020-08-13 05:52:29 +02:00
|
|
|
tags:
|
2021-09-14 05:09:49 +00:00
|
|
|
- privileged
|
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-08-06 01:14:18 +00:00
|
|
|
- podman run -d -p 8080: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
|
2020-08-06 01:14:18 +00:00
|
|
|
- curl http://localhost:8080/status.txt | grep -q 'OK'
|
2020-06-30 05:16:57 +02:00
|
|
|
- podman stop testing
|
|
|
|
- podman rm testing
|
2021-01-02 21:34:32 +01:00
|
|
|
|
|
|
|
deploy:
|
|
|
|
stage: deploy
|
|
|
|
variables:
|
|
|
|
PLAYBOOK: static_websites.yml
|
|
|
|
trigger:
|
|
|
|
project: saibotk.de/infrastructure-private
|
|
|
|
strategy: depend
|