-
Notifications
You must be signed in to change notification settings - Fork 0
/
BS-BUILD.sh
executable file
·40 lines (32 loc) · 1.3 KB
/
BS-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
# Create a container from bootstrapdev if not exist
if [ ! "$(docker ps -q -f name=bsdev)" ]; then
if [ "$(docker ps -aq -f status=exited -f name=bsdev)" ]; then
# cleanup exited container
docker rm bsdev
fi
# Start a new container and run bash
docker create -ti --name bsdev bootstrapdev bash
fi
# Start the container
docker start bsdev
# Update customizations and recompile changes
docker exec -ti -w /home/bootstrap/bootstrap/bootstrap bsdev bash -c "git reset --hard"
docker exec -ti -w /home/bootstrap/bootstrap/bootstrap bsdev bash -c "git pull --no-rebase"
# Update the 'starter' custom files
docker cp ./bootstrap.scss bsdev:/home/bootstrap/bootstrap/scss/bootstrap.scss
docker cp ./custom.scss bsdev:/home/bootstrap/bootstrap/scss/custom.scss
docker cp ./package.json bsdev:/home/bootstrap/bootstrap/package.json
docker exec -ti -w /home/bootstrap/bootstrap bsdev bash -c "git checkout tags/v5.0.2"
docker exec -ti -w /home/bootstrap/bootstrap bsdev bash -c "npm run dist"
# Export Files to Host
rm -Rf ./dist
mkdir ./dist
docker cp bsdev:/home/bootstrap/bootstrap/dist/css ./dist/css
docker cp bsdev:/home/bootstrap/bootstrap/dist/js ./dist/js
cd dist
DATESTAMP=`date "+%Y-%m-%d.%H:%M:%S"`
zip -r dist-$DATESTAMP.zip css js
mv dist-$DATESTAMP.zip ..
cd ..
# Delete container
docker rm -f bsdev