This file contains hidden or 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
| sudo: false | |
| language: ruby | |
| rvm: | |
| - 2.2.1 | |
| before_install: | |
| - openssl aes-256-cbc -K $encrypted_a1a5bb03449b_key -iv $encrypted_a1a5bb03449b_iv -in travis.pem.enc -out travis.pem -d | |
| - chmod 600 ./travis.pem | |
| after_success: | |
| - ssh [email protected] -i ./travis.pem -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no /var/www/ruby_hw/update.sh |
This file contains hidden or 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 './hw' | |
| run Sinatra::Application |
This file contains hidden or 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 'rspec/core' | |
| require 'rspec/core/rake_task' | |
| task :default => :spec | |
| desc "Run our Spec" | |
| RSpec::Core::RakeTask.new(:spec) |
This file contains hidden or 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
| # spec/hw_spec.rb | |
| require File.expand_path '../spec_helper.rb', __FILE__ | |
| describe "My Sinatra Application" do | |
| it "expect accessing the home page to be successful" do | |
| get '/' | |
| expect(last_response).to be_ok | |
| end | |
| end |
This file contains hidden or 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 | |
| cd /var/www/ruby_hw | |
| git pull | |
| mkdir /var/www/ruby_hw/tmp | |
| touch /var/www/ruby_hw/tmp/restart.txt |
This file contains hidden or 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
| #provider "openstack" { | |
| # user_name = "admin" | |
| # tenant_name = "admin" | |
| # password = "pwd" | |
| # auth_url = "http://myauthurl:5000/v2.0" | |
| #} | |
| resource "openstack_compute_instance_v2" "ruby-hw" { | |
| name = "ruby-hw.opsits.com" | |
| image_id = "7f85f7b3-eb20-4bef-8bad-bb3583a9a2fd" |
This file contains hidden or 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: Get project from git | |
| git: clone=yes dest=/var/www/ruby_hw repo=https://github.com/rstarmer/ruby_hw version=travisci | |
| - name: Ensure .ssh director for web user | |
| file: state=directory owner=web recurse=yes path=/home/web/.ssh mode=0700 | |
| - name: Add ssh public key for travis-CI deployment | |
| shell: cat /var/www/ruby_hw/travis.pub >> /home/web/.ssh/authorized_keys | |
| - name: Ensure authroized_keys for web user |
This file contains hidden or 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 describes the network interfaces available on your system | |
| # and how to activate them. For more information, see interfaces(5). | |
| source /etc/network/interfaces.d/* | |
| # The loopback network interface | |
| auto lo | |
| iface lo inet loopback | |
| # The primary network interface |
This file contains hidden or 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 | |
| curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - | |
| cat <<EOF > /etc/apt/sources.list.d/kubernetes.list | |
| deb http://apt.kubernetes.io/ kubernetes-xenial main | |
| EOF | |
| apt-get update | |
| apt-get dist-upgrade -y | |
| apt-get install -y docker.io | |
| apt-get install -y kubelet kubeadm kubectl kubernetes-cni |
This file contains hidden or 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 | |
| # | |
| # This script is meant to be run once after running start for the first | |
| # time. This script downloads a cirros image and registers it. Then it | |
| # configures networking and nova quotas to allow 40 m1.small instances | |
| # to be created. | |
| IMAGE_URL=https://cloud-images.ubuntu.com/trusty/current/ | |
| IMAGE=trusty-server-cloudimg-amd64-disk1.img | |
| IMAGE_NAME=Ubuntu1404 |