forked from harness/harness
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3dd218b
commit 3c8c330
Showing
10 changed files
with
191 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
* [Install](index.md) | ||
* [Local Builds](builds.md) | ||
* [Encrypt Secrets](secrets.md) | ||
* [Add Machines](machines.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Local Builds | ||
|
||
The `exec` command lets you run a build on your personal machine (ie your laptop). It does not involve the Drone server in any way. This is very useful for local testing and troubleshooting. | ||
|
||
## Instructions | ||
|
||
The `drone exec` command should be executed from the root of your repository, where the `.drone.yml` file is located: | ||
|
||
``` | ||
cd octocat/hello-world | ||
drone exec | ||
``` | ||
|
||
This only executes a `build` step. It does not execute `clone`, `publish`, `deploy`, or `notify` steps, nor will it decrypt your `.drone.sec` file. | ||
|
||
## Arguments | ||
|
||
The `exec` command accepts the following arguments: | ||
|
||
* `DOCKER_HOST` - docker deamon address. defaults to `unix:///var/run/docker.sock` | ||
* `DOCKER_TLS_VERIFY` - docker daemon supports tlsverify | ||
* `DOCKER_CERT_PATH` - docker certificate directory | ||
|
||
|
||
## Boot2Docker | ||
|
||
You may use the `drone exec` command with boot2docker as long as your code exists within your `$HOME` directory. This is because boot2docker mounts your home directory into the virtualbox instance giving the Docker daemon access to your local files. | ||
|
||
## Known Issues | ||
|
||
Attempting to cancel (`ctrl+C`) a running build will leave behind orphan containers. This is a known issue and we are planning a fix. | ||
|
||
## Limitations | ||
|
||
You cannot use `drone exec` with a remote Docker instance. Your local codebase is shared via a volume with the Docker daemon, which is not possible when communicating with a remote Docker host on a different machine. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Install | ||
|
||
> This is an early preview of the command line utility. Contributors wanted. | ||
Drone provides a simple command line utility that allows you interact with the Drone server from the command line. This section describes the setup and installation process. | ||
|
||
## System Requirements | ||
|
||
This tool requires Docker 1.6 or higher. If you are using Windows or Mac we recommend installing the [Docker Toolbox](https://www.docker.com/docker-toolbox). | ||
|
||
## Linux | ||
|
||
Download and install the x64 linux binary: | ||
|
||
``` | ||
curl http://downloads.drone.io/drone-cli/drone_linux_amd64.tar.gz | tar zx | ||
sudo install -t /usr/local/bin drone | ||
``` | ||
|
||
## OSX | ||
|
||
Download and install using Homebrew: | ||
|
||
``` | ||
brew tap drone/drone | ||
brew install drone | ||
``` | ||
|
||
Or manually download and install the binary: | ||
|
||
``` | ||
curl http://downloads.drone.io/drone-cli/drone_darwin_amd64.tar.gz | tar zx | ||
sudo cp drone /usr/local/bin | ||
``` | ||
|
||
## Setup | ||
|
||
In order to communicate with the Drone server you must provide the server url: | ||
|
||
``` | ||
export DRONE_SERVER=<http://> | ||
``` | ||
|
||
In order to authorize communications you must also provide your access token: | ||
|
||
``` | ||
export DRONE_SERVER=<token> | ||
``` | ||
|
||
You can retrieve your access token from the user profile screen in Drone. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Machine Management | ||
|
||
The `drone node create` command lets your register new remote servers with Drone. This command should be used in conjunction with [docker-machine](https://github.com/docker/machine). Note that you can alternatively register and manage servers in the UI. | ||
|
||
## Environment Variables | ||
|
||
The `drone node create` command expects the following environment variables: | ||
|
||
* `DOCKER_HOST` - docker deamon address | ||
* `DOCKER_TLS_VERIFY` - docker daemon supports tlsverify | ||
* `DOCKER_CERT_PATH` - docker certificate directory | ||
|
||
## Instructions | ||
|
||
Create or configure a new server using `docker-machine`: | ||
|
||
``` | ||
docker-machine create \ | ||
--digitalocean-size 2gb \ | ||
--driver digitalocean \ | ||
--digitalocean-access-token <token> \ | ||
my-drone-worker | ||
``` | ||
|
||
This writes setup instructions to the console: | ||
|
||
``` | ||
export DOCKER_TLS_VERIFY="1" | ||
export DOCKER_HOST="tcp://123.456.789.10:2376" | ||
export DOCKER_CERT_PATH="/home/octocat/.docker/machine/machines/my-drone-worker" | ||
export DOCKER_MACHINE_NAME="my-drone-worker" | ||
# Run this command to configure your shell: | ||
# eval "$(docker-machine env my-drone-worker)" | ||
``` | ||
|
||
Run the following command (from the above output) to configure your shell: | ||
|
||
``` | ||
eval "$(docker-machine env my-drone-worker)" | ||
``` | ||
|
||
Register the newly created or configured machine with Drone. Once registered, Drone will immediately begin sending builds to the server. | ||
|
||
``` | ||
drone node create | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Overview | ||
|
||
> Coming Soon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Encrypt Secrets | ||
|
||
The `secure` command lets your create a signed and encrypted `.drone.sec` file. The `.drone.sec` file is decrypted at runtime and will inject your secrets into your `.drone.yml` file. | ||
|
||
## Usage | ||
|
||
Create a plaintext `.drone.sec.yml` file that contains your secret variables: | ||
|
||
``` | ||
environment: | ||
- PASSWORD=foo | ||
``` | ||
|
||
Encrypt and generate the `.drone.sec` file: | ||
|
||
``` | ||
drone secure --repo octocat/hello-world | ||
``` | ||
|
||
Commit the encrypted `.drone.sec` file to your repository. | ||
|
||
Note the `drone secure` command will automatically calculate the shasum of your yaml file and store in the `.drone.sec` file. This prevent secrets from being injected into the build if the Yaml changes. | ||
|
||
|
||
## Arguments | ||
|
||
The `secure` command accepts the following arguments: | ||
|
||
* `--in` secrets in plain text yaml. defaults to `.drone.sec.yml` | ||
* `--out` encrypted secret file. defaults to `.drone.sec` | ||
* `--yaml` location of your `.drone.yml` file. defaults to `.drone.yml` | ||
* `--repo` name of your repository **required** | ||
|
||
|
||
## Shared Secrets | ||
|
||
You cannot re-use the same `.drone.sec` for multiple repositories. You can, however, use the same plaintext secret file for multiple repositories. | ||
|
||
``` | ||
cd octocat/hello-world | ||
drone secure --in $HOME/.drone.sec.yml --repo octocat/hello-world | ||
cd octocat/Spoon-Knife | ||
drone secure --in $HOME/.drone.sec.yml --repo octocat/Spoon-Knife | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters