-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcircle.yml
More file actions
52 lines (42 loc) · 1.85 KB
/
circle.yml
File metadata and controls
52 lines (42 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
---
dependencies:
override:
# Shellcheck
- sudo apt-add-repository 'deb http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe'
- sudo apt-get -y update
- sudo apt-get -y install shellcheck
# Vagrant & vagrant-digitalocean plugin
- wget https://releases.hashicorp.com/vagrant/1.9.1/vagrant_1.9.1_x86_64.deb
- sudo dpkg -i vagrant_1.9.1_x86_64.deb
- vagrant plugin install vagrant-digitalocean
# https://github.com/adrienverge/yamllint
- sudo pip install yamllint
# DigitalOcean cli
- wget https://github.com/digitalocean/doctl/releases/download/v1.5.0/doctl-1.5.0-linux-amd64.tar.gz
- tar -xf doctl-1.5.0-linux-amd64.tar.gz
- sudo mv doctl /usr/local/bin
# configure DO token
- |
echo "access-token: $DO_TOKEN" > config.yaml
- install -D -m 0600 config.yaml ~/.config/doctl/config.yaml
test:
override:
# provision scripts
- shellcheck ./scripts/*.sh || true
- shellcheck ./guestfiles/*.sh || true
# proxy cli scripts
- find ./guestfiles/proxy_cli -type f -exec grep -l '^#!/usr/bin/env bash$' {} \; ! -name "*.*" | xargs shellcheck || true
# YAML files
- find . -type f \( -name "*.yml" -or -name "*.yaml" \) -exec yamllint {} \; || true
## DigitalOcean Deployment test
# Generate keypair if one doesn't exist.
- echo -e 'n\n' | ssh-keygen -f ~/.ssh/id_rsa -N ''
# Add DO token for vagrant to use
- sed -i "s/your_token/$DO_TOKEN/" settings.yml
# Set ssh_key_name to empty so vagrant uses the value in id_rsa e.g. user@box1
- sed -i "s/vagrant_do_key//" Vagrantfile
- vagrant up --provider=digital_ocean
- vagrant destroy -f
# Remove our temporary key from DO.
# doctl will read our DO token from ~/.config/doctl/config.yaml
- doctl compute ssh-key delete $(ssh-keygen -lf ~/.ssh/id_rsa | cut -f 2 -d ' ')