Created
March 10, 2019 12:52
-
-
Save shaunfink/7967e477762d5100634b4e5a021df1bb to your computer and use it in GitHub Desktop.
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
#!/bin/sh -ex | |
codenvy_path=~/Workspace/docker/codenvy | |
if [[ ( ! -d ${codenvy_path} ) && ( ! -d ${codenvy_path}/data ) ]]; then | |
mkdir -p ${codenvy_path} | |
mkdir -p ${codenvy_path}/data | |
fi | |
cd ${codenvy_path} | |
case $1 in | |
start) | |
docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock -v $(pwd):/data codenvy/cli:latest start | |
;; | |
stop) | |
docker stop $(docker ps -a -q) | |
;; | |
config) | |
IP=$(docker run --rm --net host codenvy/cli:latest) && sudo ifconfig lo0 alias $IP | |
#IP=$(docker run --rm --net host eclipse/che-ip:nightly) && sudo ifconfig lo0 alias $IP | |
;; | |
test) | |
docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock -v $(pwd):/data codenvy/cli info --network | |
;; | |
* ) | |
echo "Please pass argument < start | stop | config | test > to proceed" | |
;; | |
esac | |
echo " Done!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment