Skip to content

Commit

Permalink
Fixed issues running docker-compose (#538)
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarpicas authored Dec 2, 2022
1 parent 8f2da89 commit fd8a8ff
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,12 @@ feature:
targets:
gateways: all
run: |
sleep 0.$((200 + RANDOM%600))
grep edgeproxy4subnet ${SF_LOGDIR}/docker.log && sfExit
echo "docker-compose -f ${SF_ETCDIR}/edgeproxy4subnet/docker-compose.yml -p edgeproxy4subnet up -d" >> ${SF_LOGDIR}/docker.log 2>&1 || true
sfRetryEx 15m 5 docker-compose -f ${SF_ETCDIR}/edgeproxy4subnet/docker-compose.yml -p edgeproxy4subnet up -d >> ${SF_LOGDIR}/docker.log 2>&1 || sfFail 193
pgrep docker-compose && sfExit
docker system prune -f || sfExit
pgrep docker-compose || docker-compose -f ${SF_ETCDIR}/edgeproxy4subnet/docker-compose.yml -p edgeproxy4subnet up -d >> ${SF_LOGDIR}/docker.log 2>&1 || sfFail 193
sfRetryEx 5m 5 "sfDoesDockerRunContainer edgeproxy4subnet:latest edgeproxy4subnet_proxy_1" || sfFail 194
sfExit
Expand All @@ -185,21 +189,21 @@ feature:
run: |
if [ -f ${SF_ETCDIR}/edgeproxy4subnet/docker-compose.yml ]; then
echo "docker-compose -f ${SF_ETCDIR}/edgeproxy4subnet/docker-compose.yml -p edgeproxy4subnet rm --stop --force" >> ${SF_LOGDIR}/docker.log 2>&1 || true
sfRetryEx 15m 5 docker-compose -f ${SF_ETCDIR}/edgeproxy4subnet/docker-compose.yml -p edgeproxy4subnet rm --stop --force >> ${SF_LOGDIR}/docker.log 2>&1 || sfFail 195
docker-compose -f ${SF_ETCDIR}/edgeproxy4subnet/docker-compose.yml -p edgeproxy4subnet rm --stop --force >> ${SF_LOGDIR}/docker.log 2>&1 || sfFail 195
# docker secret rm safescale.edgeproxy.db_password &>/dev/null
docker image rm -f edgeproxy4subnet:latest
rm -rf ${SF_ETCDIR}/edgeproxy4subnet
else
if [ -f ${SF_ETCDIR}/kong4gateway/docker-compose.yml ]; then
echo "docker-compose -f ${SF_ETCDIR}/kong4gateway/docker-compose.yml -p kong4gateway rm --stop --force" >> ${SF_LOGDIR}/docker.log 2>&1 || true
sfRetryEx 15m 5 docker-compose -f ${SF_ETCDIR}/kong4gateway/docker-compose.yml -p kong4gateway rm --stop --force >> ${SF_LOGDIR}/docker.log 2>&1 || sfFail 196
docker-compose -f ${SF_ETCDIR}/kong4gateway/docker-compose.yml -p kong4gateway rm --stop --force >> ${SF_LOGDIR}/docker.log 2>&1 || sfFail 196
docker image rm -f kong4gateway:latest
rm -rf ${SF_ETCDIR}/kong4gateway
fi
if [ -f ${SF_ETCDIR}/kong/docker-compose.yml ]; then
echo "docker-compose -f ${SF_ETCDIR}/kong/docker-compose.yml -p kong rm --stop --force" >> ${SF_LOGDIR}/docker.log 2>&1 || true
sfRetryEx 15m 5 docker-compose -f ${SF_ETCDIR}/kong/docker-compose.yml -p kong rm --stop --force >> ${SF_LOGDIR}/docker.log 2>&1 || sfFail 197
docker-compose -f ${SF_ETCDIR}/kong/docker-compose.yml -p kong rm --stop --force >> ${SF_LOGDIR}/docker.log 2>&1 || sfFail 197
docker image rm -f kong:latest
rm -rf ${SF_ETCDIR}/kong
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,12 @@ feature:
nodes: no
run: |
{{ if .HostIsGateway }}
sleep 0.$((200 + RANDOM%600))
grep postgres4gateway ${SF_LOGDIR}/docker.log && sfExit
echo "docker-compose -f ${SF_ETCDIR}/postgres4gateway/docker-compose.yml -p postgres4gateway up -d" >> ${SF_LOGDIR}/docker.log 2>&1 || true
sfRetryEx 10m 5 docker-compose -f ${SF_ETCDIR}/postgres4gateway/docker-compose.yml -p postgres4gateway up -d >> ${SF_LOGDIR}/docker.log 2>&1 || sfFail 194
pgrep docker-compose && sfExit
docker system prune -f || sfExit
pgrep docker-compose || docker-compose -f ${SF_ETCDIR}/postgres4gateway/docker-compose.yml -p postgres4gateway up -d >> ${SF_LOGDIR}/docker.log 2>&1 || sfFail 194
sfRetryEx 5m 5 "sfDoesDockerRunContainer postgres:11-alpine postgres4gateway_postgres_1" || sfFail 195
sfExit
{{ else }}
Expand All @@ -111,7 +115,7 @@ feature:
run: |
{{ if .HostIsGateway }}
echo "docker-compose -f ${SF_ETCDIR}/postgres4gateway/docker-compose.yml -p postgres4gateway rm --stop --force" >> ${SF_LOGDIR}/docker.log 2>&1 || true
sfRetryEx 10m 5 docker-compose -f ${SF_ETCDIR}/postgres4gateway/docker-compose.yml -p postgres4gateway rm --stop --force >> ${SF_LOGDIR}/docker.log 2>&1 || sfFail 196
docker-compose -f ${SF_ETCDIR}/postgres4gateway/docker-compose.yml -p postgres4gateway rm --stop --force >> ${SF_LOGDIR}/docker.log 2>&1 || sfFail 196
docker image rm -f postgres:11-alpine
sfExit
{{ else }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ feature:
cd ${SF_TMPDIR} && rm -rf proxycache.image || sfFail 192
echo "docker-compose -f ${SF_VARDIR}/run/proxycache.compose.yml -p proxycache up -d" >> ${SF_LOGDIR}/docker.log 2>&1 || true
sfRetryEx 15m 5 docker-compose -f ${SF_VARDIR}/run/proxycache.compose.yml -p proxycache up -d >> ${SF_LOGDIR}/docker.log 2>&1 || sfFail 514
docker-compose -f ${SF_VARDIR}/run/proxycache.compose.yml -p proxycache up -d >> ${SF_LOGDIR}/docker.log 2>&1 || sfFail 514
remove:
pace: container
Expand All @@ -174,25 +174,25 @@ feature:
host: yes
run: |
echo "docker-compose -f ${SF_VARDIR}/run/proxycache.compose.yml rm -f" >> ${SF_LOGDIR}/docker.log 2>&1 || true
sfRetryEx 15m 5 docker-compose -f ${SF_VARDIR}/run/proxycache.compose.yml rm -f >> ${SF_LOGDIR}/docker.log 2>&1
docker-compose -f ${SF_VARDIR}/run/proxycache.compose.yml rm -f >> ${SF_LOGDIR}/docker.log 2>&1
docker image rm -f proxycache:latest
service:
start: |
echo "docker-compose -f ${SF_VARDIR}/run/proxycache.feature.yml up -d" >> ${SF_LOGDIR}/docker.log 2>&1 || true
sfRetryEx 15m 5 docker-compose -f ${SF_VARDIR}/run/proxycache.feature.yml up -d >> ${SF_LOGDIR}/docker.log 2>&1
docker-compose -f ${SF_VARDIR}/run/proxycache.feature.yml up -d >> ${SF_LOGDIR}/docker.log 2>&1
stop: |
echo "docker-compose -f ${SF_VARDIR}/run/proxycache.feature.yml down" >> ${SF_LOGDIR}/docker.log 2>&1 || true
sfRetryEx 15m 5 docker-compose -f ${SF_VARDIR}/run/proxycache.feature.yml down >> ${SF_LOGDIR}/docker.log 2>&1
docker-compose -f ${SF_VARDIR}/run/proxycache.feature.yml down >> ${SF_LOGDIR}/docker.log 2>&1
pause: |
echo "docker-compose -f ${SF_VARDIR}/run/proxycache.feature.yml pause" >> ${SF_LOGDIR}/docker.log 2>&1 || true
sfRetryEx 15m 5 docker-compose -f ${SF_VARDIR}/run/proxycache.feature.yml pause >> ${SF_LOGDIR}/docker.log 2>&1
docker-compose -f ${SF_VARDIR}/run/proxycache.feature.yml pause >> ${SF_LOGDIR}/docker.log 2>&1
unpause: |
echo "docker-compose -f ${SF_VARDIR}/run/proxycache.feature.yml unpause" >> ${SF_LOGDIR}/docker.log 2>&1 || true
sfRetryEx 15m 5 docker-compose -f ${SF_VARDIR}/run/proxycache.feature.yml unpause >> ${SF_LOGDIR}/docker.log 2>&1
docker-compose -f ${SF_VARDIR}/run/proxycache.feature.yml unpause >> ${SF_LOGDIR}/docker.log 2>&1
state: |
docker ps | grep proxycache &>/dev/null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ feature:
# Starts remotedesktop container #
###########################################################
echo "docker-compose -f ${SF_ETCDIR}/remotedesktop/docker-compose.yml up -d" >> ${SF_LOGDIR}/docker.log 2>&1 || true
sfRetryEx 15m 5 docker-compose -f ${SF_ETCDIR}/remotedesktop/docker-compose.yml up -d >> ${SF_LOGDIR}/docker.log 2>&1 || sfFail 209
docker-compose -f ${SF_ETCDIR}/remotedesktop/docker-compose.yml up -d >> ${SF_LOGDIR}/docker.log 2>&1 || sfFail 209
sfExit
remove:
Expand All @@ -586,7 +586,7 @@ feature:
masters: all
run: |
echo "docker-compose -f ${SF_ETCDIR}/remotedesktop/docker-compose.yml -p safescale/remotedesktop rm --stop --force" >> ${SF_LOGDIR}/docker.log 2>&1 || true
sfRetryEx 15m 5 docker-compose -f ${SF_ETCDIR}/remotedesktop/docker-compose.yml -p safescale/remotedesktop rm --stop --force >> ${SF_LOGDIR}/docker.log 2>&1 || sfFail 192
docker-compose -f ${SF_ETCDIR}/remotedesktop/docker-compose.yml -p safescale/remotedesktop rm --stop --force >> ${SF_LOGDIR}/docker.log 2>&1 || sfFail 192
docker image rm -f safescale/remotedesktop:latest || sfFail 193
rm -rf ${SF_ETCDIR}/remotedesktop
sfExit
Expand Down

0 comments on commit fd8a8ff

Please sign in to comment.