Skip to content

Instantly share code, notes, and snippets.

View szromek's full-sized avatar
👋
What's up?

Krzysztof Szromek szromek

👋
What's up?
View GitHub Profile
@szromek
szromek / json
Created January 12, 2018 08:57
Enforce MFA policy
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowAllUsersToListAccounts",
"Effect": "Allow",
"Action": [
"iam:ListAccountAliases",
"iam:ListUsers",
"iam:GetAccountPasswordPolicy",
@szromek
szromek / docker-compose.yml
Last active February 7, 2019 09:36
Docker compose for RoR application with debugger enabled
version: '2'
services:
db:
image: postgres
volumes:
- postgres-volume:/var/lib/postgresql/data
web:
build: .
command: rails s -b 0.0.0.0 -p 3000
volumes:
@szromek
szromek / docker-entrypoint.sh
Created October 26, 2017 09:50
Entrypoint for Ruby on Rails app on Docker
#! /bin/bash
bundle exec rake db:migrate
if [[ $? != 0 ]]; then
echo
echo "== Failed to migrate. Running setup first."
echo
bundle exec rake db:setup
fi
@szromek
szromek / console_run.sh
Created October 26, 2017 09:44
Running rails console inside docker-compose
docker-compose run web rails console
@szromek
szromek / docker-compose.yml
Last active October 26, 2017 09:41
Sample docker-compose for Ruby on Rails application
version: '2'
services:
db:
image: postgres
volumes:
- postgres-volume:/var/lib/postgresql/data
web:
build: .
command: rails s -b 0.0.0.0 -p 3000
volumes:
Started by user Krzysztof Sz
Replayed #2
Connecting to https://api.github.com using szromek/****** (GitHub Access Token)
Obtained Jenkinsfile from 72c4220aecd9f288d019f6129daf6a3b38b3d864
[Pipeline] node
Running on Jenkins in /var/lib/jenkins/workspace/l-ui-webpack-example_master-IXSLD4CQSVAM2DRFHYHOYUANEHJ73R5PUGW4BMYVT5WPGB6ZZKEQ
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Declarative: Checkout SCM)
[Pipeline] checkout
@szromek
szromek / PULL_REQUEST_TEMPLATE
Created August 28, 2017 18:47
Pull Request template for busy projects
<!--- Copy & paste card title in the Title field above (SJ-XXX Card name) -->
<!--- Before you open a PR: --->
<!--- !!! stick to maximum 8 Pull Requests open !!! --->
<!--- !!! make a code review at least once a day (before standup?) !!! --->
## Description
<!--- Describe your changes in detail -->
## Motivation and Context
@szromek
szromek / circle.yml
Created March 23, 2017 13:27
Circle CI config for Pronto
dependencies:
post:
- bin/automated_code_review
checkout:
post:
- git fetch origin --depth=1000000
@szromek
szromek / Setup Pronto in Gemfile
Created March 23, 2017 13:25
Runners and gems used for automated Code Review
group :test do
gem 'pronto'
gem 'pronto-brakeman', require: false
gem 'pronto-fasterer', require: false
gem 'pronto-rubocop', require: false
gem 'pronto-scss', require: false
gem 'brakeman', require: false
gem 'fasterer', require: false
gem 'rubocop', require: false
gem 'scss_lint', require: false
@szromek
szromek / automated_code_review
Last active March 23, 2017 13:23
Script for integrating Pronto with Circle CI
#!/usr/bin/env ruby
require 'net/http'
require 'json'
github_access_token = ENV['PRONTO_GITHUB_ACCESS_TOKEN'] || '' # Env set manualy on Circle CI to access token with proper rights
pull_request_url = ENV['CI_PULL_REQUEST'] || '' # Env set automaticaly by Circle CI
pull_request_id = pull_request_url.split('/').last # Example: 'https://github.com/rails/rails/pull/20554'
repo_owner = 'repo_owner'
repo_name = 'repo_name'