commit 95171adaf717aa5e0f8f95fcf42e35dc5013c65b Author: Denise Date: Thu Jan 28 14:12:36 2016 -0800 Initial Home page diff --git a/How-to-set-up-RancherOS-CI.md b/How-to-set-up-RancherOS-CI.md new file mode 100644 index 0000000..c2ed8a6 --- /dev/null +++ b/How-to-set-up-RancherOS-CI.md @@ -0,0 +1,68 @@ +# CI Setup Instructions + +## Prerequisites + +* Docker 1.9.1 on the CI server +* Docker-compose v1.5.2 +* CI server requires KVM, which means it needs to be a bare metal server + +## Installation + +### GitHub Developer Application + +For your CI server, create a [new developer application on GitHub](https://github.com/settings/developers). Click on **Register new application**. + +Fill in the following fields. In our example, the CI server's address is `ci.example.com`: + +* Application name: `RancherOS Drone` +* Homepage URL: `http://ci.example.com/` +* Authorization callback URL: `http://ci.example.com/authorize` + +Click on **Register Application.** + +After the application has been created, note the values for **Client ID** and **Client Secret**. + +### Docker Compose Template for Drone + +drone.yml + +```yml +drone: + image: drone/drone:0.4 + container_name: drone + volumes: + - /var/lib/drone:/var/lib/drone + - /var/run/docker.sock:/var/run/docker.sock + restart: always + ports: + - 80:8000 + environment: + - REMOTE_DRIVER=github + - REMOTE_CONFIG=https://github.com?client_id=&client_secret= +``` + +In the docker-compose.yml, replace the `` and `` with the **Client ID** and **Client Secret** values from your newly registered GitHub developer application. + +### Drone Container + +Start the container using docker-compose. + +``` +$ docker-compose -f ./drone.yml up -d --force-recreate +``` + +When the container is running, go to `http://ci.example.com/` in your browser to check if the Drone web app is up. + +If everything is OK, you should be redirected to `http://ci.example.com/login` which is a page from which you can log in with your GitHub account. + +### OS Repo Configuration + +Once you've logged into Github, it will provide your list of repos. The `rancher/os` repo already has `.drone.yml` file (in the source code) which tells Drone what to do to run the build, so if you've forked from `rancher/os`, your personal `os` repo will also contain this file. + +You will need to activate the `os` repo for CI and you will need to have admin privileges on it. Click on the `os` in the list on the Drone homepage. Click on **Activate Now**. + +After Drone has been activated, go to the **Settings** tab in the page. You automatically placed in the **Builds** tab. Enable "Trusted" in order to use the docker daemon on the server. + +Anytime you push t the repo, drone will launch the instructions in the `.drone.yml` in the `os` repo. + +Refer to Drone documentation for more details: http://readme.drone.io/setup/overview/ \ No newline at end of file