diff --git a/.circleci/config.yml b/.circleci/config.yml index 71ba1c76..b5fa16a8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -39,6 +39,24 @@ 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 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 fetch + git checkout $CIRCLE_BRANCH + fi + mvn -B clean install + cd react-components + npm link + fi + working_directory: ./dependencies + jobs: build: executor: cif_executor @@ -54,12 +72,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 +112,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 diff --git a/.github/codecov.yml b/.github/codecov.yml index cc5e0ff7..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,8 +16,11 @@ coverage: target: 80% threshold: 10% base: auto - flags: unittests + flags: + - unittests flags: unittests: paths: - core/ +ignore: + - "dependencies" 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.