Skip to content

Commit bffc5cd

Browse files
TupleTypeYaron Avital
andauthored
Added the Gryphon challenge (#43)
Added the Gryphon challenge Optimized the CI Renamed lighttpd to prod and added Dind Co-authored-by: Asaf Greenholts <[email protected]> Co-authored-by: Yaron Avital <[email protected]>
1 parent 7a4f365 commit bffc5cd

File tree

304 files changed

+11958
-154
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

304 files changed

+11958
-154
lines changed

.circleci/config.yml

Lines changed: 8 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -12,30 +12,12 @@ jobs:
1212
resource_class: large
1313
steps:
1414
- checkout
15-
- restore_cache:
16-
keys:
17-
- v1-docker-{{ .Branch }}
18-
- run:
19-
name: Load Docker layers cache
20-
command: |
21-
set +o pipefail
22-
docker load -i ~/docker-layers.tar | true
2315
- run:
2416
name: Docker compose
2517
command: |
2618
python3 rename.py git
2719
cp -R ctfd/data/ tmp-ctfd/
2820
docker-compose -f docker-compose-dev.yaml up -d --build
29-
- run:
30-
name: Save Docker layers cache
31-
command: |
32-
DOCKER_IMAGES=$(docker images --format "{{ .Repository }}" --filter=reference="cidersecurity/goat-*")
33-
DOCKER_LAYERS=$(for image in $DOCKER_IMAGES; do docker history $image -q | grep -v missing; done)
34-
docker save -o ~/docker-layers.tar $DOCKER_LAYERS
35-
- save_cache:
36-
key: v1-docker-{{ .Branch }}-{{ epoch }}
37-
paths:
38-
- ~/docker-layers.tar
3921
- run:
4022
name: Install testing dependencies
4123
command: |
@@ -44,17 +26,7 @@ jobs:
4426
python3 -m pipenv install --deploy
4527
- run:
4628
name: Wait for services to start
47-
command: |
48-
for i in {1..30}
49-
do
50-
jenkins_status_code=$(curl --write-out %{http_code} --silent --output /dev/null localhost:8080/login) || true
51-
gitea_status_code=$(curl --write-out %{http_code} --silent --output /dev/null localhost:3000/) || true
52-
if [ "$jenkins_status_code" -eq 200 ] && [ "$gitea_status_code" -eq 200 ]; then
53-
break
54-
fi
55-
sleep 1
56-
done
57-
sleep 80
29+
command: ./wait.sh
5830
- run:
5931
name: Pytest
6032
command: |
@@ -68,15 +40,6 @@ jobs:
6840
VERSION: << pipeline.parameters.VERSION >>
6941
steps:
7042
- checkout
71-
- restore_cache:
72-
keys:
73-
- v1-docker-{{ .Branch }}
74-
- run:
75-
name: Load Docker layers cache
76-
command: |
77-
echo $DOCKER_USERNAME | base64 | base64
78-
set +o pipefail
79-
docker load -i ~/docker-layers.tar | true
8043
- run:
8144
name: Docker compose
8245
command: |
@@ -92,17 +55,7 @@ jobs:
9255
python3 -m pipenv install --deploy
9356
- run:
9457
name: Wait for services to start
95-
command: |
96-
for i in {1..30}
97-
do
98-
jenkins_status_code=$(curl --write-out %{http_code} --silent --output /dev/null localhost:8080/login) || true
99-
gitea_status_code=$(curl --write-out %{http_code} --silent --output /dev/null localhost:3000/) || true
100-
if [ "$jenkins_status_code" -eq 200 ] && [ "$gitea_status_code" -eq 200 ]; then
101-
break
102-
fi
103-
sleep 1
104-
done
105-
sleep 80
58+
command: ./wait.sh
10659
- run:
10760
name: Pytest
10861
command: |
@@ -121,13 +74,17 @@ jobs:
12174
docker tag $ORG/goat-jenkins-agent:latest $ORG/goat-jenkins-agent:$VERSION
12275
docker tag $ORG/goat-gitea:latest $ORG/goat-gitea:$VERSION
12376
docker tag $ORG/goat-ctfd:latest $ORG/goat-ctfd:$VERSION
124-
docker tag $ORG/goat-lighttpd:latest $ORG/goat-lighttpd:$VERSION
77+
docker tag $ORG/goat-prod:latest $ORG/goat-prod:$VERSION
78+
docker tag $ORG/goat-gitlab:latest $ORG/goat-gitlab:$VERSION
79+
docker tag $ORG/goat-gitlab-runner:latest $ORG/goat-gitlab-runner:$VERSION
12580
12681
docker push $ORG/goat-jenkins-server:$VERSION
12782
docker push $ORG/goat-jenkins-agent:$VERSION
12883
docker push $ORG/goat-gitea:$VERSION
12984
docker push $ORG/goat-ctfd:$VERSION
130-
docker push $ORG/goat-lighttpd:$VERSION
85+
docker push $ORG/goat-prod:$VERSION
86+
docker push $ORG/goat-gitlab:$VERSION
87+
docker push $ORG/goat-gitlab-runner:$VERSION
13188
13289
workflows:
13390
version: 2

.gitignore

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
tmp-ctfd/
22

3+
# macos
4+
**/.DS_Store
5+
.DS_Store
6+
37
# Byte-compiled / optimized / DLL files
48
__pycache__/
59
*.py[cod]
@@ -12,21 +16,21 @@ __pycache__/
1216
.Python
1317
build/
1418
develop-eggs/
15-
dist/
1619
downloads/
1720
eggs/
1821
.eggs/
1922
lib/
2023
lib64/
2124
parts/
2225
sdist/
26+
dist/
2327
var/
2428
wheels/
2529
pip-wheel-metadata/
2630
share/python-wheels/
27-
*.egg-info/
2831
.installed.cfg
2932
*.egg
33+
*.egg-info/
3034
MANIFEST
3135

3236
# PyInstaller
@@ -132,3 +136,6 @@ dmypy.json
132136

133137
.idea/
134138
tests/repositories/
139+
gitlab/terraform.tfstate
140+
141+
!/gitlab/repositories/pygryphon/dist

Pipfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ pytest = "*"
88
requests = "*"
99
jenkinsapi = "*"
1010
gitpython = "*"
11+
build = "*"
12+
twine = "*"
13+
python-gitlab = "*"
1114

1215
[dev-packages]
1316

0 commit comments

Comments
 (0)