-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathbuild.sh
executable file
·49 lines (38 loc) · 1.14 KB
/
build.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
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
### cd locally
cd $(dirname $0)
### Load config
export OCM_CONTAINER_CONFIG="${HOME}/.config/ocm-container/env.source"
export CONTAINER_SUBSYS="sudo docker"
if [ ! -f ${OCM_CONTAINER_CONFIG} ]; then
echo "Cannot find config file, exiting";
exit 1;
fi
source ${OCM_CONTAINER_CONFIG}
### Select osv4client version, auto-detect from mirror.openshift.com
if [ "x${osv4client}" == "x" ]; then
# auto-detect latest openshift-client-linux-4.x.y.tar.gz
osv4clienturl="https://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest/"
export osv4client=`curl -s -q ${osv4clienturl} \
| grep openshift-client-linux-4 | grep .tar.gz \
| sed -E 's/.*(openshift-client-linux-4.+tar.gz).*/\1/g'`
echo "Check the following URL for latest available OpenShift client:"
echo ${osv4clienturl}
echo
echo "using:"
echo "export osv4client=${osv4client}"
echo ${0}
echo
fi
### start build
# for time tracking
date
date -u
# we want the $@ args here to be re-split
time ${CONTAINER_SUBSYS} build \
--build-arg osv4client=${osv4client} \
$@ \
-t ocm-container .
# for time tracking
date
date -u