* add script for jenkins CI (draft version);

* add Gemfile for local development (useful for newbie and community developments)
This commit is contained in:
Vladmir Sharhsov(warpc) 2013-09-03 11:06:26 +04:00
parent d17de67810
commit 5619ddfca1
3 changed files with 67 additions and 1 deletions

1
.gitignore vendored
View File

@ -6,6 +6,5 @@ coverage
coverage.data
# Need only on local machine for gem
Gemfile
Gemfile.lock
docs/_build

4
Gemfile Normal file
View File

@ -0,0 +1,4 @@
source 'https://rubygems.org'
source 'http://download.mirantis.com/fuelweb-repo/3.2/gems/'
gemspec

View File

@ -0,0 +1,63 @@
#!/bin/bash
# export
# exit 1
# ~/astute_rspec_check.sh
set +x
set -e
set -u
function license_check() {
# License information must be in every source file
cd $WORKSPACE
tmpfile=`tempfile`
find * -not -path "docs/*" -regex ".*\.\(rb\)" -type f -print0 | xargs -0 grep -Li License
files_with_no_license=`wc -l $tmpfile | awk '{print $1}'`
if [ $files_with_no_license -gt 0 ]; then
echo "ERROR: Found files without license, see files below:"
cat $tmpfile
rm -f $tmpfile
exit 1
fi
rm -f $tmpfile
}
function ruby_checks() {
# Clean up work folder
# rm -Rf mcollective_tmp *.zip
# Installing ruby dependencies
# Build and install mcollective client
# mkdir mcollective_tmp
# curl -LO https://github.com/puppetlabs/marionette-collective/archive/9f8d2ec75ba326d2a37884224698f3f96ff01629.zip
# unzip 9f8d2ec75ba326d2a37884224698f3f96ff01629.zip -d mcollective_tmp
# cd mcollective_tmp
# cd marionette-collective-*
# bundle exec rake gem
# cd build
# gem install *.gem
# cd $WORKSPACE
#
# # Clean up work folder
# rm -Rf mcollective_tmp *.zip
curl -LO https://dl.dropboxusercontent.com/u/984976/mcollective-client-2.3.1.gem
gem install mcollective-client-2.3.1.gem
rm mcollective-client-2.3.1.gem
echo 'source "https://rubygems.org"' > Gemfile
echo 'source "http://download.mirantis.com/fuelweb-repo/3.2/gems/"' >> Gemfile
echo 'gemspec' >> Gemfile
# Install all other ruby dependencies
sudo bundle install
# Run unit rspec tests
set +e
bundle exec rake spec:unit
rc=$?
set -e
if test $rc -ne 0 ; then
exit 1
fi
}
license_check
ruby_checks