Skip to content
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
5 changes: 4 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}
- run: ./build.sh ${APPNAME} ${CI_DEPLOY_TOKEN} ${LOGICAL_ENV} ${BRANCH}
#- save_cache: *save_cache_settings
- deploy:
name: Running MasterScript.
Expand All @@ -43,13 +43,15 @@ builddeploy_steps: &builddeploy_steps

jobs:
# Build & Deploy against development backend
# 'BRANCH' is used for plugins and other dependency repos
"build-dev":
<<: *defaults
environment:
DEPLOY_ENV: "DEV"
LOGICAL_ENV: "dev"
APPNAME: "vanilla-forums"
CI_DEPLOY_TOKEN: $CI_DEPLOY_TOKEN
BRANCH: $CIRCLE_BRANCH
steps: *builddeploy_steps

"build-prod":
Expand All @@ -59,6 +61,7 @@ jobs:
LOGICAL_ENV: "prod"
APPNAME: "vanilla-forums"
CI_DEPLOY_TOKEN: $CI_DEPLOY_TOKEN
BRANCH: $CIRCLE_BRANCH
steps: *builddeploy_steps

workflows:
Expand Down
45 changes: 27 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ FROM webdevops/php-apache
ARG CI_DEPLOY_TOKEN
ARG VANILLA_VERSION=3.3
ARG ENV
ARG BRANCH

ENV TIDEWAYS_SERVICE vanilla
ENV WEB_DOCUMENT_ROOT /vanillapp
Expand All @@ -15,33 +16,42 @@ RUN chmod -R 777 /vanillapp

# Delete the auto-enabled 'stubcontent' plugin which adds stub contents
RUN rm -R /vanillapp/plugins/stubcontent

RUN echo "'$BRANCH' branch will be used for dependency repos ..."

# Clone the forum-plugins repository
RUN git clone https://github.com/topcoder-platform/forums-plugins.git /tmp/forums-plugins
RUN git clone --branch ${BRANCH} https://${CI_DEPLOY_TOKEN}@github.com/topcoder-platform/forums-plugins.git /tmp/forums-plugins

# Copy the Filestack plugin
RUN git clone --branch ${BRANCH} https://${CI_DEPLOY_TOKEN}@github.com/topcoder-platform/forums-filestack-plugin /tmp/forums-plugins/Filestack

# Copy the Groups plugin
RUN git clone --branch ${BRANCH} https://${CI_DEPLOY_TOKEN}@github.com/topcoder-platform/forums-groups-plugin /tmp/forums-plugins/Groups

# Copy the SumoLogic plugin
RUN git clone --branch ${BRANCH} https://${CI_DEPLOY_TOKEN}@github.com/topcoder-platform/forums-sumologic-plugin /tmp/forums-plugins/Sumologic

# Copy the TopcoderEditor plugin
RUN git clone --branch ${BRANCH} https://${CI_DEPLOY_TOKEN}@github.com/topcoder-platform/forums-topcoder-editor-plugin /tmp/forums-plugins/TopcoderEditor

# Copy the forum-theme repository
RUN git clone --branch ${BRANCH} https://${CI_DEPLOY_TOKEN}@github.com/topcoder-platform/forums-theme.git /vanillapp/themes/topcoder

# Remove DebugPlugin from PROD env
# RUN if [ "$ENV" = "prod" ]; \
# then rm -R /tmp/forums-plugins/DebugPlugin; \
# fi

# Copy the Filestack plugin
RUN git clone https://${CI_DEPLOY_TOKEN}@github.com/topcoder-platform/forums-filestack-plugin /tmp/forums-plugins/Filestack

#Copy the Groups plugin
RUN git clone https://${CI_DEPLOY_TOKEN}@github.com/topcoder-platform/forums-groups-plugin /tmp/forums-plugins/Groups

#Copy the SumoLogic plugin
RUN git clone https://${CI_DEPLOY_TOKEN}@github.com/topcoder-platform/forums-sumologic-plugin /tmp/forums-plugins/Sumologic

#Copy the TopcoderEditor plugin
RUN git clone https://${CI_DEPLOY_TOKEN}@github.com/topcoder-platform/forums-topcoder-editor-plugin /tmp/forums-plugins/TopcoderEditor

# Copy all plugins to the Vanilla plugins folder
RUN cp -r /tmp/forums-plugins/. /vanillapp/plugins

#Get the debug bar plugin
RUN wget https://us.v-cdn.net/5018160/uploads/addons/KSBIPJYMC0F2.zip
RUN unzip KSBIPJYMC0F2.zip
RUN cp -r debugbar /vanillapp/plugins
# Get the debug bar plugin
RUN if [ "$ENV" = "dev" ]; then \
wget https://us.v-cdn.net/5018160/uploads/addons/KSBIPJYMC0F2.zip; \
unzip KSBIPJYMC0F2.zip; \
cp -r debugbar /vanillapp/plugins; \
fi

# Install Topcoder dependencies
RUN composer install --working-dir /vanillapp/plugins/Topcoder
Expand All @@ -58,8 +68,7 @@ COPY ./vanilla/. /vanillapp/.
# Set permissions on config file
RUN chown application:application /vanillapp/conf/config.php
RUN chmod ug=rwx,o=rx /vanillapp/conf/config.php
# Clone the forum-theme repository
RUN git clone 'https://github.com/topcoder-platform/forums-theme.git' /vanillapp/themes/topcoder


# Tideways
RUN if [ "$ENV" = "dev" ]; then \
Expand Down
5 changes: 3 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ set -eo pipefail
APP_NAME=$1
CI_DEPLOY_TOKEN=$2
ENV=$3
BRANCH=$4
UPDATE_CACHE=""
echo "" > vanilla.env
if [ "$ENV" = "dev" ]; then
ENV=$ENV CI_DEPLOY_TOKEN=$CI_DEPLOY_TOKEN docker-compose -f docker-compose.yml -f docker-compose.dev.yml build $APP_NAME
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 docker-compose -f docker-compose.yml build $APP_NAME
ENV=$ENV CI_DEPLOY_TOKEN=$CI_DEPLOY_TOKEN BRANCH=$BRANCH docker-compose -f docker-compose.yml build $APP_NAME
fi
#docker create --name app $APP_NAME:latest
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ services:
- ENV
- VANILLA_VERSION=3.3
- CI_DEPLOY_TOKEN
- BRANCH
ports:
- 80:80