Created
March 9, 2016 23:45
-
-
Save BanzaiMan/20cc01553a1948236138 to your computer and use it in GitHub Desktop.
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
diff --git a/lib/travis/build/addons/rethinkdb.rb b/lib/travis/build/addons/rethinkdb.rb | |
index eecddda..211a67d 100644 | |
--- a/lib/travis/build/addons/rethinkdb.rb | |
+++ b/lib/travis/build/addons/rethinkdb.rb | |
@@ -16,14 +16,14 @@ module Travis | |
sh.cmd "apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 #{RETHINKDB_GPG_KEY}", sudo: true | |
sh.cmd 'add-apt-repository "deb http://download.rethinkdb.com/apt $(lsb_release -cs) main"', sudo: true | |
sh.cmd "apt-get update -qq", assert: false, sudo: true | |
- package_version = rethinkdb_version + `lsb_release -cs` | |
- sh.cmd "apt-get install -y -o Dpkg::Options::='--force-confnew' rethinkdb=#{package_version}", sudo: true, echo: true, timing: true | |
+ sh.cmd "package_version=#{rethinkdb_version}$(lsb_release -cs)" | |
+ sh.cmd "apt-get install -y -o Dpkg::Options::='--force-confnew' rethinkdb=$package_version", sudo: true, echo: true, timing: true | |
sh.echo "Installing RethinkDB default instance configuration" | |
sh.cmd "cp /etc/rethinkdb/default.conf.sample /etc/rethinkdb/instances.d/default.conf", sudo: true | |
sh.echo "Starting RethinkDB v#{rethinkdb_version}", ansi: :yellow | |
sh.cmd "service rethinkdb start", sudo: true, assert: false, echo: true, timing: true | |
sh.export 'TRAVIS_RETHINKDB_VERSION', rethinkdb_version, echo: false | |
- sh.export 'TRAVIS_RETHINKDB_PACKAGE_VERSION', package_version, echo: false | |
+ sh.export 'TRAVIS_RETHINKDB_PACKAGE_VERSION', '$package_version', echo: false | |
sh.cmd "rethinkdb --version", assert: false, echo: true | |
end | |
end | |
diff --git a/spec/build/addons/rethinkdb_spec.rb b/spec/build/addons/rethinkdb_spec.rb | |
index 051273b..1842013 100644 | |
--- a/spec/build/addons/rethinkdb_spec.rb | |
+++ b/spec/build/addons/rethinkdb_spec.rb | |
@@ -20,14 +20,14 @@ describe Travis::Build::Addons::Rethinkdb, :sexp do | |
end | |
it 'sets TRAVIS_RETHINKDB_PACKAGE_VERSION' do | |
- should include_sexp [:export, ['TRAVIS_RETHINKDB_PACKAGE_VERSION', '2.2.5\\~0' + `lsb_release -cs`]] | |
+ should include_sexp [:export, ['TRAVIS_RETHINKDB_PACKAGE_VERSION', '$package_version']] | |
end | |
it { should include_sexp [:cmd, "service rethinkdb stop", sudo: true] } | |
it { should include_sexp [:cmd, "apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 #{Travis::Build::Addons::Rethinkdb::RETHINKDB_GPG_KEY}", sudo: true] } | |
it { should include_sexp [:cmd, 'add-apt-repository "deb http://download.rethinkdb.com/apt $(lsb_release -cs) main"', sudo: true] } | |
it { should include_sexp [:cmd, "apt-get update -qq", sudo: true] } | |
- it { should include_sexp [:cmd, "apt-get install -y -o Dpkg::Options::='--force-confnew' rethinkdb=#{'2.2.5\\~0' + `lsb_release -cs`}", sudo: true, echo: true, timing: true] } | |
+ it { should include_sexp [:cmd, "apt-get install -y -o Dpkg::Options::='--force-confnew' rethinkdb=$package_version", sudo: true, echo: true, timing: true] } | |
it { should include_sexp [:cmd, "cp /etc/rethinkdb/default.conf.sample /etc/rethinkdb/instances.d/default.conf", sudo: true] } | |
it { should include_sexp [:cmd, "service rethinkdb start", sudo: true, echo: true, timing: true] } | |
it { should include_sexp [:cmd, "rethinkdb --version", echo: true] } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment