|
| 1 | +== Running CI tasks locally |
| 2 | + |
| 3 | +Since Concourse is built on top of Docker, it's easy to: |
| 4 | + |
| 5 | +* Debug what went wrong on your local machine. |
| 6 | +* Test out a a tweak to your `test.sh` script before sending it out. |
| 7 | +* Experiment against a new image before submitting your pull request. |
| 8 | +
|
| 9 | +All of these use cases are great reasons to essentially run what Concourse does on your local machine. |
| 10 | + |
| 11 | +IMPORTANT: To do this you must have Docker installed on your machine. |
| 12 | + |
| 13 | +1. `docker run -it --mount type=bind,source="$(pwd)",target=/spring-data-mongodb-github springci/spring-data-8-jdk-with-mongodb /bin/bash` |
| 14 | ++ |
| 15 | +This will launch the Docker image and mount your source code at `spring-data-mongodb-github`. |
| 16 | ++ |
| 17 | +Next, run the `test.sh` script from inside the container: |
| 18 | ++ |
| 19 | +2. `PROFILE=none spring-data-mongodb-github/ci/test.sh` |
| 20 | +
|
| 21 | +Since the container is binding to your source, you can make edits from your IDE and continue to run build jobs. |
| 22 | + |
| 23 | +If you need to test the `build.sh` script, do this: |
| 24 | + |
| 25 | +1. `mkdir /tmp/spring-data-mongodb-artifactory` |
| 26 | +2. `docker run -it --mount type=bind,source="$(pwd)",target=/spring-data-mongodb-github --mount type=bind,source="/tmp/spring-data-mongodb-artifactory",target=/spring-data-mongodb-artifactory springci/spring-data-8-jdk-with-mongodb /bin/bash` |
| 27 | ++ |
| 28 | +This will launch the Docker image and mount your source code at `spring-data-mongodb-github` and the temporary |
| 29 | +artifactory output directory at `spring-data-mongodb-artifactory`. |
| 30 | ++ |
| 31 | +Next, run the `build.sh` script from inside the container: |
| 32 | ++ |
| 33 | +3. `spring-data-mongodb-github/ci/build.sh` |
| 34 | +
|
| 35 | +IMPORTANT: `build.sh` doesn't actually push to Artifactory so don't worry about accidentally deploying anything. |
| 36 | +It just deploys to a local folder. That way, the `artifactory-resource` later in the pipeline can pick up these artifacts |
| 37 | +and deliver them to artifactory. |
| 38 | + |
| 39 | +NOTE: Docker containers can eat up disk space fast! From time to time, run `docker system prune` to clean out old images. |
0 commit comments