From f171cef76c8e91d09214311024a781af5a96b616 Mon Sep 17 00:00:00 2001 From: "Mark J. Becker" Date: Fri, 11 Sep 2020 14:23:28 +0200 Subject: [PATCH 1/6] CIF-1625 - Add CIF components as snapshot dependency --- .circleci/config.yml | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 71ba1c76..de94647c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -39,6 +39,19 @@ common: username: $DOCKER_USER password: $DOCKER_PASS + install_components: &install_components + run: + name: Install CIF Components + command: | + if [[ "$CIRCLE_BRANCH" != "" && "$CIRCLE_BRANCH" != "main" ]]; then + git clone --depth 1 https://github.com/adobe/aem-core-cif-components.git + cd aem-core-cif-components + mvn -B clean install + cd react-components + npm link + fi + working_directory: ./dependencies + jobs: build: executor: cif_executor @@ -54,12 +67,17 @@ jobs: - run: name: Update permissions command: sudo chown -R circleci /usr/local/lib/node_modules + - *install_components - run: name: Build command: | java -version mvn -v - mvn -B clean install + if [[ "$CIRCLE_BRANCH" != "" && "$CIRCLE_BRANCH" != "main" ]]; then + mvn -B clean install -Pcloud,fedDev + else + mvn -B clean install + fi - save_cache: paths: - ~/.m2 @@ -89,12 +107,17 @@ jobs: - run: name: Update permissions command: sudo chown -R circleci /usr/local/lib/node_modules + - *install_components - run: name: Build command: | java -version mvn -v - mvn -B clean install -Pclassic + if [[ "$CIRCLE_BRANCH" != "" && "$CIRCLE_BRANCH" != "main" ]]; then + mvn -B clean install -Pclassic,fedDev + else + mvn -B clean install -Pclassic + fi - save_cache: paths: - ~/.m2 From 744455e655c59cfe142b84dc879947729b6e702c Mon Sep 17 00:00:00 2001 From: "Mark J. Becker" Date: Fri, 11 Sep 2020 14:36:41 +0200 Subject: [PATCH 2/6] CIF-1625 - Ignore coverage of CIF components --- .github/codecov.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/codecov.yml b/.github/codecov.yml index cc5e0ff7..26e6b453 100644 --- a/.github/codecov.yml +++ b/.github/codecov.yml @@ -20,3 +20,5 @@ flags: unittests: paths: - core/ +ignore: + - "dependencies" From 690b80c865359a1ba9346b9b4553547db4e1cc4f Mon Sep 17 00:00:00 2001 From: "Mark J. Becker" Date: Fri, 11 Sep 2020 14:48:18 +0200 Subject: [PATCH 3/6] CIF-1625 - Update README --- .github/codecov.yml | 6 ++++-- README.md | 7 +++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/codecov.yml b/.github/codecov.yml index 26e6b453..7799c8f4 100644 --- a/.github/codecov.yml +++ b/.github/codecov.yml @@ -7,7 +7,8 @@ coverage: target: 80% threshold: 10% base: auto - flags: unittests + flags: + - unittests patch: default: off unittests: @@ -15,7 +16,8 @@ coverage: target: 80% threshold: 10% base: auto - flags: unittests + flags: + - unittests flags: unittests: paths: diff --git a/README.md b/README.md index f604019e..67434bd8 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,11 @@ The CIF Core Components and the CIF Connector connect to a Magento (or alternati The project deployment can be done via Cloud Manager or AEM package install. For project build and deployment use the `classic` profile, see steps below. +## Branching Strategy +This project uses a `dev` branch for the development cycle between releases. On `dev` there can be dependencies to snapshot versions of the CIF Core components project. CircleCI will provide the snapshot dependencies including the `react-components` package on all branches except `main`. + +After a release of the required dependencies, all dependencies have to be updated to release versions and the current state of the `dev` branch is merged to `main`. All releases of this project will be done from the `main` branch. This guarantees that the state on `main` can always be built and installed as-is. + ## Modules The main parts of the template are: @@ -164,6 +169,8 @@ The Venia demo is ony released on Github but not on Maven Central like other pro `mvn release:prepare release:clean -Prelease-prepare` +Releases must be done on the `main` branch. + ## Contributing Contributions are welcomed! Read the [Contributing Guide](.github/CONTRIBUTING.md) for more information. From 32ab4106cf9a2d8531a3489701f1bba0a673a89c Mon Sep 17 00:00:00 2001 From: "Mark J. Becker" Date: Fri, 11 Sep 2020 15:48:31 +0200 Subject: [PATCH 4/6] CIF-1625 - Checkout branch of components project with same name --- .circleci/config.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index de94647c..0cf6b034 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -46,6 +46,10 @@ common: if [[ "$CIRCLE_BRANCH" != "" && "$CIRCLE_BRANCH" != "main" ]]; then git clone --depth 1 https://github.com/adobe/aem-core-cif-components.git cd aem-core-cif-components + components_branch=$(git ls-remote --heads origin ${CIRCLE_BRANCH}) + if [[ ! -z ${components_branch} ]]; then + git checkout $CIRCLE_BRANCH + fi mvn -B clean install cd react-components npm link From 71a705fc2080df540f2483c5b92ee0081278afb1 Mon Sep 17 00:00:00 2001 From: "Mark J. Becker" Date: Fri, 11 Sep 2020 16:14:59 +0200 Subject: [PATCH 5/6] CIF-1625 - Checkout branch of components project with same name --- .circleci/config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0cf6b034..13cd145a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -48,7 +48,8 @@ common: cd aem-core-cif-components components_branch=$(git ls-remote --heads origin ${CIRCLE_BRANCH}) if [[ ! -z ${components_branch} ]]; then - git checkout $CIRCLE_BRANCH + git fetch + git checkout $CIRCLE_BRANCH fi mvn -B clean install cd react-components From 29738248baa649cfba0282f0c3dd2dee97ceabe7 Mon Sep 17 00:00:00 2001 From: "Mark J. Becker" Date: Fri, 11 Sep 2020 16:26:40 +0200 Subject: [PATCH 6/6] CIF-1625 - Checkout branch of components project with same name --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 13cd145a..b5fa16a8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -44,7 +44,7 @@ common: name: Install CIF Components command: | if [[ "$CIRCLE_BRANCH" != "" && "$CIRCLE_BRANCH" != "main" ]]; then - git clone --depth 1 https://github.com/adobe/aem-core-cif-components.git + git clone https://github.com/adobe/aem-core-cif-components.git cd aem-core-cif-components components_branch=$(git ls-remote --heads origin ${CIRCLE_BRANCH}) if [[ ! -z ${components_branch} ]]; then