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
# Pull new code from repository, build docker image, and start new container with new image | |
*/5 * * * * cd /home/ec2-user/myproject; make pull 2>&1 >> /home/ec2-user/deployment.log |
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 | |
# Get current git sha | |
GIT_COMMIT=$(git rev-parse HEAD) | |
# Build docker image, then stop exisitng container, then run new container | |
make build; make stop; make run; | |
# Report to Slack about deployment | |
curl -s -X POST --data-urlencode 'payload={"channel": "#dev-ops", "username": "Staging Server", "text": "Commit '$GIT_COMMIT' has been pushed to http://some-project-home.com", "icon_emoji": ":floppy_disk:"}' https://hooks.slack.com/[slack-hook-url] |
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
# Get git commit SHA | |
GIT_COMMIT = $(shell git rev-parse HEAD) | |
# Build docker image | |
build: | |
docker build -f Dockerfile -t someorg/myproject:$(GIT_COMMIT) . | |
# Run docker image, exposing port 80 of container image to port 80 of the host | |
run: | |
docker run --name myproject -p 80:80 -d someorg/myproject:$(GIT_COMMIT) |
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
# Dockerfile for Nnginx + PHP + Composer | |
# | |
# Installs Nginx and PHP from official sources. | |
# Runs nginx and php with supervisord. | |
# | |
# Various configuration files are placed under : docker_support_files/ | |
# | |
# Source files in : | |
# public - Public facing files (nginx root for static files) | |
# src - PHP source files |
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
exec = require('child_process').exec | |
some_list = [1,2,3] | |
for i in some_list | |
exec "ls", (err, stdout, stderr) -> | |
console.log i | |
# The result is NOT always | |
# |
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
SELECT pg_terminate_backend(pg_stat_activity.procpid) FROM pg_stat_activity WHERE datname = ''; |
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
""" | |
Create a summary (Name, High Concept, Company URL, Angellist URL) from results | |
of Angel.co's Startup API. | |
Reads all `*.json` from current directory and produces `summary.tsv` in the same directory. | |
Raw data is fetched from : https://api.angel.co/1/tags/1702/startups?page=1&per_page=50 | |
Tag 1702 : Toronto | |
""" |
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
// main.soy | |
{namespace main} | |
/** | |
* Header | |
* @param name Name of the person | |
*/ | |
{template .header} |