I have worked all day to be able to use SQLcl in shell scripts intended for CI/CD tools. My goal is to import/export Apex applications.
Right now these examples seems to fit my need :
project/
build-tools/
sqlcl/
bin/
lib/
...
sqlclscripts/
run.sh
test.sqlcl
apexexport.sqlcl
apeximport.sqlcl
...
src/
apex/
app.sql
dev.env
- run.sh : Script that receive another script as an argument
#!/bin/bash
RUNSCRIPT=$1
../sqlcl/bin/sql -s -L USER/PWD@server:9999/DBNAME <<EOF
$(cat $RUNSCRIPT.sqlcl)
EOF
./run.sh apexexport
With this I can create almost anything using Javascript to run from my CI/CD runner.
Anyone have better ideas doing this? If not, I hope it can help someone!