Skip to content

Commit eca64f6

Browse files
committed
dockerized makfiles targets and checks for complete-demo.yaml content
1 parent 2d16205 commit eca64f6

File tree

4 files changed

+65
-2
lines changed

4 files changed

+65
-2
lines changed

.github/workflows/main.yaml

+35
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,37 @@ on:
1313
- "*" # run for tags
1414

1515
jobs:
16+
#
17+
#
18+
#check complete demo is in sync with individual manifest, it should block fom merge. Should this be a diferent file?
19+
complete-demo-check:
20+
runs-on: ubuntu-latest
21+
env:
22+
COMPLETE_DEMO_ARGS: --rm -v ${{ github.workspace }}:/workdir
23+
COMPLETE_DEMO_DIR: 'deploy/kubernetes/'
24+
COMPLETE_DEMO_IMAGE: 'manifests-image'
25+
steps:
26+
- uses: actions/checkout@v2
27+
28+
#
29+
#
30+
# Build image
31+
- name: Build image
32+
env:
33+
DOCKER_BUILDKIT: 1
34+
run: docker build -t $COMPLETE_DEMO_IMAGE $COMPLETE_DEMO_DIR
35+
36+
#
37+
#
38+
# Check that manifest and complete-demo.yaml ahve the same content
39+
- name: check comeplte-demo content
40+
run: docker run $COMPLETE_DEMO_ARGS $COMPLETE_DEMO_IMAGE make -C $COMPLETE_DEMO_DIR check-complete-demo
41+
42+
#
43+
#
44+
#check that we can deploy complete-demo
45+
#NOTE: what about docker compose? maybe doesn't make sense if we use the KIND action
46+
#NOTE: later we can test that the documentation is tested, as in previous cronjobs in travis
1647
deployments-tests:
1748
runs-on: ubuntu-latest
1849
env:
@@ -37,7 +68,11 @@ jobs:
3768
until [ "$(kubectl get pods -n sock-shop --no-headers | grep -cEv '([0-9]+)/\1')" -eq 0 ]; do
3869
sleep 5s
3970
done
71+
kubectl get pod -A
4072
73+
#
74+
#
75+
#build openapi and healtcheck images
4176
build-test-images:
4277
if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master'
4378
runs-on: ubuntu-latest

Makefile

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.PHONY: gen-complete-demo
2+
gen-complete-demo:
3+
make -C deploy/kubernetes docker-gen-complete-demo
4+
5+
.PHONY: check-generated-files
6+
check-generated-files:
7+
make -C deploy/kubernetes docker-check-complete-demo

deploy/kubernetes/Dockerfile

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM alpine:3.12.0 AS runtime
2+
3+
RUN apk add bash make
4+
5+
WORKDIR /workdir

deploy/kubernetes/Makefile

+18-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,25 @@
1+
PWD = $(shell pwd)
12
MANIFESTS = $(or $(shell printenv MANIFESTS), manifests)
23

34
.PHONY: gen-complete-demo
45
gen-complete-demo:
56
cat ${MANIFESTS}/* > complete-demo.yaml
67

7-
.PHONY: val-complete-demo
8-
val-complete-demo:
8+
.PHONY: check-complete-demo
9+
check-complete-demo:
910
cat ${MANIFESTS}/* | diff complete-demo.yaml -
11+
12+
.dockerimage: Dockerfile
13+
docker build -t manifests-image .
14+
touch .dockerimage
15+
16+
.PHONY: docker-%
17+
docker-%: .dockerimage
18+
docker \
19+
run \
20+
--rm \
21+
-it \
22+
-u ${UID}:${GID} \
23+
-v ${PWD}:/workdir \
24+
manifests-image \
25+
make $*

0 commit comments

Comments
 (0)