-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/develop' into feature-9
- Loading branch information
Showing
15 changed files
with
224 additions
and
91 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
.bundle/ | ||
coverage/ | ||
doc/ | ||
Gemfile.lock | ||
.idea/ | ||
*.iml | ||
log/ | ||
pkg/ | ||
spec/fixtures/ | ||
*.swn | ||
*.swo | ||
*.swp | ||
vendor/ | ||
log/ | ||
.yardoc/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
env: | ||
- "PUPPET_VERSION='~> 4.5' BEAKER_set=centos7" | ||
- "PUPPET_VERSION='~> 4.5' BEAKER_set=ubuntu1404" | ||
language: ruby | ||
rvm: | ||
- 2.3.1 | ||
cache: bundler | ||
before_install: rm Gemfile.lock || true | ||
bundler_args: --without development --with acceptance | ||
dist: trusty | ||
sudo: required | ||
script: | ||
- "bundle exec rake metadata_lint" | ||
- "bundle exec rubocop" | ||
- "bundle exec rake lint" | ||
- "bundle exec rake validate" | ||
- "bundle exec rake spec SPEC_OPTS='--format documentation'" | ||
- "bundle exec rake acceptance" | ||
notifications: | ||
email: false |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# locp-odoo | ||
|
||
##2016-12-23 - Release 0.1.2 ([diff](https://github.com/locp/puppet-odoo/compare/0.1.1...0.1.2)) | ||
|
||
Announce that the module has been renamed from locp-odoo9 to locp-odoo. | ||
|
||
##2016-10-09 - Release 0.1.1 ([diff](https://github.com/locp/puppet-odoo/compare/0.1.0...0.1.1)) | ||
|
||
Corrected metadata for the module. | ||
|
||
##2016-10-09 - Release 0.1.0 | ||
|
||
Initial release. |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,99 @@ | ||
require 'rubygems' | ||
require 'puppetlabs_spec_helper/rake_tasks' | ||
require 'puppet_blacksmith/rake_tasks' | ||
require 'puppet-strings/tasks' | ||
require 'httparty' | ||
require 'json' | ||
require 'yaml' | ||
require 'git' | ||
|
||
# Use a custom pattern with git tag. %s is replaced with the version number. | ||
Blacksmith::RakeTask.new do |t| | ||
t.tag_pattern = '%s' | ||
end | ||
|
||
desc '[CI Only] Run beaker, but only for pull requests or for release branches.' | ||
task :acceptance do | ||
skip = true | ||
travis_branch = ENV['TRAVIS_BRANCH'] | ||
travis_event_type = ENV['TRAVIS_EVENT_TYPE'] | ||
|
||
if travis_event_type == 'pull_request' | ||
skip = false | ||
elsif travis_event_type == 'push' | ||
skip = false if travis_branch =~ /^release-/ || travis_branch =~ /^hotfix-/ | ||
end | ||
|
||
if skip | ||
puts 'Skipping acceptance tests.' | ||
exit(0) | ||
else | ||
Rake::Task['beaker'].invoke | ||
end | ||
end | ||
|
||
desc '[CI Only] Tag, build and push the module to PuppetForge.' | ||
task :deploy do | ||
abort('Only deploy from master.') unless ENV['CIRCLE_BRANCH'] == 'master' | ||
|
||
# Find out what the local version of the module is. | ||
file = File.read('metadata.json') | ||
data_hash = JSON.parse(file) | ||
local_version = data_hash['version'] | ||
abort('Unable to find local module version.') unless local_version | ||
puts "Module version (local): #{local_version}" | ||
|
||
Rake::Task['deploy:tag'].invoke(local_version) | ||
Rake::Task['deploy:forge'].invoke(local_version) | ||
end | ||
|
||
namespace :deploy do | ||
desc 'Deploy module to Puppet Forge if required.' | ||
task :forge, [:version] do |_t, args| | ||
local_version = args[:version] | ||
|
||
# Find out what the forge version of the module is. | ||
response = HTTParty.get('https://forgeapi.puppetlabs.com/v3/modules/locp-cassandra') | ||
data_hash = JSON.parse(response.body) | ||
forge_version = data_hash['current_release']['version'] | ||
abort('Unable to find out the forge version.') unless forge_version | ||
puts "Module version (forge): #{forge_version}" | ||
exit 0 unless local_version != forge_version | ||
|
||
# Build the module. | ||
puts "Build and deploy version #{local_version}." | ||
Rake::Task['module:clean'].invoke | ||
Rake::Task['build'].invoke | ||
|
||
# Now see if we can push this baby to the forge. | ||
PUPPET_FORGE_CREDENTIALS_FILE = ENV['HOME'] + '/' + '.puppetforge.yml' | ||
username = ENV['CIRCLE_PROJECT_USERNAME'] | ||
password = ENV['PUPPET_FORGE_PASSWORD'] | ||
abort("Not enough data to populate #{PUPPET_FORGE_CREDENTIALS_FILE}") unless username && password | ||
puts "Populating #{PUPPET_FORGE_CREDENTIALS_FILE}" | ||
credentials = { 'username' => username, 'password' => password } | ||
File.open(PUPPET_FORGE_CREDENTIALS_FILE, 'w') { |f| f.write credentials.to_yaml } | ||
Rake::Task['module:push'].invoke | ||
end | ||
end | ||
|
||
namespace :deploy do | ||
desc 'Deploy tag for the module' | ||
task :tag, [:version] do |_t, args| | ||
tagname = args[:version] | ||
# Find out if a tag is available for this version. | ||
log = Logger.new(STDOUT) | ||
log.level = Logger::WARN | ||
git = Git.open('.', log: log) | ||
|
||
begin | ||
git.tag(tagname) | ||
rescue Git::GitTagNameDoesNotExist | ||
puts "Creating tag: #{tagname}" | ||
git.add_tag(tagname, 'master', message: 'tagged by RubyAutoDeployTest', f: true) | ||
git.push('origin', "refs/tags/#{tagname}", f: true) | ||
else | ||
puts "Tag: #{tagname} already exists." | ||
end | ||
end | ||
end |
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
HOSTS: | ||
centos7: | ||
roles: | ||
- master | ||
platform: el-7-x86_64 | ||
image: centos:7 | ||
hypervisor: docker | ||
docker_cmd: '["/sbin/init"]' | ||
docker_image_commands: | ||
- 'yum -y install systemd-container initscripts epel-release' | ||
- 'yum clean all' | ||
CONFIG: | ||
type: foss | ||
log_level: notice |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
HOSTS: | ||
ubuntu1404: | ||
roles: | ||
- master | ||
platform: ubuntu-14.04-x64 | ||
image: ubuntu:14.04 | ||
hypervisor: docker | ||
docker_image_commands: | ||
- 'apt-get install -y sudo' | ||
CONFIG: | ||
type: foss | ||
log_level: notice |
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
Oops, something went wrong.