Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"features": {
"ghcr.io/rails/devcontainer/features/ruby:2": {
"version": "4.0.3"
}
},
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {}
},
"customizations": {
"vscode": {
Expand Down
17 changes: 17 additions & 0 deletions .devcontainer/postCreateCommand.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,21 @@ fi

ci/setup_accounts.sh

# Force client TZ data to match server (ORA_TZFILE workaround).
# Mirrors the CI workaround added in rsim/ruby-plsql#292: gvenzl/oracle-free
# ships a newer timezone-data version than the "latest" Instant Client embeds,
# so ruby-oci8 raises ORA-01805 for DATE/TIMESTAMP fetches unless the client
# uses the server's timezlrg_*.dat. The Docker CLI and socket are provided by
# the docker-outside-of-docker devcontainer feature.
ORACLE_CONTAINER=$(docker ps --filter "ancestor=gvenzl/oracle-free" -q)
SRC=$(docker exec "$ORACLE_CONTAINER" bash -c 'ls $ORACLE_HOME/oracore/zoneinfo/timezlrg_*.dat 2>/dev/null | head -1')
echo "Server TZ file: $SRC"
DST_DIR="$ORACLE_HOME/oracore/zoneinfo"
sudo mkdir -p "$DST_DIR"
docker cp "$ORACLE_CONTAINER":"$SRC" /tmp/_server_tzfile.dat
sudo mv /tmp/_server_tzfile.dat "$DST_DIR/$(basename "$SRC")"
ls -l "$DST_DIR"
echo "export ORA_TZFILE=$DST_DIR/$(basename "$SRC")" | sudo tee /etc/profile.d/ora_tzfile.sh > /dev/null
sudo chmod +x /etc/profile.d/ora_tzfile.sh

echo "Dev container setup complete. You are ready to start developing ruby-plsql!"