-
Notifications
You must be signed in to change notification settings - Fork 1.2k
70 lines (58 loc) · 2.16 KB
/
log4shell-goof-server-docker-image.yaml
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
name: log4shell-goof-server Docker image build and test
on:
push:
branches:
- 'main'
paths:
- 'log4shell-goof/log4shell-goof-server/**'
- '.github/workflows/log4shell-goof-server-docker-image.yaml'
pull_request:
branches:
- 'main'
paths:
- 'log4shell-goof/log4shell-goof-server/**'
- '.github/workflows/log4shell-goof-server-docker-image.yaml'
jobs:
build-log4shell-server-image:
runs-on: ubuntu-latest
defaults:
run:
working-directory: log4shell-goof/log4shell-server
steps:
- uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build
uses: docker/build-push-action@v2
with:
load: true
context: log4shell-goof/log4shell-server
push: false
tags: log4shell-server:latest
- name: Run container
run: docker run -d --rm --name log4shell-server log4shell-server:latest && sleep 5
- name: Smoke test LDAP running in container
run: docker logs log4shell-server | grep "LDAP server listening on 0.0.0.0:8000"
- name: Smoke test HTTP running in container
run: docker logs log4shell-server | grep "HTTP server listening on 0.0.0.0:9999"
- name: Cleanup container
run: docker kill log4shell-server
- name: Start minikube
uses: medyagh/setup-minikube@master
with:
cni: calico
- name: Deploy to minikube
run: |
sed -i 's/${DOCKER_ACCOUNT}\///' k8s/deploy.yaml
sed -i 's/imagePullPolicy: Always/imagePullPolicy: Never/' k8s/deploy.yaml
minikube image load log4shell-server:latest
kubectl apply -f k8s/deploy.yaml
- name: Test pods came up cleanly
run: |
kubectl get all --namespace=darkweb && \
kubectl wait --namespace=darkweb --for=condition=ready pod --selector=app=log4shell --timeout=90s
- name: Dump pod description
if: ${{ failure() }}
run: |
kubectl describe pod --namespace=darkweb --selector=app=log4shell
kubectl describe deploy --namespace=darkweb --selector=app=log4shell