From 5a6dbcddb3b356d9e60c11d57d627ca971dff0ae Mon Sep 17 00:00:00 2001 From: inwerpsel Date: Tue, 20 Oct 2020 12:25:31 +0200 Subject: [PATCH] PLANET-5221 Checkout code for forks, instead of composer * Need to provide WP_VERSION here as normally it comes from the org-global context, which is not available for forks. --- .circleci/config.yml | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 108bf811a8..45e28efdef 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,10 +6,8 @@ workflows: jobs: - php72-tests - php73-tests - - acceptance-tests: - context: org-global - - a11y-tests: - context: org-global + - acceptance-tests + - a11y-tests - create-release-zip: context: org-global filters: @@ -79,6 +77,7 @@ job-references: auth: &docker_auth working_directory: /home/circleci/ environment: + WP_VERSION: 5.4.2 APP_HOSTNAME: www.planet4.test APP_HOSTPATH: CLOUDSQL_INSTANCE: p4-develop-k8s @@ -94,10 +93,11 @@ commands: steps: - setup_remote_docker: docker_layer_caching: true + - checkout: + path: /home/circleci/checkout/planet4-master-theme - run: name: Build - Configure command: | - activate-gcloud-account.sh mkdir -p /tmp/workspace/var mkdir -p /tmp/workspace/src echo "${CIRCLE_BUILD_NUM}" > /tmp/workspace/var/circle-build-num @@ -105,12 +105,19 @@ commands: name: Build - Build containers working_directory: /home/circleci command: | - echo "Master theme branch is ${CIRCLE_BRANCH}" - MASTER_THEME_BRANCH=dev-${CIRCLE_BRANCH} \ + if [ -n "$CIRCLE_PR_NUMBER" ]; then + BRANCH=contrib + git --git-dir=/home/circleci/checkout/planet4-master-theme/.git checkout -b contrib + echo "Using tmp branch contrib for fork PR $CIRCLE_PR_NUMBER" + else + BRANCH="${CIRCLE_BRANCH}" + echo "Master theme branch is ${CIRCLE_BRANCH}" + fi + MASTER_THEME_BRANCH=dev-${BRANCH}#${CIRCLE_SHA1} \ PLUGIN_GUTENBERG_BLOCKS_BRANCH=dev-master \ MERGE_SOURCE=git@github.com:greenpeace/planet4-base-fork.git \ MERGE_REF=develop \ - make + make ci - run: name: Test - Clone planet4-docker-compose command: |