3. Project opinions
Prev |  | Next

# 3. Project opinions

In this section we will go through the assumptions we’ve made in the project structure and project properties.

## 3.1 Cloud Foundry project opinions

We’ve taken the following opinionated decisions for a Cloud Foundry based project:

- application built using Maven or Gradle wrappers
- application deployment to Cloud Foundry

- For Maven (example project):

  - usage of Maven Wrapper

  - `settings.xml` is parametrized to pass the credentials to push code to Artifactory

    - `M2_SETTINGS_REPO_ID` - server id for Artifactory / Nexus deployment
    - `M2_SETTINGS_REPO_USERNAME` - username for Artifactory / Nexus deployment
    - `M2_SETTINGS_REPO_PASSWORD` - password for Artifactory / Nexus deployment
  - artifacts deployment by `./mvnw clean deploy`
  - `stubrunner.ids` property to retrieve list of collaborators for which stubs should be downloaded
  - `repo.with.binaries` property - (Injected by the pipeline) will contain the URL to the repo containing binaries (e.g. Artifactory)
  - `distribution.management.release.id` property - (Injected by the pipeline) ID of the distribution management. Corresponds to server id in `settings.xml`
  - `distribution.management.release.url` property - (Injected by the pipeline) Will contain the URL to the repo containing binaries (e.g. Artifactory)
  - running API compatibility tests via the `apicompatibility` Maven profile
  - `latest.production.version` property - (Injected by the pipeline) will contain the latest production version for the repo (retrieved from Git tags)
  - running smoke tests on a deployed app via the `smoke` Maven profile
  - running end to end tests on a deployed app via the `e2e` Maven profile

- For Gradle (example project check the `gradle/pipeline.gradle` file):

  - usage of Gradlew Wrapper
  - `deploy` task for artifacts deployment
  - `REPO_WITH_BINARIES` env var - (Injected by the pipeline) will contain the URL to the repo containing binaries (e.g. Artifactory)
  - `M2_SETTINGS_REPO_USERNAME` env var - Username used to send the binary to the repo containing binaries (e.g. Artifactory)
  - `M2_SETTINGS_REPO_PASSWORD` env var - Password used to send the binary to the repo containing binaries (e.g. Artifactory)
  - running API compatibility tests via the `apiCompatibility` task
  - `latestProductionVersion` property - (Injected by the pipeline) will contain the latest production version for the repo (retrieved from Git tags)
  - running smoke tests on a deployed app via the `smoke` task
  - running end to end tests on a deployed app via the `e2e` task
  - `groupId` task to retrieve group id
  - `artifactId` task to retrieve artifact id
  - `currentVersion` task to retrieve the current version
  - `stubIds` task to retrieve list of collaborators for which stubs should be downloaded

## 3.2 Kubernetes project opinions

We’ve taken the following opinionated decisions for a Cloud Foundry based project:

- application built using Maven or Gradle wrappers
- application deployment to Kubernetes
- The produced Java Docker image needs to allow passing of system properties via `SYSTEM_PROPS` env variable

- For Maven (example project):

  - usage of Maven Wrapper

  - `settings.xml` is parametrized to pass the credentials to push code to Artifactory and Docker repository

    - `M2_SETTINGS_REPO_ID` - server id for Artifactory / Nexus deployment
    - `M2_SETTINGS_REPO_USERNAME` - username for Artifactory / Nexus deployment
    - `M2_SETTINGS_REPO_PASSWORD` - password for Artifactory / Nexus deployment
    - `DOCKER_SERVER_ID` - server id for Docker image pushing
    - `DOCKER_USERNAME` - username for Docker image pushing
    - `DOCKER_PASSWORD` - password for Docker image pushing
    - `DOCKER_EMAIL` - email for Artifactory / Nexus deployment
  - `DOCKER_REGISTRY_URL` env var - (Overridable - defaults to DockerHub) URL of the Docker registry
  - `DOCKER_REGISTRY_ORGANIZATION` - env var containing the organization where your Docker repo lays
  - artifacts and Docker image deployment by `./mvnw clean deploy`
  - `stubrunner.ids` property to retrieve list of collaborators for which stubs should be downloaded
  - `repo.with.binaries` property - (Injected by the pipeline) will contain the URL to the repo containing binaries (e.g. Artifactory)
  - `distribution.management.release.id` property - (Injected by the pipeline) ID of the distribution management. Corresponds to server id in `settings.xml`
  - `distribution.management.release.url` property - (Injected by the pipeline) Will contain the URL to the repo containing binaries (e.g. Artifactory)
  - `deployment.yml` contains the Kubernetes deployment descriptor
  - `service.yml` contains the Kubernetes service descriptor
  - running API compatibility tests via the `apicompatibility` Maven profile
  - `latest.production.version` property - (Injected by the pipeline) will contain the latest production version for the repo (retrieved from Git tags)
  - running smoke tests on a deployed app via the `smoke` Maven profile
  - running end to end tests on a deployed app via the `e2e` Maven profile

- For Gradle (example project check the `gradle/pipeline.gradle` file):

  - usage of Gradlew Wrapper
  - `deploy` task for artifacts deployment
  - `REPO_WITH_BINARIES` env var - (Injected by the pipeline) will contain the URL to the repo containing binaries (e.g. Artifactory)
  - `M2_SETTINGS_REPO_USERNAME` env var - Username used to send the binary to the repo containing binaries (e.g. Artifactory)
  - `M2_SETTINGS_REPO_PASSWORD` env var - Password used to send the binary to the repo containing binaries (e.g. Artifactory)
  - `DOCKER_REGISTRY_URL` env var - (Overridable - defaults to DockerHub) URL of the Docker registry
  - `DOCKER_USERNAME` env var - Username used to send the the Docker image
  - `DOCKER_PASSWORD` env var - Password used to send the the Docker image
  - `DOCKER_EMAIL` env var - Email used to send the the Docker image
  - `DOCKER_REGISTRY_ORGANIZATION` - env var containing the organization where your Docker repo lays
  - `deployment.yml` contains the Kubernetes deployment descriptor
  - `service.yml` contains the Kubernetes service descriptor
  - running API compatibility tests via the `apiCompatibility` task
  - `latestProductionVersion` property - (Injected by the pipeline) will contain the latest production version for the repo (retrieved from Git tags)
  - running smoke tests on a deployed app via the `smoke` task
  - running end to end tests on a deployed app via the `e2e` task
  - `groupId` task to retrieve group id
  - `artifactId` task to retrieve artifact id
  - `currentVersion` task to retrieve the current version
  - `stubIds` task to retrieve list of collaborators for which stubs should be downloaded

Prev |  | Next
2. Opinionated implementation | Home | 4. Concourse Pipeline (Cloud Foundry)