From 7a0689f77a390adc5233a564b4ded649282e9ad4 Mon Sep 17 00:00:00 2001 From: Bogdanova Olga Date: Fri, 26 Feb 2021 15:50:05 +0300 Subject: [PATCH 1/2] Issues-440: added branch param, removed debugBar from prod --- .circleci/config.yml | 5 ++++- Dockerfile | 45 ++++++++++++++++++++++++++------------------ build.sh | 5 +++-- docker-compose.yml | 1 + 4 files changed, 35 insertions(+), 21 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4a6aba4..d9b3055 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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. @@ -43,6 +43,7 @@ builddeploy_steps: &builddeploy_steps jobs: # Build & Deploy against development backend + # 'BRANCH' is used for plugins and other dependency repos "build-dev": <<: *defaults environment: @@ -50,6 +51,7 @@ jobs: LOGICAL_ENV: "dev" APPNAME: "vanilla-forums" CI_DEPLOY_TOKEN: $CI_DEPLOY_TOKEN + BRANCH: $CIRCLE_BRANCH steps: *builddeploy_steps "build-prod": @@ -59,6 +61,7 @@ jobs: LOGICAL_ENV: "prod" APPNAME: "vanilla-forums" CI_DEPLOY_TOKEN: $CI_DEPLOY_TOKEN + BRANCH: $CIRCLE_BRANCH steps: *builddeploy_steps workflows: diff --git a/Dockerfile b/Dockerfile index ea6fa6e..950ddc6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 @@ -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://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 @@ -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 \ diff --git a/build.sh b/build.sh index 8127c15..e764dbc 100755 --- a/build.sh +++ b/build.sh @@ -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 \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 7af8fc1..43dab53 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,5 +11,6 @@ services: - ENV - VANILLA_VERSION=3.3 - CI_DEPLOY_TOKEN + - BRANCH ports: - 80:80 \ No newline at end of file From 42e787d5691e575ebb0929e3b18d513dc783cbc9 Mon Sep 17 00:00:00 2001 From: Bogdanova Olga Date: Fri, 26 Feb 2021 15:59:49 +0300 Subject: [PATCH 2/2] Issues-440: fixed link for the theme repo --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 950ddc6..751498b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,7 +35,7 @@ RUN git clone --branch ${BRANCH} https://${CI_DEPLOY_TOKEN}@github.com/topcoder- 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://github.com/topcoder-platform/forums-theme.git' /vanillapp/themes/topcoder +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" ]; \