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
driver: | |
name: docker | |
use_sudo: false | |
privileged: true | |
provisioner: | |
name: chef_solo | |
always_update_cookbooks: true | |
verifier: |
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
describe service('docker') do | |
it { should be_running } | |
end | |
describe command('docker version') do | |
its(:stdout) { should match(/Client/) } | |
its(:stdout) { should match(/Server/) } | |
end | |
describe port(80) do |
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
require 'spec_helper' | |
describe 'techtalk::default' do | |
context 'When applying cookbooks on an Ubuntu instance' do | |
let(:chef_run) do | |
runner = ChefSpec::SoloRunner.new(platform: 'ubuntu', version: '16.04') | |
runner.converge(described_recipe) | |
end | |
it 'install docker' do |
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
execute 'install docker' do | |
command 'curl -sSL https://get.docker.com/ | sh' | |
end | |
execute 'restart docker service' do | |
command 'sudo service docker restart' | |
end | |
execute 'run application container' do | |
command 'docker run -d -p 80:3000 --restart=always nandotorres/mean-todo' |
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
name 'techtalk' | |
maintainer 'The Authors' | |
maintainer_email 'you@example.com' | |
license 'all_rights' | |
description 'Installs/Configures techtalk' | |
long_description 'Installs/Configures techtalk' | |
version '0.1.0' | |
# If you upload to Supermarket you should set this so your cookbook | |
# gets a `View Issues` link |
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
source 'https://rubygems.org' | |
gem 'foodcritic' | |
gem 'rubocop' | |
gem 'kitchen-docker' |
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
#!/bin/bash | |
KEY_NAME=$1 | |
PEM_NAME="${KEY_NAME}-key.pem" | |
CERTIFICATE_NAME="${KEY_NAME}-certificate.pem" | |
openssl genrsa 2048 > $PEM_NAME | |
openssl req -new -x509 -nodes -sha1 -days 365 -key $PEM_NAME -outform PEM > $CERTIFICATE_NAME |
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
{ | |
"variables": { | |
"aws_access_key_id": "{{env `AWS_ACCESS_KEY_ID` }}", | |
"aws_secret_key": "{{env `AWS_SECRET_ACCESS_KEY` }}", | |
"aws_region": "{{env `AWS_REGION` }}", | |
"ebs_optimized": "{{env `AMI_EBS_OPTIMIZED` }}", | |
"source_ami": "{{env `AWS_SOURCE_AMI` }}", | |
"instance_type": "{{env `AMI_INSTANCE_TYPE` }}", | |
"associate_public_ip_address": "{{env `AMI_ASSOCIATE_PUBLIC_IP_ADDRESS` }}", | |
"vpc_id": "{{env `AMI_VPC_ID` }}", |
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
#!/bin/bash | |
rm -rf vendor/* | |
# Group all recipes and cookbooks for provisioning | |
chef exec berks vendor vendor/cookbooks | |
chef exec berks install | |
########################################################## | |
# Deregister any existing image for this commit revision | |
# Note: $CI_BUILD_REF is authomatically exported by GitLab |
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
stages: | |
- quality | |
- unitTests | |
- compliance | |
- build | |
- deploy | |
rubocop: | |
stage: quality | |
script: |
OlderNewer