forked from TSheetsTeam/api_docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmacbuild.sh
More file actions
executable file
·25 lines (18 loc) · 779 Bytes
/
Copy pathmacbuild.sh
File metadata and controls
executable file
·25 lines (18 loc) · 779 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
# Query to see if the image already exists, and build it if it doesn't
image=`docker images --filter "reference=tsheets" --format "{{.Repository}}"`
if [[ -z $image ]]; then
docker build --tag=tsheets:apidocs ${PWD}
fi
# Start the container
docker run --name=apidocs -d tsheets:apidocs
# Copy the source files into the container
docker cp ${PWD}/source/. apidocs:/usr/src/app/source
# Execute the build
docker exec -w /usr/src/app/source apidocs bundle exec middleman build --clean --verbose
# Copy the build outputs from the container to a local directory
docker cp apidocs:/usr/src/app/build/. ${PWD}/build
# Stop the container and remove it
docker stop --time=0 apidocs
docker rm apidocs
echo Opening ${PWD}/build/index.html in a browser.
open ${PWD}/build/index.html