Skip to content

Commit

Permalink
using ubuntu 22.04 for ruby, python and lua
Browse files Browse the repository at this point in the history
  • Loading branch information
morpheu committed Jun 14, 2024
1 parent f11d8b4 commit a65bb79
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion lua/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

FROM tsuru/base-platform:24.04
FROM tsuru/base-platform:22.04
COPY . /var/lib/tsuru/lua
RUN set -ex \
&& sudo /var/lib/tsuru/lua/install \
Expand Down
2 changes: 1 addition & 1 deletion python/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

FROM tsuru/base-platform:24.04
FROM tsuru/base-platform:22.04
COPY ./ /var/lib/tsuru/python/
RUN set -ex \
&& sudo /var/lib/tsuru/python/install \
Expand Down
2 changes: 1 addition & 1 deletion ruby/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

FROM tsuru/base-platform:24.04
FROM tsuru/base-platform:22.04
COPY . /var/lib/tsuru/ruby
RUN set -ex \
&& sudo /var/lib/tsuru/ruby/install \
Expand Down
2 changes: 1 addition & 1 deletion ruby/deploy
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fi

echo "gem: --no-rdoc --no-ri" > ~/.gemrc

RUBY_VERSION=${RUBY_VERSION:-2.7.7}
RUBY_VERSION=${RUBY_VERSION:-3.1.6}

echo "-- Using ruby version: $RUBY_VERSION --"

Expand Down
26 changes: 13 additions & 13 deletions tests/ruby/tests.bats
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@ load 'bats-assert-master/load'
dpkg -s build-essential | grep "install ok installed"
}

@test "install ruby version 2.7.7 as default" {
@test "install ruby version 3.1.6 as default" {
run /var/lib/tsuru/deploy
run /home/application/ruby/bin/ruby --version
assert_success
[[ "$output" == *"2.7.7"* ]]
[[ "$output" == *"3.1.6"* ]]
}

@test "install specific ruby version" {
export RUBY_VERSION="2.6.6"
export RUBY_VERSION="3.2.1"
run /var/lib/tsuru/deploy
run /home/application/ruby/bin/ruby --version
assert_success
[[ "$output" == *"2.6.6"* ]]
[[ "$output" == *"3.2.1"* ]]
}

@test "deploy fails on invalid ruby version" {
Expand All @@ -50,18 +50,18 @@ load 'bats-assert-master/load'
}

@test "parse ruby version from .ruby-version" {
echo "ruby-2.6.9" > ${CURRENT_DIR}/.ruby-version
echo "ruby-3.2.2" > ${CURRENT_DIR}/.ruby-version
run /var/lib/tsuru/deploy
run /home/application/ruby/bin/ruby --version
assert_success
[[ "$output" == *"2.6.9"* ]]
[[ "$output" == *"3.2.2"* ]]
rm ${CURRENT_DIR}/.ruby-version
}

@test "detect ruby version 2.6.6 on Gemfile" {
@test "detect ruby version 3.2.1 on Gemfile" {
echo "source 'https://rubygems.org'" > ${CURRENT_DIR}/Gemfile
echo "gem 'hello-world', '1.2.0'" >> ${CURRENT_DIR}/Gemfile
echo "ruby '2.6.6'" >> ${CURRENT_DIR}/Gemfile
echo "ruby '3.2.1'" >> ${CURRENT_DIR}/Gemfile
cat <<EOF>${CURRENT_DIR}/Gemfile.lock
GEM
remote: https://rubygems.org/
Expand All @@ -75,19 +75,19 @@ DEPENDENCIES
hello-world (= 1.2.0)
RUBY VERSION
ruby 2.6.6p146
ruby 3.2.1p146
BUNDLED WITH
2.0.1
EOF
run /var/lib/tsuru/deploy
assert_success
[[ "$output" == *"-- Using ruby version: 2.6.6 --"* ]]
[[ "$output" == *"-- Using ruby version: 3.2.1 --"* ]]
}
@test "bundle install when provide Gemfile and reuse already installed gem" {
echo "ruby-2.7.5" > ${CURRENT_DIR}/.ruby-version
echo "ruby-3.2.2" > ${CURRENT_DIR}/.ruby-version
echo "source 'https://rubygems.org'" > ${CURRENT_DIR}/Gemfile
echo "gem 'hello-world', '1.2.0'" >> ${CURRENT_DIR}/Gemfile
cat <<EOF>${CURRENT_DIR}/Gemfile.lock
Expand Down Expand Up @@ -117,7 +117,7 @@ EOF
}
@test "using bundle inside Gemfile.lock and ignore bundle vendoring version for ruby >= 2.6" {
echo "ruby-2.6.6" > ${CURRENT_DIR}/.ruby-version
echo "ruby-3.2.1" > ${CURRENT_DIR}/.ruby-version
echo "source 'https://rubygems.org'" > ${CURRENT_DIR}/Gemfile
echo "gem 'hello-world', '1.2.0'" >> ${CURRENT_DIR}/Gemfile
cat <<EOF>${CURRENT_DIR}/Gemfile.lock
Expand Down Expand Up @@ -147,7 +147,7 @@ EOF
}
@test "bundle install when provide Gemfile with no bundled with section" {
echo "ruby-2.7.4" > ${CURRENT_DIR}/.ruby-version
echo "ruby-3.1.2" > ${CURRENT_DIR}/.ruby-version
echo "source 'https://rubygems.org'" > ${CURRENT_DIR}/Gemfile
echo "gem 'hello-world', '1.2.0'" >> ${CURRENT_DIR}/Gemfile
cat <<EOF>${CURRENT_DIR}/Gemfile.lock
Expand Down

0 comments on commit a65bb79

Please sign in to comment.