Skip to content

Commit b7da4af

Browse files
Bryan Wiegandbryanwieg
authored andcommitted
ruby 3x support
1 parent c8111e6 commit b7da4af

File tree

7 files changed

+45
-13
lines changed

7 files changed

+45
-13
lines changed

.circleci/config.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ jobs:
1919

2020
- run:
2121
name: start docker-compose build environment
22-
command: |
23-
sudo ./test/bin/setup_volume_permissions.sh
22+
command: |
23+
export ruby_version=<< parameters.ruby_version >>
24+
sudo -E ./test/bin/setup_volume_permissions.sh
2425
docker-compose up -d
2526
echo "Waiting for containers to start..."
2627
sleep 10
@@ -173,6 +174,7 @@ workflows:
173174
- '2.5'
174175
- '2.6'
175176
- '2.7'
177+
- '3.0'
176178

177179
- test_windows:
178180
matrix:
@@ -181,3 +183,4 @@ workflows:
181183
- '2.5'
182184
- '2.6'
183185
- '2.7'
186+
- '3.0'

clean_dev.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env bash
2+
# stop local dockerized development environment and clean build files
3+
4+
set -x
5+
set +e
6+
7+
docker compose down
8+
9+
sudo rm ./Gemfile.lock
10+
sudo rm -rf ./tmp

docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ networks:
55

66
services:
77
mssql:
8-
image: metaskills/mssql-server-linux-tinytds:2017-GA
8+
image: mcr.microsoft.com/mssql/server:2022-RTM-ubuntu-20.04
99
container_name: sqlserver
1010
environment:
1111
ACCEPT_EULA: Y
@@ -21,7 +21,7 @@ services:
2121
network_mode: "host"
2222

2323
cimgruby:
24-
image: cimg/ruby:2.7.0
24+
image: cimg/ruby:${ruby_version}
2525
container_name: cimg_ruby
2626
environment:
2727
TESTOPTS: '-v'

start_dev.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
11
#!/usr/bin/env bash
2+
# will spin up a local dockerized development environment
23

34
set -x
45
set -e
56

7+
if [ -z "$ruby_version" ]
8+
then
9+
echo "set a value for environment variable ruby_version"
10+
exit 1
11+
else
12+
echo "ruby_version is $ruby_version"
13+
fi
14+
615
# set volume read/write permissions to work both outside and inside container
7-
sudo ./test/bin/setup_volume_permissions.sh
16+
sudo -E ./test/bin/setup_volume_permissions.sh
817

9-
docker-compose up -d
18+
docker compose up -d
1019
echo "Waiting for containers to start..."
1120
sleep 10
1221

tasks/native_gem.rake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ task 'gem:windows' => ['ports:cross'] do
88
build = ['bundle']
99

1010
# and finally build the native gem
11-
build << 'rake cross native gem RUBY_CC_VERSION=2.7.0:2.6.0:2.5.0:2.4.0 CFLAGS="-Wall" MAKE="make -j`nproc`"'
11+
build << 'rake cross native gem RUBY_CC_VERSION=3.0.0:2.7.0:2.6.0:2.5.0 CFLAGS="-Wall" MAKE="make -j`nproc`"'
1212

1313
RakeCompilerDock.sh build.join(' && ')
1414
end

tasks/test.rake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,3 @@ Rake::TestTask.new do |t|
66
t.test_files = FileList['test/**/*_test.rb']
77
t.verbose = true
88
end
9-
Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11
#!/usr/bin/env bash
2+
# grants circlci docker uid and gid required write permissions to project file system
23

34
set -x
45

5-
sudo groupadd -g 3434 circleci_tinytds
6-
sudo usermod -a -G circleci_tinytds $USER
7-
sudo useradd circleci_tinytds -u 3434 -g 3434
8-
sudo usermod -a -G circleci_tinytds circleci_tinytds
9-
sudo chgrp -R circleci_tinytds .
6+
if $(dpkg --compare-versions $ruby_version lt 3.1)
7+
then
8+
sudo groupadd -g 3434 circleci_tinytds30
9+
sudo useradd circleci_tinytds30 -u 3434 -g 3434
10+
sudo usermod -a -G circleci_tinytds30 circleci_tinytds30
11+
sudo usermod -a -G circleci_tinytds30 $USER
12+
sudo chgrp -R circleci_tinytds30 .
13+
else
14+
sudo groupadd -g 1002 circleci_tinytds31
15+
sudo useradd circleci_tinytds31 -u 1001 -g 1002
16+
sudo usermod -a -G circleci_tinytds31 circleci_tinytds31
17+
sudo usermod -a -G circleci_tinytds31 $USER
18+
sudo chgrp -R circleci_tinytds31 .
19+
fi
20+
1021
sudo chmod -R g+rwx .

0 commit comments

Comments
 (0)