Skip to content

Commit 4603df4

Browse files
authored
Merge pull request #2534 from rsim/fix-devcontainer-yarn-gpg-key
Fix dev container: upgrade to Ruby 4.0.2 on Debian 13 (trixie) and add monthly CI
2 parents ce49d20 + ab752d5 commit 4603df4

5 files changed

Lines changed: 68 additions & 6 deletions

File tree

.devcontainer/Dockerfile

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
1-
FROM mcr.microsoft.com/devcontainers/ruby:1-3.4-bookworm
1+
FROM mcr.microsoft.com/devcontainers/base:trixie
22

3-
# Install libaio1 (required for Oracle Instant Client)
4-
RUN apt-get update && apt-get install -y libaio1 \
5-
&& rm -rf /var/lib/apt/lists/*
3+
# Install libaio1t64 and provide a libaio.so.1 symlink for Oracle Instant Client
4+
# Install rlwrap for readline support in sqlplus
5+
RUN rm -f /etc/apt/sources.list.d/yarn.list \
6+
&& apt-get update \
7+
&& apt-get install -y libaio1t64 rlwrap \
8+
&& rm -rf /var/lib/apt/lists/* \
9+
&& DEB_HOST_MULTIARCH="$(dpkg-architecture -qDEB_HOST_MULTIARCH)" \
10+
&& ln -sf /usr/lib/${DEB_HOST_MULTIARCH}/libaio.so.1t64 \
11+
/usr/lib/${DEB_HOST_MULTIARCH}/libaio.so.1 \
12+
&& echo "alias sqlplus='rlwrap sqlplus'" >> /etc/bash.bashrc
613

714
# Create directory structure for Oracle
815
RUN mkdir -p /opt/oracle

.devcontainer/devcontainer.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,20 @@
33
"dockerComposeFile": "docker-compose.yml",
44
"service": "app",
55
"workspaceFolder": "/workspaces/oracle-enhanced",
6+
"features": {
7+
"ghcr.io/rails/devcontainer/features/ruby:2": {
8+
"version": "4.0.2"
9+
}
10+
},
611
"customizations": {
712
"vscode": {
813
"extensions": [
914
"shopify.ruby-lsp"
1015
]
1116
}
1217
},
13-
"postCreateCommand": "bundle install",
18+
"initializeCommand": "docker pull gvenzl/oracle-free:latest",
19+
"postCreateCommand": "bash .devcontainer/postCreateCommand.sh",
1420
"remoteEnv": {
1521
"DATABASE_NAME": "FREEPDB1",
1622
"DATABASE_SYS_PASSWORD": "Oracle18",

.devcontainer/docker-compose.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ services:
2222
retries: 10
2323
volumes:
2424
- oracle-data:/opt/oracle/oradata
25-
- ../spec/support/create_oracle_enhanced_users.sql:/container-entrypoint-initdb.d/01-create-users.sql
2625

2726
volumes:
2827
oracle-data:

.devcontainer/postCreateCommand.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
gem update --system
6+
bundle install
7+
8+
echo "Waiting for Oracle to be ready..."
9+
oracle_ready=false
10+
for i in $(seq 1 30); do
11+
if echo "exit" | sqlplus -s "system/${DATABASE_SYS_PASSWORD}@${DATABASE_NAME}" > /dev/null 2>&1; then
12+
oracle_ready=true
13+
break
14+
fi
15+
echo "Attempt $i/30 failed, retrying in 10s..."
16+
sleep 10
17+
done
18+
if [ "$oracle_ready" != "true" ]; then
19+
echo "Oracle did not become ready after 30 attempts; aborting container setup." >&2
20+
exit 1
21+
fi
22+
23+
ci/setup_accounts.sh
24+
25+
echo "Dev container setup complete. You are ready to start developing the Oracle Enhanced adapter!"

.github/workflows/devcontainer.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: devcontainer
2+
3+
on:
4+
schedule:
5+
- cron: "0 6 1 * *" # 1st of every month at 6:00 AM UTC
6+
workflow_dispatch:
7+
8+
env:
9+
RUBYOPT: "-w"
10+
11+
jobs:
12+
test:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v6
16+
17+
- name: Boot dev container and run tests
18+
uses: devcontainers/ci@v0.3
19+
with:
20+
runCmd: |
21+
uname -a
22+
lsb_release -a
23+
ruby --version
24+
bundle exec rake spec
25+
bundle exec rubocop

0 commit comments

Comments
 (0)