Skip to content

Instantly share code, notes, and snippets.

View duduribeiro's full-sized avatar

Cadu Ribeiro duduribeiro

View GitHub Profile
@duduribeiro
duduribeiro / git_files_by_commit_number.sh
Created January 25, 2018 20:42
mostly commited files
git log --pretty=format: --name-only | sort | uniq -c | sort -rg | head -20
@duduribeiro
duduribeiro / Jenkinsfile
Created July 1, 2017 05:10
review_app-Jenkinsfile-final
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'
@duduribeiro
duduribeiro / Jenkinsfile
Created July 1, 2017 05:08
review_app-Jenkinsfile-stages
stage('Deploy to Staging') {
when {
expression { env.BRANCH_NAME == 'master' }
}
steps {
echo 'deploy to staging'
createEnvironment('staging')
}
}
@duduribeiro
duduribeiro / Jenkinsfile
Created July 1, 2017 04:43
review_app-Jenkinsfile-envMethod
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 \
@duduribeiro
duduribeiro / Jenkinsfile
Created July 1, 2017 03:28
review_app-Jenkinsfile
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'
@duduribeiro
duduribeiro / docker-compose.yml
Last active July 1, 2017 03:57
review_app-docker-compose.yml
version: '3'
services:
db:
image: postgres
volumes:
- /tmp/postgres_data:/var/lib/postgresql/data
redis:
image: redis
@duduribeiro
duduribeiro / Dockerfile
Last active June 30, 2017 20:35
review_app-Dockerfile
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 \
@duduribeiro
duduribeiro / blame_history.sh
Created June 8, 2017 12:12
blame history on git
git log --pretty=short -u -L 5,11:file
@duduribeiro
duduribeiro / output.tf
Created March 31, 2017 23:54
Terraform staging - output.tf
output "elb_hostname" {
value = "${module.web.elb.hostname}"
}
@duduribeiro
duduribeiro / terraform.tfvars
Created March 31, 2017 23:41
Terraform staging - terraform.tfvars2
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"