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 mail@carlosribeiro.me | |
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" |
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
variable "environment" { | |
default = "staging" | |
} | |
variable "key_name" { | |
description = "The aws keypair to use" | |
} | |
variable "region" { | |
description = "Region that the instances will be created" |
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
module "web" { | |
source = "../modules/web" | |
web_instance_count = "${var.web_instance_count}" | |
region = "${var.region}" | |
instance_type = "t2.micro" | |
private_subnet_id = "${module.networking.private_subnet_id}" | |
public_subnet_id = "${module.networking.public_subnet_id}" | |
vpc_sg_id = "${module.networking.default_sg_id}" | |
key_name = "${var.key_name}" | |
environment = "${var.environment}" |
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 = "${aws_elb.web.dns_name}" | |
} |