-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
64 lines (47 loc) · 2.18 KB
/
Makefile
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
#!make
include Makefile.env
build: build-date add-files-to-archive docker-lab-html
.PHONY: help build release add-files-to-archive docker-lab-html Makefile releaseclean get-reporeg get-name deploy
add-files-to-archive:
mkdir -p ${DIR_LAB}/_static/lab-files
build-date:
# This ensures there is always a build directory with an asset to upload
mkdir -p build
date > build/build-date
docker-lab-html:
# in case the generation failed, cleanup old generated items
rm -rf ${DIR_LAB}/_static/lab-files*
# combine all the files together in a way where new files we add just automatically get picked up
mkdir -p ${DIR_LAB}/_static/lab-files
cp -R ${DIR_LAB}/instructions/*/code/* ${DIR_LAB}/_static/lab-files/ || true
tar -czf ${DIR_LAB}/_static/lab-files.tar.gz -C ${DIR_LAB}/_static/lab-files/ .
docker build --build-arg VERSION="${version}" \
-t "${CONTAINER_REPOSITORY}:${version}" \
-t "${CONTAINER_REGISTRY}/${CONTAINER_REPOSITORY}:${version}" \
-t "${CONTAINER_REGISTRY}/${CONTAINER_REPOSITORY}:${env}" \
.
# cleanup all the temporary stuff
rm -rf ${DIR_LAB}/_static/lab-files*
docker image prune -f
docker-lab-pdf:
docker build --build-arg VERSION="${version}" -t "${CONTAINER_REPOSITORY}-pdf:${version}" -f Dockerfile-lab-pdf .
docker create --name pdf-temp "${CONTAINER_REPOSITORY}-pdf:${version}" /bin/sh
mkdir -p build
docker cp pdf-temp:/lab.pdf build/${ARTIFACT_NAME}.pdf
docker rm -f pdf-temp
docker-lab-html-reporeg:
@echo "${CONTAINER_REGISTRY}/${CONTAINER_REPOSITORY}"
release:
docker tag ${CONTAINER_REGISTRY}/${CONTAINER_REPOSITORY}:${version} ${CONTAINER_REGISTRY}/${CONTAINER_REPOSITORY}:latest
docker push ${CONTAINER_REGISTRY}/${CONTAINER_REPOSITORY}:${version}
docker push ${CONTAINER_REGISTRY}/${CONTAINER_REPOSITORY}:latest
deploy-lab:
docker pull ${CONTAINER_REGISTRY}/${CONTAINER_REPOSITORY}:${version}
docker tag ${CONTAINER_REGISTRY}/${CONTAINER_REPOSITORY}:${version} ${CONTAINER_REGISTRY}/${CONTAINER_REPOSITORY}:${environment}
docker push ${CONTAINER_REGISTRY}/${CONTAINER_REPOSITORY}:${environment}
deploy-lms:
metadata/lms/deploy.sh deploy-all
get-reporeg:
@echo "${CONTAINER_REGISTRY}/${CONTAINER_REPOSITORY}"
get-name:
@echo "${NAME}"