Pluto
===

## Setup

WRITEME

## CI

Currently CI is being handled by TeamCity. The CI runners should have Java, Node 10 (or newer) and Docker installed. No extra plugins are required (for now), although you'll have to set up the build manually because TeamCity doesn't really let you store config as a file the way other CI services allow you to.

## CI - Old

Currently the following software is required when using this with CI:

1. Java 8
2. Node.js 10 (or newer)
3. Docker
4. Jenkins

Required Jenkins plugins:

1. [Job cacher](https://plugins.jenkins.io/jobcacher)
2. [Workspace cleanup plugin](https://plugins.jenkins.io/ws-cleanup)

Recommended Jenkins plugins:

1. [Artifact manager on S3](https://plugins.jenkins.io/artifact-manager-s3) to store build artifacts in S3
2. [Parameterized scheduler](https://plugins.jenkins.io/parameterized-scheduler) to run the build at specific times with specific parameters.
3. [Github plugin](https://plugins.jenkins.io/github) for webhook trigger functionality. As of writing there appears to be a [bug in this plugin](https://issues.jenkins-ci.org/browse/JENKINS-41377) when using the webhook trigger with Pipeline projects (which this project is set up to be) not being triggered properly. If this happens, please create a separate `freestyle project` which triggers this project when the webhook is received.

If not running in an isolated environment, it's recommended to set up a cronjob that cleans out all of the involved caches periodically. As an example -

```cron
0 3 * * * ( echo "=== Initiated cleanup at $(date)" ; docker rmi pluto_docker ; docker system prune -f ; rm -rvf /var/lib/jenkins/.gradle ) >> /var/log/cleanup.log
```

Note that it might not be a good idea to do a docker system prune if you're running other things on the same system.

In project options you can also set up a periodical task (you'll need the [parameterized scheduler plugin](https://wiki.jenkins.io/display/JENKINS/Parameterized+Build)) that will not unpack the nodejs cache.

```cron
15 3 * * * % cron=true
```

For more information see [Jenkinsfile](Jenkinsfile) and [docker_slim](docker_slim).
