Skip to content

Commit 4f61df3

Browse files
committed
adding working gaurd and ci run concept that just starts the nginx process skipping mysql stuff
1 parent 185dabd commit 4f61df3

File tree

3 files changed

+9
-13
lines changed

3 files changed

+9
-13
lines changed

Jenkinsfile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,11 @@ pipeline {
2929
DIST_IMAGE = 'alpine'
3030
MULTIARCH = 'true'
3131
CI = 'true'
32-
CI_WEB = 'true'
32+
CI_WEB = 'false'
3333
CI_PORT = '80'
3434
CI_SSL = 'false'
3535
CI_DELAY = '120'
36-
TEST_MYSQL_HOST = credentials('mysql_test_host')
37-
TEST_MYSQL_PASSWORD = credentials('mysql_test_password')
38-
CI_DOCKERENV = 'DB_HOST=${TEST_MYSQL_HOST}|DB_DATABASE=bookstack|DB_USERNAME=root|DB_PASSWORD=${TEST_MYSQL_PASSWORD}'
36+
CI_DOCKERENV = 'CI_RUN=true'
3937
CI_AUTH = 'user:password'
4038
CI_WEBPATH = ''
4139
}

jenkins-vars.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,10 @@ repo_vars:
2020
- DIST_IMAGE = 'alpine'
2121
- MULTIARCH = 'true'
2222
- CI = 'true'
23-
- CI_WEB = 'true'
23+
- CI_WEB = 'false'
2424
- CI_PORT = '80'
2525
- CI_SSL = 'false'
2626
- CI_DELAY = '120'
27-
- TEST_MYSQL_HOST = credentials('mysql_test_host')
28-
- TEST_MYSQL_PASSWORD = credentials('mysql_test_password')
29-
- CI_DOCKERENV = 'DB_HOST=${TEST_MYSQL_HOST}|DB_DATABASE=bookstack|DB_USERNAME=root|DB_PASSWORD=${TEST_MYSQL_PASSWORD}'
27+
- CI_DOCKERENV = 'CI_RUN=true'
3028
- CI_AUTH = 'user:password'
3129
- CI_WEBPATH = ''

root/etc/cont-init.d/50-config

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,9 @@ fi
5757

5858
# check for the mysql endpoint for 30 seconds
5959
END=$((SECONDS+30))
60-
while [ ${SECONDS} -lt ${END} ] && [ "${DB_HOST}" ];
61-
do
60+
while [ ${SECONDS} -lt ${END} ] && [ -n "${DB_HOST+x}" ]; do
6261
/usr/bin/nc -z ${DB_HOST} 3306 && \
63-
if [ ! -z "$(/usr/bin/nc -w1 ${DB_HOST} 3306)" ];
64-
then
62+
if [ ! -z "$(/usr/bin/nc -w1 ${DB_HOST} 3306)" ]; then
6563
[ ! -z "${RUN}" ] && break
6664
RUN="RAN"
6765
# we sleep here again due to first run init on DB containers
@@ -73,7 +71,9 @@ while [ ${SECONDS} -lt ${END} ] && [ "${DB_HOST}" ];
7371
done
7472

7573
# update database - will set up database if fresh, or, migrate existing
76-
php /var/www/html/artisan migrate --force
74+
if [ -z "${CI_RUN+x}" ]; then
75+
php /var/www/html/artisan migrate --force
76+
fi
7777

7878
# set permissions
7979
chown -R abc:abc \

0 commit comments

Comments
 (0)