-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.gitlab-ci.yml
73 lines (60 loc) · 1.94 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
68
69
70
71
72
image: debian:10
before_script:
- scripts/install_required_packages.sh
- pip3 install -r requirements.txt
validate_challenges:
stage: test
script:
- ./ctf-tool.py validate challenges/* --verbose
build_basic:
stage: test
script:
- ./ctf-tool.py build --address "ctf.cyberatuc.org" challenges/*
install_cron:
stage: test
script:
- apt install cron -y
- ./ctf-tool.py build --install-cron --address "ctf.cyberatuc.org" challenges/test-challenge-pack/
- ls -lR /home/
# TODO: assert correct permissions and that no extra files are added
install_service:
stage: test
script:
- ./ctf-tool.py build --install-service --address "ctf.cyberatuc.org" challenges/test-challenge-pack/
- ls -lR /home/
# TODO: assert correct permissions and that no extra files are added
build_and_install_docker:
stage: test
image: docker:19.03.1
before_script:
- echo setup override
variables:
DOCKER_TLS_CERTDIR: "/certs"
services:
- docker:19.03.1-dind
script:
- docker build -t ctf-tool .
- docker run -dit -v /var/run/docker.sock:/var/run/docker.sock --name ctf-tool ctf-tool
- docker exec ctf-tool ./ctf-tool.py build --install-docker --address ctf.cyberatuc.org challenges/test-challenge-pack/
- docker ps
# TODO: assert correct permissions and that no extra files are added
publish_container:
only:
refs:
- master
stage: publish
image: docker:19.03.1
before_script:
- echo setup override
variables:
DOCKER_TLS_CERTDIR: "/certs"
services:
- docker:19.03.1-dind
script:
- docker build -t $CI_REGISTRY_IMAGE .
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker push $CI_REGISTRY_IMAGE:latest
# TODO: v2 ansible/remote install package test
stages:
- test
- publish