Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Commit

Permalink
Merge pull request #19 from tablexi/updates
Browse files Browse the repository at this point in the history
UPDATES
  • Loading branch information
phoolish authored Mar 30, 2018
2 parents 5e53628 + 4943447 commit 376d74f
Show file tree
Hide file tree
Showing 10 changed files with 651 additions and 5 deletions.
120 changes: 120 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
version: 2

defaults:
env_setup: &env_setup
docker:
- image: ruby:2.5.0

bundle_cache_name: &bundle_cache_name
bundler-cache-v2-{{ checksum "Gemfile.lock" }}

install_bundle: &install_bundle
run:
name: Bundle install
command: bundle install --path ~/bundle

restore_bundle: &restore_bundle
restore_cache:
key: *bundle_cache_name

jobs:
build:
<<: *env_setup
steps:
- checkout
- *restore_bundle
- *install_bundle
- save_cache:
key: *bundle_cache_name
paths:
- ~/bundle

test:
<<: *env_setup
steps:
- checkout
- *restore_bundle
- *install_bundle
- run:
name: Berks install
command: bundle exec berks install
- run:
name: Test rubocop
command: bundle exec rubocop
- run:
name: Test foodcritic
command: bundle exec foodcritic .
- run:
name: Test rspec
command: bundle exec rspec

version_and_changelog_update:
<<: *env_setup
steps:
- checkout
- *restore_bundle
- *install_bundle
- run:
name: setup git for push
command: |
git push --set-upstream origin ${CIRCLE_BRANCH}
git config --global user.email "[email protected]"
git config --global user.name "CircleCI"
- run:
name: bump version
command: bundle exec bump patch --tag --no-bundle
- deploy:
name: push version to github
command: |
git push origin --tags
- run:
name: update changelog
command: bundle exec github_changelog_generator
- deploy:
name: push changelog to github
command: |
VERSION=`git describe --tags`
git add CHANGELOG.md
git commit --amend --no-edit
git push origin :$VERSION
git tag -f $VERSION
git push origin --tags
git push origin --force-with-lease
workflows:
version: 2
test_and_bump:
jobs:
- build:
filters:
tags:
ignore:
- /^v[0-9].*/
- test:
requires:
- build
filters:
tags:
ignore:
- /^v[0-9].*/
- hold:
type: approval
requires:
- test
filters:
branches:
only:
- master
tags:
ignore:
- /^v[0-9].*/
- version_and_changelog_update:
requires:
- hold
filters:
branches:
only:
- master
tags:
ignore:
- /^v[0-9].*/
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,4 @@ bin/*
.bundle/*

# RVM
.ruby-version
.ruby-gemset
33 changes: 33 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
AllCops:
Include:
- Berksfile
- Gemfile
- Rakefile
- Guardfile
Exclude:
- vendor/**/*
- cookbooks/**/*

ClassLength:
Enabled: false
Documentation:
Enabled: false
Encoding:
Enabled: false
HashSyntax:
Enabled: false
LineLength:
Enabled: false
MethodLength:
Enabled: false
SignalException:
Enabled: false
WordArray:
Enabled: false
Style/FrozenStringLiteralComment:
Enabled: false
Metrics/BlockLength:
Exclude:
- spec/*.rb
Layout/IndentHeredoc:
Enabled: false
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.5.0
35 changes: 35 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
source 'https://rubygems.org'

ruby File.open(File.expand_path('.ruby-version', File.dirname(__FILE__))) { |f| f.read.chomp }

gem 'berkshelf'
gem 'chef', '~> 12'

group :ci do
gem 'bump'
gem 'github_changelog_generator'
end

group :dev do
gem 'chefspec'
gem 'foodcritic'
gem 'rubocop'
gem 'stove'
end

group :guard do
gem 'guard'
gem 'guard-foodcritic'
gem 'guard-kitchen'
gem 'guard-rspec'
gem 'guard-rubocop'
gem 'ruby_gntp'
end

group :kitchen do
gem 'chef-zero'
gem 'kitchen-docker'
gem 'kitchen-ec2'
gem 'kitchen-transport-rsync'
gem 'test-kitchen'
end
Loading

0 comments on commit 376d74f

Please sign in to comment.