Skip to content

Commit

Permalink
Oracle user creation with custom bash script.
Browse files Browse the repository at this point in the history
Additional option for makefile.
#2183
  • Loading branch information
aavanesy committed Jan 18, 2024
1 parent 661b209 commit fe94cbf
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/oracle_helpers/create_oracle_users.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

# adding users through compose does not work
# tried different options, this is the one that finally worked...

# Wait for the Oracle database to fully initialize
echo "Waiting for the Oracle database to start..."
sleep 30

SQL0='alter session set "_ORACLE_SCRIPT"=true;
CREATE USER compose IDENTIFIED BY password1;
GRANT ALL PRIVILEGES TO compose;
exit;
'
docker exec -it -e SQL0="$SQL0" oracle bash -c 'echo "$SQL0" | sqlplus SYS/Oradoc_db1 AS SYSDBA'

5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ connect-%:

db-start:
docker-compose up -d --force-recreate
./.github/oracle_helpers/file.sh
R -q -e 'suppressMessages(pkgload::load_all()); DBI::dbExecute(test_src_maria(root = TRUE)$$con, "GRANT ALL ON *.* TO '"'"'compose'"'"'@'"'"'%'"'"';"); DBI::dbExecute(test_src_maria()$$con, "FLUSH PRIVILEGES")'
R -q -e 'suppressMessages(pkgload::load_all()); DBI::dbExecute(test_src_mssql(FALSE)$$con, "CREATE DATABASE test")'

Expand All @@ -43,6 +44,10 @@ db-restart:
db-stop:
docker-compose down

db-reset:
docker-compose down --volumes
docker-compose build --no-cache

docker-build:
docker build --platform linux/amd64 -t ghcr.io/cynkra/dm:main .

Expand Down

0 comments on commit fe94cbf

Please sign in to comment.