Skip to content

Issues-519: Supporting a different Tideways env #537

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ builddeploy_steps: &builddeploy_steps
- run: *install_dependency
- run: *install_deploysuite
#- restore_cache: *restore_cache_settings_for_build
- run: ./build.sh ${APPNAME} ${CI_DEPLOY_TOKEN} ${LOGICAL_ENV} ${BRANCH}
- run: ./build.sh ${APPNAME} ${CI_DEPLOY_TOKEN} ${LOGICAL_ENV} ${BRANCH} ${TIDEWAYS_ENVIRONMENT}
#- save_cache: *save_cache_settings
- deploy:
name: Running MasterScript.
Expand All @@ -52,6 +52,7 @@ jobs:
APPNAME: "vanilla-forums"
CI_DEPLOY_TOKEN: $CI_DEPLOY_TOKEN
BRANCH: "develop"
TIDEWAYS_ENV: "dev"
steps: *builddeploy_steps

"build-prod":
Expand All @@ -62,6 +63,7 @@ jobs:
APPNAME: "vanilla-forums"
CI_DEPLOY_TOKEN: $CI_DEPLOY_TOKEN
BRANCH: "master"
TIDEWAYS_ENV: "production"
steps: *builddeploy_steps

workflows:
Expand Down
11 changes: 4 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ARG VANILLA_VERSION=3.3
ARG ENV
ARG BRANCH

ENV TIDEWAYS_SERVICE vanilla
ENV TIDEWAYS_SERVICE web
ENV WEB_DOCUMENT_ROOT /vanillapp

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


# Tideways
RUN if [ "$ENV" = "dev" ]; then \
apt-get update && apt-get install -y gnupg2; \
echo 'deb https://packages.tideways.com/apt-packages debian main' > /etc/apt/sources.list.d/tideways.list && \
RUN apt-get update && apt-get install -yq --no-install-recommends gnupg2;
RUN echo 'deb https://packages.tideways.com/apt-packages debian main' > /etc/apt/sources.list.d/tideways.list && \
curl -L -sS 'https://packages.tideways.com/key.gpg' | apt-key add - && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get -yq install tideways-php && \
apt-get autoremove --assume-yes && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*; \
echo 'extension=tideways.so\ntideways.connection=tcp://tideways-daemon:9135\ntideways.enable_cli=0\n' >> opt/docker/etc/php/php.ini; \
fi
echo 'extension=tideways.so\ntideways.connection=tcp://tideways-daemon:9135\ntideways.enable_cli=0\ntideways.sample_rate=25' >> opt/docker/etc/php/php.ini;

# Copy custom supervisor's configs and scripts
# Netcat is used to connect to a memcached server
Expand Down
7 changes: 2 additions & 5 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@ APP_NAME=$1
CI_DEPLOY_TOKEN=$2
ENV=$3
BRANCH=$4
TIDEWAYS_ENV=$5
UPDATE_CACHE=""
echo "" > vanilla.env
if [ "$ENV" = "dev" ]; then
ENV=$ENV CI_DEPLOY_TOKEN=$CI_DEPLOY_TOKEN BRANCH=$BRANCH docker-compose -f docker-compose.yml -f docker-compose.dev.yml build $APP_NAME
else
ENV=$ENV CI_DEPLOY_TOKEN=$CI_DEPLOY_TOKEN BRANCH=$BRANCH docker-compose -f docker-compose.yml build $APP_NAME
fi
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
#docker create --name app $APP_NAME:latest
2 changes: 2 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@ services:
container_name: tideways-daemon
build:
context: ./tideways-daemon
args:
- TIDEWAYS_ENV
ports:
- 9135:9135
5 changes: 3 additions & 2 deletions tideways-daemon/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
FROM debian:stable-slim

ARG TIDEWAYS_ENVIRONMENT_DEFAULT=production
ENV TIDEWAYS_ENVIRONMENT=$TIDEWAYS_ENVIRONMENT_DEFAULT
ARG TIDEWAYS_ENV
ENV TIDEWAYS_ENVIRONMENT=$TIDEWAYS_ENV
RUN echo "Tideways Daemon container for '$TIDEWAYS_ENV' env"

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