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
git log --pretty=format: --name-only | sort | uniq -c | sort -rg | head -20 |
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
pipeline { | |
agent any | |
stages { | |
stage('Build') { | |
steps { | |
sh 'docker build -t openjobs:latest .' | |
sh 'docker-compose build' | |
sh 'docker-compose run web bundle install' | |
sh 'docker-compose run web yarn' | |
sh 'docker-compose run -e RAILS_ENV=test --rm web bundle exec rake db:drop db:create db:migrate' |
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
stage('Deploy to Staging') { | |
when { | |
expression { env.BRANCH_NAME == 'master' } | |
} | |
steps { | |
echo 'deploy to staging' | |
createEnvironment('staging') | |
} | |
} |
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
def createEnvironment(name) { | |
sh "docker-compose down" | |
sh "docker service rm ${name} || :" | |
sh "docker service rm ${name}-pg || :" | |
sh "docker service rm ${name}-redis || :" | |
sh script: """\ | |
docker service create \ | |
--name ${name}-pg \ | |
--network traefik-net \ | |
postgres \ |
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
pipeline { | |
agent any | |
stages { | |
stage('Build') { | |
steps { | |
sh 'docker build -t openjobs:latest .' | |
sh 'docker-compose build' | |
sh 'docker-compose run web bundle install' | |
sh 'docker-compose run web yarn' | |
sh 'docker-compose run -e RAILS_ENV=test --rm web bundle exec rake db:drop db:create db:migrate' |
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
version: '3' | |
services: | |
db: | |
image: postgres | |
volumes: | |
- /tmp/postgres_data:/var/lib/postgresql/data | |
redis: | |
image: redis |
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
FROM ruby:2.4.1 | |
MAINTAINER [email protected] | |
RUN curl -sS http://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ | |
&& curl -sL http://deb.nodesource.com/setup_6.x | bash - \ | |
&& echo "deb http://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \ | |
&& apt-get update \ | |
&& apt-get install -y \ | |
build-essential \ | |
imagemagick \ |
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
git log --pretty=short -u -L 5,11:file |
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
output "elb_hostname" { | |
value = "${module.web.elb.hostname}" | |
} |
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
environment = "staging" | |
key_name = "test" | |
region = "us-west-1" | |
availability_zone = "us-west-1a" | |
# vpc | |
vpc_cidr = "10.0.0.0/16" | |
public_subnet_cidr = "10.0.1.0/24" | |
private_subnet_cidr = "10.0.2.0/24" |