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
development: | |
secret_key_base: 39beccc6c842da3ba78f001a09dcb383bc45f927438f668392fc1ba354cd8ef487951c8ca9d6e70eab72af847ff831c3ae62888eae7a2b9c56cb5c202ea59ff1 | |
test: | |
secret_key_base: 80f167c6678b032aca5c77a6feababbf9b9bbc46820bcd574053385f7e40c0f181dc55547b4b10bbc02df74fb7f64908ef8cfd238f5f35831ae0685dfce216e1 | |
# Do not keep production secrets in the repository, | |
# instead read values from the environment. | |
production: | |
<% if Rails.env.production? # to save time, only run this when in production mode %> |
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
development: | |
clients: | |
default: | |
database: todo_dev | |
hosts: | |
- <%= ENV['DB_HOST'] || 'localhost:27017' %> | |
test: | |
clients: | |
default: | |
database: todo_test |
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
# Change the 'YOUR_AZURE_VM_IP' to the publicIpAddress from the output of | |
# `az vm create` command executed above | |
require 'json' | |
role :app, JSON.parse(`az vmss list-instance-connection-info -g level1 -n level1-vmss`) | |
# Change the YOUR_GITHUB_NAME to your github user name | |
set :repo_url, '[email protected]:devigned/level1.git' | |
set :repo_tree, 'api-ruby' | |
set :application, 'level1' | |
set :user, 'deploy' |
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
#!/usr/bin/env bash | |
# add 'x' to the set command to see verbose output from each of the statements | |
set -eu | |
group_id="level1" | |
location="westus" | |
name_prefix="level1" | |
# shellcheck disable=SC2005 | |
new_name=$(echo "$(mktemp -u ${name_prefix}XXXXX)" | tr '[:upper:]' '[:lower:]') |
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
#cloud-config | |
# Upgrade the instance on first boot | |
apt_upgrade: true | |
# Update apt database on first boot | |
apt_update: true | |
apt_sources: | |
- source: "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ wheezy main" |
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
package main | |
import ( | |
"fmt" | |
"io" | |
"net/http" | |
"os" | |
"sync" | |
"github.com/Azure/azure-sdk-for-go/arm/graphrbac" |
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
# commit all of our changes and push them to the Github | |
git add . | |
git commit -am 'my first deploy' | |
git push origin master | |
# show what keys have been added to the ssh-agent (not needed, but helpful if debugging) | |
# ssh-add -l | |
# ensure you have added the id_rsa identity to your ssh agent | |
ssh-add ~/.ssh/id_rsa |
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
upstream puma { | |
server unix:///home/deploy/apps/level0/shared/tmp/sockets/level0-puma.sock; | |
} | |
server { | |
listen 80 default_server deferred; | |
# server_name example.com; | |
root /home/deploy/apps/level0/current/public; | |
access_log /home/deploy/apps/level0/current/log/nginx.access.log; |
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
# Change the 'YOUR_AZURE_VM_IP' to the publicIpAddress from the output of | |
# `az vm create` command executed above | |
server 'YOUR_AZURE_VM_IP', roles: [:web, :app, :db], primary: true | |
# Change the YOUR_GITHUB_NAME to your github user name | |
set :repo_url, '[email protected]:YOUR_GITHUB_NAME/level0.git' | |
set :application, 'level0' | |
set :user, 'deploy' | |
set :puma_threads, [4, 16] | |
set :puma_workers, 0 |
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
# Load DSL and Setup Up Stages | |
require "capistrano/setup" | |
require "capistrano/deploy" | |
require "capistrano/scm/git" | |
install_plugin Capistrano::SCM::Git | |
require 'capistrano/rails' | |
require 'capistrano/bundler' | |
require 'capistrano/rvm' | |
require 'capistrano/puma' |