Commit f78f9f26 authored by MARGERY David's avatar MARGERY David
Browse files

[Packaging] Work on changes to package in the vagrant box, without capistrano

parent 4e169a7b
......@@ -31,9 +31,9 @@ group :test, :development do
gem 'factory_girl_rails'
gem 'simplecov'
gem 'net-ssh-multi'
gem 'capistrano'
#gem 'pkgr', '>= 1.4.4' #pkgr comes with debian-8 buildpack as from 1.4.4, but is not compatible with rails 3.0 (incompatible dependencies on rake and thor)
#gem 'capistrano'
gem 'g5k-campaign', :git => 'https://gforge.inria.fr/git/g5k-campaign/g5k-campaign.git', :ref => 'cac93c26c7c998da96182980736b4d17fb070570' # '~> 0.9.7'
end
......@@ -66,12 +66,6 @@ GEM
nokogiri (~> 1.5, >= 1.5.6, <= 1.6.1)
bond (0.4.3)
builder (2.1.2)
capistrano (2.9.0)
highline
net-scp (>= 1.0.0)
net-sftp (>= 2.0.0)
net-ssh (>= 2.0.14)
net-ssh-gateway (>= 1.1.0)
charlock_holmes (0.7.3)
connection_pool (1.2.0)
crack (0.3.1)
......@@ -104,7 +98,6 @@ GEM
mime-types (~> 1.15)
posix-spawn (~> 0.3)
haml (3.1.3)
highline (1.6.2)
http-cookie (1.0.2)
domain_name (~> 0.5)
i18n (0.5.0)
......@@ -240,7 +233,6 @@ DEPENDENCIES
autotest
autotest-growl
blather (>= 1.2.0)
capistrano
em-http-request (~> 0.2)
em-postgresql-adapter!
em-synchrony (~> 0.2)
......
......@@ -9,12 +9,12 @@ but if you read this, it's normally good…
## Installation
The app is packaged for Debian Wheezy. Therefore installation is as follows:
The app is packaged for Debian Jessie. Therefore installation is as follows:
sudo apt-get update
sudo apt-get install g5k-api
In particular, runtime dependencies of the app include `ruby1.9.3` and `git-core`.
In particular, runtime dependencies of the app include `ruby2.1.5` and `git-core`.
## Development
......
g5k-api (3.4.12-1) unstable; urgency=low
g5k-api (3.4.12-6) jessie; urgency=medium
* New attempt at fixing ruby version dependency
-- vagrant <vagrant@debian-8.2.0-amd64> Wed, 27 Apr 2016 08:42:25 +0000
g5k-api (3.4.12-2) jessie; urgency=low
* Fix ruby dependency
-- David Margery <david.margery@inria.fr> Wed, 16 Mar 2016 15:43:05 +0100
g5k-api (3.4.11-1) unstable; urgency=low
g5k-api (3.4.12-1) unstable; urgency=low
* release version 3.4.12
-- David Margery <david.margery@inria.fr> Wed, 16 Mar 2016 15:43:05 +0100
g5k-api (3.4.11-1) unstable; urgency=low
* release version 3.4.11
-- David Margery <david.margery@inria.fr> Fri, 11 Mar 2016 10:19:24 +0100
g5k-api (3.4.10-1) unstable; urgency=low
* release version 3.4.10
-- David Margery <david.margery@inria.fr> Mon, 28 Sep 2015 17:35:06 +0200
g5k-api (3.4.9-1) unstable; urgency=low
* release version 3.4.9
-- David Margery <david.margery@inria.fr> Mon, 28 Sep 2015 17:21:49 +0200
g5k-api (3.4.8-1) unstable; urgency=low
* release version 3.4.8
-- David Margery <david.margery@inria.fr> Tue, 28 Jul 2015 13:49:49 +0200
g5k-api (3.4.7-1) unstable; urgency=low
* release version 3.4.7
-- David Margery <david.margery@inria.fr> Tue, 28 Jul 2015 13:34:15 +0200
g5k-api (3.4.6-1) unstable; urgency=low
* release version 3.4.6
-- David Margery <david.margery@inria.fr> Tue, 28 Jul 2015 12:05:40 +0200
......@@ -156,7 +168,7 @@ g5k-api (3.2.1-1) unstable; urgency=low
g5k-api (3.2.0-1) unstable; urgency=low
* Release version 3.2.0
-- Anirvan BASU <Anirvan.BASU@INRIA.fr> Tue, 24 Mar 2015 14:14:16 +0100
......
Source: g5k-api
Section: unknown
Priority: extra
Maintainer: Cyril Rohr <cyril.rohr@inria.fr>
Uploaders: Sebastien Badia <sebastien.badia@inria.fr>
Maintainer: Grid'5000 developpers <g5k-developers@lists.grid5000.fr>
Uploaders: David Margery <david.margery@inria.fr>
Build-Depends: debhelper (>= 7), libmysqlclient15-dev, libxml2-dev, libxslt-dev, libpq-dev
Standards-Version: 3.7.3
Homepage: https://api.grid5000.fr
Package: g5k-api
Architecture: amd64
Depends: ${shlibs:Depends}, ${misc:Depends}, ruby1.9.3, git-core, libxml2, libxslt1.1
Depends: ${shlibs:Depends}, ${misc:Depends}, ruby2.1.5, git-core, libxml2, libxslt1.1
Description: Grid'5000 API
The API built on top of the Grid'5000 tools.
......@@ -6,10 +6,40 @@ NAME = ENV['PKG_NAME'] || "g5k-api"
BUILD_MACHINE = ENV['BUILD_MACHINE'] || "debian-build"
USER_NAME = `git config --get user.name`.chomp
USER_EMAIL = `git config --get user.email`.chomp
BUNDLER_VERSION = "1.7.6"
require VERSION_FILE
PACKAGING_DIR = '/tmp/'+NAME+'-'+Grid5000::VERSION
def in_working_dir(dir,&block)
#Dir.choidr does not change ENV['PWD']
old_wd=ENV['PWD']
Dir.chdir(dir) do
ENV['PWD']=dir
yield
end
ENV['PWD']=old_wd
end
def without_bundle_env(forced_values={}, &block)
to_clean=["BUNDLE_GEMFILE","RUBYOPT"]
saved_values={}
to_clean.each do |env_value|
saved_values[env_value]=ENV[env_value]
if forced_values.has_key?(env_value)
ENV[env_value]=forced_values[env_value]
else
ENV.delete(env_value)
end
end
yield
to_clean.each do |env_value|
ENV[env_value]=saved_values[env_value]
end
end
def bump(index)
fragments = Grid5000::VERSION.split(".")
fragments[index] = fragments[index].to_i+1
......@@ -20,11 +50,11 @@ def bump(index)
changelog = File.read(CHANGELOG_FILE)
last_commit = changelog.scan(/\s+\* ([a-z0-9]{7}) /).flatten[0]
puts last_commit
cmd = "git log --oneline"
cmd << " #{last_commit}..HEAD" unless last_commit.nil?
content_changelog = [
"#{NAME} (#{new_version}-1) unstable; urgency=low",
"#{NAME} (#{new_version}-1) jessie; urgency=low",
"",
`#{cmd}`.split("\n").reject{|l| l =~ / v#{Grid5000::VERSION}/}.map{|l| " * #{l}"}.join("\n"),
"",
......@@ -54,25 +84,28 @@ end
namespace :package do
task :setup do
mkdir_p "pkg"
mkdir_p "#{PACKAGING_DIR}/pkg"
# remove previous versions
rm_rf "pkg/#{NAME}_*.deb"
rm_rf "#{PACKAGING_DIR}/pkg/#{NAME}_*.deb"
sh "mkdir -p pkg/ && git archive HEAD > /tmp/#{NAME}.tar"
end
desc "Bundle the dependencies for the current platform"
task :bundle do
%w{bin gems specifications}.each{|dir|
rm_rf "vendor/ruby/1.9.1/#{dir}"
}
# Install dependencies
sh "which bundle || gem1.9.1 install bundler --version #{BUNDLER_VERSION}"
#sh "export CFLAGS='-Wno-error=format-security' && bundle install --deployment --without test development"
sh "bundle install --deployment --without test development"
# Vendor bundler
sh "gem1.9.1 install bundler --no-ri --no-rdoc --version #{BUNDLER_VERSION} -i vendor/bundle/ruby/1.9.1/"
%w{cache doc}.each{|dir|
rm_rf "vendor/bundle/ruby/1.9.1/#{dir}"
}
task :bundle => :setup do
in_working_dir(PACKAGING_DIR) do
without_bundle_env({}) do
BUNDLER_VERSION=`bundle --version | cut -d ' ' -f 3`.chomp
%w{bin gems specifications}.each{|dir|
rm_rf "vendor/ruby/#{RUBY_VERSION}/#{dir}"
}
sh "bundle install --deployment --without test development --path vendor"
# Vendor bundler
sh "gem install bundler --no-ri --no-rdoc --version #{BUNDLER_VERSION} -i #{PACKAGING_DIR}/vendor/bundle/ruby/#{RUBY_VERSION}/"
%w{cache doc}.each{|dir|
rm_rf "vendor/bundle/ruby/#{RUBY_VERSION}/#{dir}"
}
end
end
end
namespace :bump do
......@@ -90,12 +123,26 @@ namespace :package do
end
end
desc "Build the binary package"
task :build do
sh "dpkg-buildpackage -us -uc -d"
end
namespace :build do
desc "Build debian package with pkgr"
task :debian_pkgr do
sh "pkgr package . --version #{Grid5000::VERSION} --name #{NAME} --auto"
end
task :debian => :'package:setup' do
pkg_dependencies= %w{libmysqlclient-dev libxml2-dev libxslt-dev libssl-dev libpq-dev}
cmd = "sudo apt-get install #{pkg_dependencies.join(" ")} git-core dh-make dpkg-dev libicu-dev --yes && rm -rf /tmp/#{NAME}"
sh cmd
Dir.chdir('/tmp') do
sh "tar xf #{NAME}.tar -C #{PACKAGING_DIR}"
Dir.chdir(PACKAGING_DIR) do
Rake::Task[:'package:bundle'].invoke
sh "dpkg-buildpackage -us -uc -d"
end
end
sh "cp #{PACKAGING_DIR}/../#{NAME}_#{Grid5000::VERSION}*.deb pkg/"
end
end
desc "Generates the .deb"
task :debian => [:setup, :bundle, :build]
end
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment