15. Building the project
Prev |  | Next

# 15. Building the project

## 15.1 Prerequisites

As prerequisites you need to have shellcheck, bats, jq and ruby installed. If you’re on a Linux machine then `bats` and `shellcheck` will be installed for you.

To install the required software on Linux just type the following commands

    $ sudo apt-get install -y ruby jq

If you’re on a Mac then just execute these commands to install the missing software

    $ brew install jq
    $ brew install ruby
    $ brew install bats
    $ brew install shellcheck

## 15.2 Bats submodules

To make `bats` work properly we needed to attach Git submodules. To have them initialized either clone with appropriate command

    $ git clone --recursive https://github.com/spring-cloud/spring-cloud-pipelines.git

or if you have already cloned the project and are just pulling changes

    $ git submodule init
    $ git submodule update

If you forget about this step, then Gradle will execute these steps for you.

## 15.3 Build and test

Once you have installed all the prerequisites you can execute

    $ ./gradlew clean build

to build and test the project.

## 15.4 Generate docs

To generate docs just run

    $ ./gradlew generateDocs

## 15.5 Distributions

Spring Cloud Pipelines has a lot of tests, including Git repositories. Those and the documentation weigh a lot. That’s why under the `dist` folder we publish `zip` and `tar.gz` distributions of sources without tests and documentation. Whenever we release a distribution we attach a `VERSION` file to it that contains build and SCM information (e.g. build time, revision). To skip the distribution generation just pass the `skipDist` property

    $ ./gradlew build -PskipDist

## 15.6 Making a release

It’s enough to execute the `release` task that will automatically test the project, build the distributions, change the versions, build the docs, upload them to Spring Cloud Static, tag the repo and then revert the changed versions back to default.

    $ ./gradlew release -PnewVersion=1.0.0.RELEASE

Prev |  | Next
14. Step-by-step Cloud Foundry migration | Home | 16. Customizing the project