Skip to content

Commit f11c921

Browse files
committed
Issues-519: Supporting a different Tideways env
1 parent b41f458 commit f11c921

File tree

5 files changed

+14
-15
lines changed

5 files changed

+14
-15
lines changed

.circleci/config.yml

Lines changed: 3 additions & 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}
32+
- run: ./build.sh ${APPNAME} ${CI_DEPLOY_TOKEN} ${LOGICAL_ENV} ${BRANCH} ${TIDEWAYS_ENVIRONMENT}
3333
#- save_cache: *save_cache_settings
3434
- deploy:
3535
name: Running MasterScript.
@@ -52,6 +52,7 @@ jobs:
5252
APPNAME: "vanilla-forums"
5353
CI_DEPLOY_TOKEN: $CI_DEPLOY_TOKEN
5454
BRANCH: "develop"
55+
TIDEWAYS_ENV: "dev"
5556
steps: *builddeploy_steps
5657

5758
"build-prod":
@@ -62,6 +63,7 @@ jobs:
6263
APPNAME: "vanilla-forums"
6364
CI_DEPLOY_TOKEN: $CI_DEPLOY_TOKEN
6465
BRANCH: "master"
66+
TIDEWAYS_ENV: "production"
6567
steps: *builddeploy_steps
6668

6769
workflows:

Dockerfile

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ARG VANILLA_VERSION=3.3
55
ARG ENV
66
ARG BRANCH
77

8-
ENV TIDEWAYS_SERVICE vanilla
8+
ENV TIDEWAYS_SERVICE web
99
ENV WEB_DOCUMENT_ROOT /vanillapp
1010

1111
# Get the latest release of Vanilla Forums
@@ -69,19 +69,16 @@ COPY ./vanilla/. /vanillapp/.
6969
RUN chown application:application /vanillapp/conf/config.php
7070
RUN chmod ug=rwx,o=rx /vanillapp/conf/config.php
7171

72-
7372
# Tideways
74-
RUN if [ "$ENV" = "dev" ]; then \
75-
apt-get update && apt-get install -y gnupg2; \
76-
echo 'deb https://packages.tideways.com/apt-packages debian main' > /etc/apt/sources.list.d/tideways.list && \
73+
RUN apt-get update && apt-get install -yq --no-install-recommends gnupg2;
74+
RUN echo 'deb https://packages.tideways.com/apt-packages debian main' > /etc/apt/sources.list.d/tideways.list && \
7775
curl -L -sS 'https://packages.tideways.com/key.gpg' | apt-key add - && \
7876
apt-get update && \
7977
DEBIAN_FRONTEND=noninteractive apt-get -yq install tideways-php && \
8078
apt-get autoremove --assume-yes && \
8179
apt-get clean && \
8280
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*; \
83-
echo 'extension=tideways.so\ntideways.connection=tcp://tideways-daemon:9135\ntideways.enable_cli=0\n' >> opt/docker/etc/php/php.ini; \
84-
fi
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;
8582

8683
# Copy custom supervisor's configs and scripts
8784
# Netcat is used to connect to a memcached server

build.sh

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,8 @@ APP_NAME=$1
44
CI_DEPLOY_TOKEN=$2
55
ENV=$3
66
BRANCH=$4
7+
TIDEWAYS_ENV=$5
78
UPDATE_CACHE=""
89
echo "" > vanilla.env
9-
if [ "$ENV" = "dev" ]; then
10-
ENV=$ENV CI_DEPLOY_TOKEN=$CI_DEPLOY_TOKEN BRANCH=$BRANCH docker-compose -f docker-compose.yml -f docker-compose.dev.yml build $APP_NAME
11-
else
12-
ENV=$ENV CI_DEPLOY_TOKEN=$CI_DEPLOY_TOKEN BRANCH=$BRANCH docker-compose -f docker-compose.yml build $APP_NAME
13-
fi
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
1411
#docker create --name app $APP_NAME:latest

docker-compose.dev.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,7 @@ services:
77
container_name: tideways-daemon
88
build:
99
context: ./tideways-daemon
10+
args:
11+
- TIDEWAYS_ENV
1012
ports:
1113
- 9135:9135

tideways-daemon/Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
FROM debian:stable-slim
22

3-
ARG TIDEWAYS_ENVIRONMENT_DEFAULT=production
4-
ENV TIDEWAYS_ENVIRONMENT=$TIDEWAYS_ENVIRONMENT_DEFAULT
3+
ARG TIDEWAYS_ENV
4+
ENV TIDEWAYS_ENVIRONMENT=$TIDEWAYS_ENV
5+
RUN echo "Tideways Daemon container for '$TIDEWAYS_ENV' env"
56

67
RUN useradd --system tideways
78
RUN apt-get update && apt-get install -yq --no-install-recommends gnupg2 curl sudo ca-certificates

0 commit comments

Comments
 (0)