Skip to content

Commit

Permalink
CI: switch testing to DigitalOcean
Browse files Browse the repository at this point in the history
Reasons:
 - Azure does not provide any cost savings (min amount is 0,01€ - same
for DO)
 - DO has much more faster spawn times for VMS (10 secs vs 3-5 mins)
 - DO VMs are much more performant for the same costs
  • Loading branch information
artem-sidorenko committed Mar 27, 2018
1 parent 1fea019 commit 6239afc
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 77 deletions.
52 changes: 0 additions & 52 deletions .kitchen.azure.yml

This file was deleted.

37 changes: 37 additions & 0 deletions .kitchen.do.yml
@@ -0,0 +1,37 @@
# this file is used for configuration of DigitalOcean
# for integration tests in the CI
---
driver:
name: digitalocean
size: s-1vcpu-1gb
region: nyc3

transport:
ssh_key: '~/.ssh/ci_id_rsa'
max_wait_until_ready: 30

platforms:
- name: ubuntu-14-04
driver_config:
image: ubuntu-14-04-x64
- name: ubuntu-16-04
driver_config:
image: ubuntu-16-04-x64
- name: centos-6
driver_config:
image: centos-6-x64
- name: centos-7
driver_config:
image: centos-7-x64
- name: debian-7
driver_config:
image: debian-7-x64
- name: debian-8
driver_config:
image: debian-8-x64
- name: fedora-26
driver_config:
image: fedora-26-x64
- name: fedora-27
driver_config:
image: fedora-27-x64
25 changes: 7 additions & 18 deletions .travis.yml
Expand Up @@ -10,32 +10,21 @@ env:
- INSTANCE=ubuntu-16-04
- INSTANCE=centos-6
- INSTANCE=centos-7
- INSTANCE=oracle-6
- INSTANCE=oracle-7
- INSTANCE=rhel-6
- INSTANCE=rhel-7
- INSTANCE=debian-6
- INSTANCE=debian-7
- INSTANCE=opensuse-leap-42
- INSTANCE=sles-11
- INSTANCE=sles-12
- INSTANCE=debian-8
- INSTANCE=fedora-26
- INSTANCE=fedora-27

matrix:
allow_failures: # allow failues of integration tests as the forks might miss the DO token
- env: INSTANCE=ubuntu-14-04
- env: INSTANCE=ubuntu-16-04
- env: INSTANCE=centos-6
- env: INSTANCE=centos-7
- env: INSTANCE=oracle-6
- env: INSTANCE=oracle-7
- env: INSTANCE=rhel-6
- env: INSTANCE=rhel-7
- env: INSTANCE=debian-6
- env: INSTANCE=debian-7
- env: INSTANCE=opensuse-leap-42
- env: INSTANCE=sles-11
- env: INSTANCE=sles-12
- env: INSTANCE=debian-8
- env: INSTANCE=fedora-26
- env: INSTANCE=fedora-27

script:
- bundle exec rake prepare_do_env kitchen KITCHEN_LOCAL_YAML=.kitchen.azure.yml

- bundle exec rake prepare_do_env kitchen KITCHEN_LOCAL_YAML=.kitchen.do.yml
4 changes: 2 additions & 2 deletions Gemfile
Expand Up @@ -23,7 +23,7 @@ group :development do
end

group :integration do
gem 'kitchen-azurerm'
gem 'kitchen-digitalocean'
gem 'kitchen-inspec'
gem 'kitchen-puppet'
gem 'kitchen-vagrant'
Expand All @@ -33,4 +33,4 @@ end

group :tools do
gem 'github_changelog_generator', '~> 1.14'
end
end
6 changes: 1 addition & 5 deletions Rakefile
Expand Up @@ -55,8 +55,7 @@ task :prepare_do_env do
SSH_KEY_FILE = '~/.ssh/ci_id_rsa'.freeze
ENV_VAR_NAME = 'CI_SSH_KEY'.freeze

['AZURE_SUBSCRIPTION_ID', 'AZURE_CLIENT_ID', 'AZURE_CLIENT_SECRET',
'AZURE_TENANT_ID', ENV_VAR_NAME].each do |var|
['DIGITALOCEAN_ACCESS_TOKEN', 'DIGITALOCEAN_SSH_KEY_IDS', ENV_VAR_NAME].each do |var|
raise "Environment variable #{var} should be set" unless ENV[var]
end

Expand All @@ -65,7 +64,4 @@ task :prepare_do_env do
Dir.mkdir(dir, 0o700) unless Dir.exist?(dir)
File.open(ssh_file, 'w') { |f| f.puts Base64.decode64(ENV[ENV_VAR_NAME]) }
File.chmod(0o600, ssh_file)

# azure requires also a public key file, lets generate it
sh "ssh-keygen -y -f #{SSH_KEY_FILE} > #{SSH_KEY_FILE}.pub"
end

0 comments on commit 6239afc

Please sign in to comment.