-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
67 lines (63 loc) · 2.99 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
include:
- project: 'container-library/build-ah-engine'
ref: 1.4.0
file: '/gitlab-ci-template.yml'
stages:
- build
- test
- tag
- deploy
nginx-validation:
stage: test
image: quay.io/sheogorath/build-ah-engine:latest
variables:
LANG: C.UTF-8
before_script:
- dnf install -y curl
script:
- podman run -d -p 80:80 --name testing $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA
- sleep 5
# Validate config
- podman exec testing nginx -c /etc/nginx/nginx.conf -t
# Test default
- "curl -v -H 'Host: example.org' http://localhost/ 2>&1 | grep -q 'https://hedgedoc.org'"
# Test main domain
- "curl -v -H 'Host: codimd.org' http://localhost/ 2>&1 | grep -q 'https://hedgedoc.org'"
- "curl -v -H 'Host: hedgedoc.org' http://localhost/ 2>&1 | grep -q 'https://hedgedoc.org'"
# Test demo
- "curl -v -H 'Host: demo.codimd.org' http://localhost/ 2>&1 | grep -q 'https://demo.hedgedoc.org'"
- "curl -v -H 'Host: demo.hedgedoc.org' http://localhost/ 2>&1 | grep -q 'https://demo.hedgedoc.org'"
# Test social
- "curl -v -H 'Host: social.codimd.org' http://localhost/ 2>&1 | grep -q 'https://fosstodon.org/@HedgeDoc'"
- "curl -v -H 'Host: social.hedgedoc.org' http://localhost/ 2>&1 | grep -q 'https://fosstodon.org/@HedgeDoc'"
# Test community
- "curl -v -H 'Host: community.codimd.org' http://localhost/ 2>&1 | grep -q 'https://community.hedgedoc.org'"
- "curl -v -H 'Host: community.hedgedoc.org' http://localhost/ 2>&1 | grep -q 'https://community.hedgedoc.org'"
# Test translate
- "curl -v -H 'Host: translate.codimd.org' http://localhost/ 2>&1 | grep -q 'https://poeditor.com/join/project/1OpGjF2Jir'"
- "curl -v -H 'Host: translate.hedgedoc.org' http://localhost/ 2>&1 | grep -q 'https://poeditor.com/join/project/1OpGjF2Jir'"
# Test General Chat
- "curl -v -H 'Host: chat.codimd.org' http://localhost/ 2>&1 | grep -q 'https://matrix.to/#/#hedgedoc:matrix.org'"
- "curl -v -H 'Host: chat.hedgedoc.org' http://localhost/ 2>&1 | grep -q 'https://matrix.to/#/#hedgedoc:matrix.org'"
# Test Developer Chat
- "curl -v -H 'Host: chat.codimd.org' http://localhost/development 2>&1 | grep -q 'https://matrix.to/#/#hedgedoc-dev:matrix.org'"
- "curl -v -H 'Host: chat.hedgedoc.org' http://localhost/development 2>&1 | grep -q 'https://matrix.to/#/#hedgedoc-dev:matrix.org'"
# Test Docs
- "curl -v -H 'Host: docs.codimd.org' http://localhost/ 2>&1 | grep -q 'https://github.com/hedgedoc/hedgedoc/tree/HEAD/docs'"
- "curl -v -H 'Host: docs.hedgedoc.org' http://localhost/ 2>&1 | grep -q 'https://github.com/hedgedoc/hedgedoc/tree/HEAD/docs'"
# Cleanup
- podman stop testing
- podman rm testing
container-tagging:
stage: tag
variables:
CI_REGISTRY_IMAGE_VERSION: latest
deploy:
stage: deploy
variables:
PLAYBOOK: static_websites.yml
trigger:
project: shivering-isles/ansible-infrastructure-deploy
strategy: depend
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH