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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<meta name="description" content=""> | |
<meta name="author" content=""> | |
<title>Hello Cotoami!</title> | |
<link rel="stylesheet" href="<%= static_path(@conn, "/css/app.css") %>"> |
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 | |
export AWS_DEFAULT_REGION="ap-northeast-1" | |
APP="example_app" | |
APP_HOME="/opt/${APP}" | |
DEPLOY_TO="${APP_HOME}/releases" | |
S3_FOLDER="s3://example-app-packages" | |
# Get the specified or latest version number |
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
description "Example App" | |
setuid ubuntu | |
setgid ubuntu | |
start on runlevel [2345] | |
stop on runlevel [016] | |
expect stop | |
respawn |
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: Download package | |
command: aws s3 cp "{{ package_url }}" /tmp/app.tar.gz | |
environment: | |
AWS_ACCESS_KEY_ID: "{{ lookup('env','AWS_ACCESS_KEY_ID') }}" | |
AWS_SECRET_ACCESS_KEY: "{{ lookup('env','AWS_SECRET_ACCESS_KEY') }}" | |
- name: Make app directory | |
file: state=directory path={{ item }} | |
with_items: |
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 'aws-sdk' | |
lock '3.4.0' | |
set :application, 'example_app' | |
set :pty, true | |
set :user, "ubuntu" | |
set :use_sudo, true | |
set :ssh_key, "~/.ssh/example_app.pem" |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "1", | |
"Effect": "Allow", | |
"Action": "s3:*", | |
"Resource": [ | |
"arn:aws:s3:::example-app-packages/*" | |
] |
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 | |
set -ex | |
export AWS_DEFAULT_REGION="ap-northeast-1" | |
SGID="sg-xxxxxxxx" | |
MYIP="`dig +short myip.opendns.com @resolver1.opendns.com`" | |
cd $(dirname $(readlink -f $0)) |
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 | |
set -ex | |
mix do deps.get, deps.compile, compile | |
node -v | |
npm install | |
export MIX_ENV="prod" |
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 | |
export APP="example_app" | |
aws s3 cp s3://example-app-packages/latest.tar.gz /tmp/${APP}.tar.gz | |
mkdir -p rel/${APP} && rm -rf rel/${APP}/* | |
tar zxvf /tmp/${APP}.tar.gz -C rel/${APP} |
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 | |
export MIX_ENV="test" | |
mix do deps.get, deps.compile, compile, test |
NewerOlder