forked from shivshav/ci
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·45 lines (39 loc) · 1.34 KB
/
run.sh
File metadata and controls
executable file
·45 lines (39 loc) · 1.34 KB
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
39
40
41
42
43
44
45
#!/bin/bash
BASEDIR=$(readlink -f $(dirname $0))
set -e
source ${BASEDIR}/config
source ${BASEDIR}/config.default
if [ ! -e "${SSH_KEY_PATH}" -o ! -e "${SSH_KEY_PATH}.pub" ]; then
echo "Generating SSH keys..."
rm -rf "${SSH_KEY_PATH}" "${SSH_KEY_PATH}.pub"
mkdir -p "${SSH_KEY_PATH%/*}"
ssh-keygen -t rsa -N "" -f "${SSH_KEY_PATH}" -C ${GERRIT_ADMIN_EMAIL}
fi
${BASEDIR}/createContainer.sh ${SUFFIX}
while [ -z "$(docker logs ${GERRIT_NAME} 2>&1 | grep "Gerrit Code Review [0-9..]* ready")" ]; do
echo "Waiting gerrit ready."
sleep 1
done
echo "Gerrit is ready"
while [ -z "$(docker logs ${JENKINS_NAME} 2>&1 | grep "setting agent port for jnlp")" ]; do
echo "Waiting jenkins ready."
sleep 1
done
echo "Jenkins is ready"
while [ -z "$(docker logs ${REDMINE_NAME} 2>&1 | grep "INFO success: nginx entered RUNNING state")" ]; do
echo "Waiting redmine ready."
sleep 1
done
echo "Redmine is ready"
#sleep 5
${BASEDIR}/setupContainer.sh ${SUFFIX}
#sleep 10
while [ -n "$(docker logs ${JENKINS_NAME} 2>&1 | tail -n 5 | grep 'Running from: /usr/share/jenkins/jenkins.war')" -o \
-z "$(docker logs ${JENKINS_NAME} 2>&1 | tail -n 5 | grep 'setting agent port for jnlp')" ]; do
echo "Waiting jenkins ready."
sleep 1
done
echo "Jenkins is ready"
#sleep 5
${BASEDIR}/importDemoProject.sh ${SUFFIX}
echo ">>>> Everything is ready."