-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·39 lines (31 loc) · 962 Bytes
/
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
#!/usr/bin/env bash
#
# Copyright (C) Abraham Aondowase Yusuf - All Rights Reserved
# Unauthorized copying of this file, via any medium is strictly prohibited
# Proprietary and confidential
# This file is subject to the terms and conditions defined in
# file 'LICENSE', which is part of this source code package.
# Written by Abraham Aondowase Yusuf <[email protected]>, April 2018
set -x
clean_build() {
'''Cleanup old build artefacts'''
local unneeded=(api_logs media_store data)
for build_dir in $unneeded
do
if [[ -d "$build_dir" ]]; then
rm -rf "$build_dir"
fi
done
local dc_conf="docker-compose.yml"
if [[ -f "$dc_conf" ]]; then
rm -f "$dc_conf"
fi
}
build_containers() {
local new_password="$(pwgen 24 1)"
local placeholder="MySuperSecretPassword"
sed s/$placeholder/$new_password/g <docker-compose.sample.yml >docker-compose.yml
docker-compose build
}
clean_build
build_containers