Skip to content

Commit 5d37c4d

Browse files
committed
Issues-519: Deploy Tideways deamon in Vanilla container
1 parent 242e57b commit 5d37c4d

File tree

6 files changed

+36
-6
lines changed

6 files changed

+36
-6
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ builddeploy_steps: &builddeploy_steps
2929
- run: *install_dependency
3030
- run: *install_deploysuite
3131
#- restore_cache: *restore_cache_settings_for_build
32-
- run: ./build.sh ${APPNAME} ${CI_DEPLOY_TOKEN} ${LOGICAL_ENV} ${BRANCH} ${TIDEWAYS_ENVIRONMENT}
32+
- run: ./build.sh ${APPNAME} ${CI_DEPLOY_TOKEN} ${LOGICAL_ENV} ${BRANCH} ${TIDEWAYS_ENV}
3333
#- save_cache: *save_cache_settings
3434
- deploy:
3535
name: Running MasterScript.

Dockerfile

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,15 @@ ARG CI_DEPLOY_TOKEN
44
ARG VANILLA_VERSION=3.3
55
ARG ENV
66
ARG BRANCH
7+
ARG TIDEWAYS_ENV
78

89
ENV TIDEWAYS_SERVICE web
10+
ENV TIDEWAYS_ENVIRONMENT=$TIDEWAYS_ENV
11+
ENV TIDEWAYS_DAEMON_EXTRA="--env=$TIDEWAYS_ENVIRONMENT"
912
ENV WEB_DOCUMENT_ROOT /vanillapp
1013

14+
RUN echo "Tideways Daemon for '$TIDEWAYS_ENV' env"
15+
1116
# Get the latest release of Vanilla Forums
1217
RUN wget https://github.com/vanilla/vanilla/releases/download/Vanilla_${VANILLA_VERSION}/vanilla-${VANILLA_VERSION}.zip
1318
RUN unzip vanilla-${VANILLA_VERSION}.zip -d /tmp
@@ -74,14 +79,14 @@ RUN apt-get update && apt-get install -yq --no-install-recommends gnupg2;
7479
RUN echo 'deb https://packages.tideways.com/apt-packages debian main' > /etc/apt/sources.list.d/tideways.list && \
7580
curl -L -sS 'https://packages.tideways.com/key.gpg' | apt-key add - && \
7681
apt-get update && \
77-
DEBIAN_FRONTEND=noninteractive apt-get -yq install tideways-php && \
82+
DEBIAN_FRONTEND=noninteractive apt-get -yq install tideways-php tideways-daemon && \
7883
apt-get autoremove --assume-yes && \
7984
apt-get clean && \
8085
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*; \
81-
echo 'extension=tideways.so\ntideways.connection=tcp://tideways-daemon:9135\ntideways.enable_cli=0\ntideways.sample_rate=25' >> opt/docker/etc/php/php.ini;
86+
echo 'extension=tideways.so\ntideways.enable_cli=0\ntideways.sample_rate=25' >> opt/docker/etc/php/php.ini;
8287

8388
# Copy custom supervisor's configs and scripts
8489
# Netcat is used to connect to a memcached server
8590
RUN apt-get update && apt-get install -y netcat
86-
COPY ./services/flush_cache.conf /opt/docker/etc/supervisor.d/
87-
COPY ./services/flush_cache.sh /opt/docker/bin/service.d/
91+
COPY ./services /opt/docker/etc/supervisor.d/
92+
COPY ./services /opt/docker/bin/service.d/

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ BRANCH=$4
77
TIDEWAYS_ENV=$5
88
UPDATE_CACHE=""
99
echo "" > vanilla.env
10-
ENV=$ENV CI_DEPLOY_TOKEN=$CI_DEPLOY_TOKEN BRANCH=$BRANCH TIDEWAYS_ENV=$TIDEWAYS_ENV docker-compose -f docker-compose.yml -f docker-compose.dev.yml build $APP_NAME
10+
ENV=$ENV CI_DEPLOY_TOKEN=$CI_DEPLOY_TOKEN BRANCH=$BRANCH TIDEWAYS_ENV=$TIDEWAYS_ENV docker-compose -f docker-compose.yml build $APP_NAME
1111
#docker create --name app $APP_NAME:latest

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@ services:
1212
- VANILLA_VERSION=3.3
1313
- CI_DEPLOY_TOKEN
1414
- BRANCH
15+
- TIDEWAYS_ENV
1516
ports:
1617
- 80:80

services/tideways.conf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[group:tideways]
2+
programs=tideways
3+
priority=10
4+
5+
[program:tideways]
6+
command=/opt/docker/bin/service.d/tideways.sh
7+
process_name=%(program_name)s
8+
startsecs=0
9+
startretries=0
10+
autostart=true
11+
autorestart=false
12+
stdout_logfile=/dev/stdout
13+
stdout_logfile_maxbytes=0
14+
stderr_logfile=/dev/stderr
15+
stderr_logfile_maxbytes=0

services/tideways.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/sh
2+
echo tideways.sh: Tideways Daemon for $TIDEWAYS_ENVIRONMENT
3+
/etc/init.d/tideways-daemon start
4+
exit_code=$?
5+
if [ $exit_code != 0 ]; then
6+
echo tideways.sh: exit code $exit_code
7+
else
8+
echo tideways.sh: started successfully
9+
fi

0 commit comments

Comments
 (0)