forked from fabric8-launcher/launcher-documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cico_build_test.sh
executable file
·38 lines (26 loc) · 1018 Bytes
/
cico_build_test.sh
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
#!/usr/bin/env bash
BUILDER_IMAGE="launcher-documentation-builder"
BUILDER_CONT="launcher-documentation-builder-container"
DEPLOY_IMAGE="launcher-documentation-deploy"
TARGET_DIR="html"
# Exit on error
set -e
#[ -f jenkins-env ] && cat jenkins-env | grep -e PASS -e GIT_COMMIT -e DEVSHIFT > inherit-env
#[ -f inherit-env ] && . inherit-env
# We need to disable selinux for now, XXX
/usr/sbin/setenforce 0
# Get all the deps in
yum -y install docker make git
# Get all the deps in
yum -y install docker make git
service docker start
#BUILD
docker build -t ${BUILDER_IMAGE} -f Dockerfile.build .
mkdir ${TARGET_DIR}/
mkdir ${TARGET_DIR}/images
docker run --detach=true --name ${BUILDER_CONT} -t -v $(pwd)/${TARGET_DIR}:/${TARGET_DIR}:Z ${BUILDER_IMAGE} /bin/tail -f /dev/null #FIXME
docker exec ${BUILDER_CONT} sh scripts/build_guides.sh
#Need to do this again to set permission of images and html files
chmod -R 0777 ${TARGET_DIR}/
#BUILD DEPLOY IMAGE
docker build -t ${DEPLOY_IMAGE} -f Dockerfile.deploy .