Skip to content

Commit ecbbe84

Browse files
authored
Merge pull request #446 from topcoder-platform/issues-440
Issues-440: added branch param, removed debugBar from prod
2 parents c45a9e0 + 42e787d commit ecbbe84

File tree

4 files changed

+35
-21
lines changed

4 files changed

+35
-21
lines changed

.circleci/config.yml

Lines changed: 4 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}
32+
- run: ./build.sh ${APPNAME} ${CI_DEPLOY_TOKEN} ${LOGICAL_ENV} ${BRANCH}
3333
#- save_cache: *save_cache_settings
3434
- deploy:
3535
name: Running MasterScript.
@@ -43,13 +43,15 @@ builddeploy_steps: &builddeploy_steps
4343
4444
jobs:
4545
# Build & Deploy against development backend
46+
# 'BRANCH' is used for plugins and other dependency repos
4647
"build-dev":
4748
<<: *defaults
4849
environment:
4950
DEPLOY_ENV: "DEV"
5051
LOGICAL_ENV: "dev"
5152
APPNAME: "vanilla-forums"
5253
CI_DEPLOY_TOKEN: $CI_DEPLOY_TOKEN
54+
BRANCH: $CIRCLE_BRANCH
5355
steps: *builddeploy_steps
5456

5557
"build-prod":
@@ -59,6 +61,7 @@ jobs:
5961
LOGICAL_ENV: "prod"
6062
APPNAME: "vanilla-forums"
6163
CI_DEPLOY_TOKEN: $CI_DEPLOY_TOKEN
64+
BRANCH: $CIRCLE_BRANCH
6265
steps: *builddeploy_steps
6366

6467
workflows:

Dockerfile

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ FROM webdevops/php-apache
33
ARG CI_DEPLOY_TOKEN
44
ARG VANILLA_VERSION=3.3
55
ARG ENV
6+
ARG BRANCH
67

78
ENV TIDEWAYS_SERVICE vanilla
89
ENV WEB_DOCUMENT_ROOT /vanillapp
@@ -15,33 +16,42 @@ RUN chmod -R 777 /vanillapp
1516

1617
# Delete the auto-enabled 'stubcontent' plugin which adds stub contents
1718
RUN rm -R /vanillapp/plugins/stubcontent
19+
20+
RUN echo "'$BRANCH' branch will be used for dependency repos ..."
21+
1822
# Clone the forum-plugins repository
19-
RUN git clone https://github.com/topcoder-platform/forums-plugins.git /tmp/forums-plugins
23+
RUN git clone --branch ${BRANCH} https://${CI_DEPLOY_TOKEN}@github.com/topcoder-platform/forums-plugins.git /tmp/forums-plugins
24+
25+
# Copy the Filestack plugin
26+
RUN git clone --branch ${BRANCH} https://${CI_DEPLOY_TOKEN}@github.com/topcoder-platform/forums-filestack-plugin /tmp/forums-plugins/Filestack
27+
28+
# Copy the Groups plugin
29+
RUN git clone --branch ${BRANCH} https://${CI_DEPLOY_TOKEN}@github.com/topcoder-platform/forums-groups-plugin /tmp/forums-plugins/Groups
30+
31+
# Copy the SumoLogic plugin
32+
RUN git clone --branch ${BRANCH} https://${CI_DEPLOY_TOKEN}@github.com/topcoder-platform/forums-sumologic-plugin /tmp/forums-plugins/Sumologic
33+
34+
# Copy the TopcoderEditor plugin
35+
RUN git clone --branch ${BRANCH} https://${CI_DEPLOY_TOKEN}@github.com/topcoder-platform/forums-topcoder-editor-plugin /tmp/forums-plugins/TopcoderEditor
36+
37+
# Copy the forum-theme repository
38+
RUN git clone --branch ${BRANCH} https://${CI_DEPLOY_TOKEN}@github.com/topcoder-platform/forums-theme.git /vanillapp/themes/topcoder
2039

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

26-
# Copy the Filestack plugin
27-
RUN git clone https://${CI_DEPLOY_TOKEN}@github.com/topcoder-platform/forums-filestack-plugin /tmp/forums-plugins/Filestack
28-
29-
#Copy the Groups plugin
30-
RUN git clone https://${CI_DEPLOY_TOKEN}@github.com/topcoder-platform/forums-groups-plugin /tmp/forums-plugins/Groups
31-
32-
#Copy the SumoLogic plugin
33-
RUN git clone https://${CI_DEPLOY_TOKEN}@github.com/topcoder-platform/forums-sumologic-plugin /tmp/forums-plugins/Sumologic
34-
35-
#Copy the TopcoderEditor plugin
36-
RUN git clone https://${CI_DEPLOY_TOKEN}@github.com/topcoder-platform/forums-topcoder-editor-plugin /tmp/forums-plugins/TopcoderEditor
3745

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

41-
#Get the debug bar plugin
42-
RUN wget https://us.v-cdn.net/5018160/uploads/addons/KSBIPJYMC0F2.zip
43-
RUN unzip KSBIPJYMC0F2.zip
44-
RUN cp -r debugbar /vanillapp/plugins
49+
# Get the debug bar plugin
50+
RUN if [ "$ENV" = "dev" ]; then \
51+
wget https://us.v-cdn.net/5018160/uploads/addons/KSBIPJYMC0F2.zip; \
52+
unzip KSBIPJYMC0F2.zip; \
53+
cp -r debugbar /vanillapp/plugins; \
54+
fi
4555

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

6473
# Tideways
6574
RUN if [ "$ENV" = "dev" ]; then \

build.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ set -eo pipefail
33
APP_NAME=$1
44
CI_DEPLOY_TOKEN=$2
55
ENV=$3
6+
BRANCH=$4
67
UPDATE_CACHE=""
78
echo "" > vanilla.env
89
if [ "$ENV" = "dev" ]; then
9-
ENV=$ENV CI_DEPLOY_TOKEN=$CI_DEPLOY_TOKEN 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 docker-compose -f docker-compose.yml -f docker-compose.dev.yml build $APP_NAME
1011
else
11-
ENV=$ENV CI_DEPLOY_TOKEN=$CI_DEPLOY_TOKEN docker-compose -f docker-compose.yml build $APP_NAME
12+
ENV=$ENV CI_DEPLOY_TOKEN=$CI_DEPLOY_TOKEN BRANCH=$BRANCH docker-compose -f docker-compose.yml build $APP_NAME
1213
fi
1314
#docker create --name app $APP_NAME:latest

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ services:
1111
- ENV
1212
- VANILLA_VERSION=3.3
1313
- CI_DEPLOY_TOKEN
14+
- BRANCH
1415
ports:
1516
- 80:80

0 commit comments

Comments
 (0)