This repo contains the definition of the infrastructure used for dotty's CI, based Drone >= 1.0.0.
Docker version 17.06 or higher and Docker Compose must be installed.
Docker Compose is a tool for defining and running multi-container Docker applications. To learn more about Compose refer to the documentation.
We use a multi-machine drone setup where lampsrv43 acts as master (= drone-server) and lampsrv9 and lampsrv26 as runners (= drone-agent).
The environment is defined by the drone-server and drone-agent docker-compose definition files.
On the central 'master' drone server:
$ docker-compose --file /etc/drone/drone-server.yml up --force-recreate -d
On any drone agent:
$ docker-compose --file /etc/drone/drone-agents.yml up --force-recreate -d
--file
sets the path of the docker-compose definition file.--force-recreate
recreates containers even if their configuration and image haven't changed.-d
runs containers in the background and prints new container names.
A Makefile is provided for your convenience.
Agents:
The Dotty repo contains a .drone.yml file that contains the necessary settings for drone to run the CI.
The repo is then activated via the UI on http://dotty-ci.epfl.ch or from the commandline using:
$ drone repo add lampepfl/dotty
Installation instructions for the drone command.
Drone provides the ability to store sensitive information such as passwords.
Secrets are loaded as environment variables. For example the secret named sonatype_user
can be
accessed via "$SONATYPE_USER"
. Use lower case to name your secrets and upper case to access their
value.
You can add secrets to a build via the UI on http://dotty-ci.epfl.ch or from the command line using:
$ drone secret add --repository=lampepfl/dotty --name=<name> --value=<value>
This docker image is set up in order to run the tests for Dotty. It is currently pushed to lampepfl/dotty on Docker hub.
To build the image, simply:
$ cd dotty-docker
$ docker build --no-cache -t lampepfl/dotty:$(date +%F) .
$ docker login
$ docker push lampepfl/dotty:$(date +%F)
The new image should now appear in https://hub.docker.com/r/lampepfl/dotty/tags/. The next step is to open a PR againts https://github.com/lampepfl/dotty to change the tag of the docker image in .drone.yml.
This docker image is set up in order to run the CI for courses given at EPFL with Dotty. It is currently pushed to lampepfl/moocs-dotty on Docker hub.
To build the image, you'll need Docker >= 18.09 and access to the lampepfl/moocs repository:
$ cd moocs-docker
# Make an unencrypted copy of your private key to clone the private moocs repository
$ openssl rsa -in ~/.ssh/id_rsa -out ssl.key
# Build the image using --secret to make sure your private key is not saved in the image
$ DOCKER_BUILDKIT=1 docker build --no-cache --secret id=sshkey,src=ssl.key -t lampepfl/moocs-dotty:$(date +%F) .
# Delete the unencrypted copy of your private key
$ rm ssl.key
$ docker login
$ docker push lampepfl/moocs-dotty:$(date +%F)