-
Notifications
You must be signed in to change notification settings - Fork 12
/
start-jenkins.sh
executable file
·38 lines (33 loc) · 1.51 KB
/
start-jenkins.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
#!/usr/bin/env bash
DOCKER_CONFIG_DIR="${DOCKER_CONFIG_DIR:-/usr/local/docker-config}"
if [ -f $DOCKER_CONFIG_DIR/setProxy.sh ]; then
. $DOCKER_CONFIG_DIR/setProxy.sh
fi
if ! docker network inspect selenium > /dev/null 2>&1; then
docker network create selenium
fi
docker run -d \
-e http_proxy="$http_proxy" \
-e https_proxy="$https_proxy" \
-e no_proxy="$no_proxy" \
-e DOCKER_CONFIG_DIR="$DOCKER_CONFIG_DIR" \
-v /var/jenkins_cert:/var/jenkins_cert \
-v "$DOCKER_CONFIG_DIR"/hpds_csv/:/usr/local/docker-config/hpds_csv/ \
-v /var/jenkins_home:/var/jenkins_home \
-v "$DOCKER_CONFIG_DIR":/usr/local/docker-config \
-v /var/run/docker.sock:/var/run/docker.sock \
-v "$HOME"/.my.cnf:/root/.my.cnf \
-v "$HOME"/.m2:/root/.m2 \
-v /etc/hosts:/etc/hosts \
-v /usr/local/pic-sure-services:/pic-sure-services \
--env-file initial-configuration/mysql-docker/.env \
--network selenium \
-p 8080:8080 --name jenkins pic-sure-jenkins:LATEST
# These would normally be volume mounts, but mounting volumes in volumes is bad vibes
# and it was breaking the backup logic in update-jenkins
docker exec jenkins mkdir -p /var/jenkins_home/workspace/Start\ PIC-SURE
docker exec jenkins mkdir -p /var/jenkins_home/workspace/Stop\ PIC-SURE
# Docker cp doesn't add parent dirs. Not even an option. Thanks, I guess?
docker cp start-picsure.sh jenkins:/var/jenkins_home/workspace/Start\ PIC-SURE/start-picsure.sh
docker cp stop-picsure.sh jenkins:/var/jenkins_home/workspace/Stop\ PIC-SURE/stop-picsure.sh
docker restart jenkins