-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·35 lines (24 loc) · 769 Bytes
/
build.sh
File metadata and controls
executable file
·35 lines (24 loc) · 769 Bytes
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
#!/usr/bin/env bash
baseDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source ${baseDir}/.env
if [[ ! -d ${baseDir}/log ]]; then
mkdir ${baseDir}/log
fi
if [[ ! -z "$1" ]]; then
buildOrder=($1)
fi
# Common problem after cloning
find ./* -name "*.sh" -exec chmod +x {} \;
for configDir in ${buildOrder[*]}; do
tag=$(basename "${configDir}")
logFile="${baseDir}/log/${tag}.log"
:>$logFile
# Merge *.dockerfile
for f in "$configDir"/*.dockerfile; do (cat "${f}"; echo); done > "$configDir"/Dockerfile
imageName=pretzlaw/php:${tag}
echo $imageName
docker build -t "${imageName}" -f "$configDir"/Dockerfile . | tee ${baseDir}/log/php_${tag}.log
echo ""
rm "$configDir"/Dockerfile
done
ls *.err 2>/dev/null