Created
November 12, 2014 05:01
-
-
Save jazzwang/4c8d37494643070c9a41 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/bash | |
case "$1" in | |
new) | |
echo "[INFO] Creating new gitlab docker instances ..." | |
docker create --name='gitlab' -it -e 'GITLAB_PORT=10080' -e 'GITLAB_SSH_PORT=10022' -p 10022:22 -p 10080:80 -v /var/run/docker.sock:/run/docker.sock -v $(which docker):/bin/docker -v $(pwd):/vagrant sameersbn/gitlab:latest | |
;; | |
start) | |
echo "[INFO] Starting gitlab docker instances ..." | |
docker start gitlab | |
;; | |
stop) | |
echo "[INFO] Stoping gitlab docker instances ..." | |
ID=$(docker ps -a | grep "gitlab " | awk '{ print $1}') | |
docker stop $ID | |
;; | |
status) | |
docker ps -a | grep "gitlab " | |
;; | |
log) | |
docker logs gitlab | |
;; | |
rm) | |
echo "[INFO] Removing gitlab docker instances ..." | |
ID=$(docker ps -a | grep gitlab | awk '{ print $1}') | |
docker rm $ID | |
;; | |
*) | |
echo "Usage: $0 [ new | start | stop | status | log | rm ]" | |
;; | |
esac |
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/bash | |
case "$1" in | |
new) | |
echo "[INFO] Creating new gitlab-ci docker instances ..." | |
docker create --name='gitlab-ci' -it -e 'GITLAB_PORT=20080' -e 'GITLAB_SSH_PORT=20022' -p 20022:22 -p 20080:80 -v /var/run/docker.sock:/run/docker.sock -v $(which docker):/bin/docker -v $(pwd):/vagrant sameersbn/gitlab-ci:latest | |
;; | |
start) | |
echo "[INFO] Starting gitlab-ci docker instances ..." | |
docker start gitlab-ci | |
;; | |
stop) | |
echo "[INFO] Stoping gitlab-ci docker instances ..." | |
ID=$(docker ps -a | grep gitlab-ci | awk '{ print $1}') | |
docker stop $ID | |
;; | |
status) | |
docker ps -a | grep gitlab-ci | |
;; | |
log) | |
docker logs gitlab-ci | |
;; | |
rm) | |
echo "[INFO] Removing gitlab-ci docker instances ..." | |
ID=$(docker ps -a | grep gitlab-ci | awk '{ print $1}') | |
docker rm $ID | |
docker ps -a | |
;; | |
*) | |
echo "Usage: $0 [ new | start | stop | status | log | rm ]" | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment