Skip to content
This repository has been archived by the owner on Feb 11, 2019. It is now read-only.

Commit

Permalink
Merge pull request #3 from tablexi/develop
Browse files Browse the repository at this point in the history
Release v1.0.1
  • Loading branch information
phoolish authored Sep 28, 2017
2 parents 413e73c + 0fffdec commit 8363868
Show file tree
Hide file tree
Showing 25 changed files with 1,043 additions and 1 deletion.
121 changes: 121 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
version: 2

defaults:
env_setup: &env_setup
working_directory: ~/chef-bashrc_manager
docker:
- image: circleci/ruby:2.4.1

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

install_bundle: &install_bundle
run:
name: Bundle install
command: bundle install --path vendor/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:
- ./vendor/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].*/
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ Berksfile.lock
/cookbooks

# Bundler
Gemfile.lock
bin/*
.bundle/*

# RVM
.rvmrc
.ruby-*

# Test Kitchen
.kitchen/*
28 changes: 28 additions & 0 deletions .kitchen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
driver:
name: docker
privileged: true
use_sudo: false

provisioner:
require_chef_omnibus: 12
name: chef_zero

platforms:
- name: amazonlinux
driver_config:
image: amazonlinux
platform: rhel
- name: centos-6
- name: centos-7
- name: debian-7
- name: debian-8
- name: debian-9
- name: ubuntu-14.04
- name: ubuntu-16.04

suites:
- name: default
run_list:
- recipe[test::default]
- recipe[test::bashrc_manager]
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
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
rvm:
- 1.9.3
- 2.0.0
script:
- bundle exec foodcritic -f any .
- bundle exec rspec --color --format progress
7 changes: 7 additions & 0 deletions Berksfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
source 'https://supermarket.getchef.com'

metadata

group :unit do
cookbook 'test', path: 'spec/support/cookbooks/test'
end
35 changes: 35 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
source 'http://rubygems.org'

ruby '2.4.1'

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 8363868

Please sign in to comment.