Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
62 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/bin/bash -e | ||
|
||
readonly COMPONENT=docs | ||
readonly ONEBOX_NAME="$COMPONENT"_onebox | ||
readonly PORT=5555 | ||
readonly CYAN="\e[96m" | ||
readonly RESET="\e[39m" | ||
|
||
log.info() { | ||
echo -e "$CYAN$@$RESET" | ||
} | ||
|
||
log.verbose() { | ||
echo -e $@ | ||
} | ||
|
||
stop() { | ||
local onebox_exist=$(sudo docker ps -a | grep $ONEBOX_NAME | awk '{print $1}') | ||
if [[ ! -z "$onebox_exist" ]]; then | ||
log.info "Removing $COMPONENT container..." | ||
sudo docker rm -f $ONEBOX_NAME > /dev/null | ||
fi | ||
} | ||
|
||
build() { | ||
log.info "Building $COMPONENT image..." | ||
sudo docker build -t shipimg/$COMPONENT . | ||
} | ||
|
||
run() { | ||
log.info "Running $COMPONENT..." | ||
sudo docker run --name=$ONEBOX_NAME \ | ||
-d -p $PORT:$PORT \ | ||
-v $(pwd):/home/shippable/$COMPONENT:rw \ | ||
-t shipimg/$COMPONENT \ | ||
> /dev/null | ||
|
||
log.verbose "Running at http://localhost:$PORT" | ||
} | ||
|
||
main() { | ||
stop | ||
build | ||
run | ||
} | ||
|
||
main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters