MaikMichel / dbFlow

Deployment framework for Oracle APEX Applications
https://maikmichel.github.io/dbFlow/
MIT License
11 stars 1 forks source link

Setup failing with sed: 1: "db/_setup/users/01_crea ...": extra characters at the end of d command #25

Closed AshleyAitken closed 7 months ago

AshleyAitken commented 7 months ago

Thank you for dbFlow I am trying to get setup for APEX development. I have setup GIT I have install dbFlow I am trying to use an OCI ATP (Autnonomous DB) with its connection string"(description=...)))" I am on macOS 13.5.1 I have installed SQLcl (sql) with Java11 I have tried to setup dbFlow multiple times and always get this: sed: 1: "db/_setup/users/01_crea ...": extra characters at the end of d command I believe a sed command is failing for the reason mentioned but can't see why or where. I've tried to track it down but can't see anything wrong... Any suggestions please?

MaikMichel commented 7 months ago

Hi Ashley, I think this is because MacOS is using it's own version of SED. I've tried to fix this in blind mode. Currenty I'm not using a Mac. Please pull branch fixes/macos-sed and try again. Let me know if this is working. If so, I will merge into develop.

Thank you for reporting!

AshleyAitken commented 7 months ago

Hi Michel (hope that's right),

Thank you for your prompt reply. It seemed to help, the script seems to have progress further, but another error has come up.

.dbFlow/setup.sh --generate bair
Generate Project: bair
Which dbFLow project type do you want to create? Single, Multi or Flex [M]: M
When running release tests, what is your prefered branch name [build]:
Would you like to process changelogs during deployment [N]:
Enter database connections [localhost:1521/xepdb1]: “(description= (retry_count=20)(retry_delay=3)(address=(protocol=tcps)(port=1522)(host=adb.ap-sydney-1.oraclecloud.com))(connect_data=(service_name=gd636dae61f3ebf_db88uka_medium.adb.oraclecloud.com))(security=(ssl_server_dn_match=yes)))”
Enter username of admin user (admin, sys, ...) [sys]: super
Enter password for super [leave blank and you will be asked for]: *******************
Enter password for deployment_user (proxyuser: bair_depl) [leave blank and you will be asked for]: *******************
Enter path to depot [_depot]:
Enter stage of this configuration mapped to branch (develop, test, master) [develop]:
Install with sql(cl) or sqlplus? [sqlplus]: sql
Enter path to place logfiles and artifacts into after installation? [_logs]:
Do you wish to generate and install default tooling? (Logger, utPLSQL, teplsql, tapi) [Y]:
Enter application IDs (comma separated) you wish to use initialy (100,101,...): (200)
Enter restful Moduls (comma separated) you wish to use initialy (api,test,...):
Generating project with following options
  Project:                          bair
  Mode:                             M
  Build Branch:                     build
  Create Changelos:                 N
  Schema Changelog proccessed:
  Connection:                       “(description= (retry_count=20)(retry_delay=3)(address=(protocol=tcps)(port=1522)(host=...)(security=(ssl_server_dn_match=yes)))”
  Admin User:                       super
  Deployment User:                  bair_depl
  Location depot:                   _depot
  Location logs:                    _logs
  Branch is mapped to Stage:        develop
  SQl commandline:                  sql
  Install default tools:            Y
  Configure with default apps:      (200)
  Configure with default modules:
  Just install environment onyl:    NO

... working ...
./apply.env: Zeile 2: Syntaxfehler beim unerwarteten Symbol »(«
❌ EXIT 2

and here is the apply.env file:

# DB Connection
DB_TNS=“(description= (retry_count=20)(retry_delay=3)(address=(protocol=tcps)(port=1522)(host=....))(security=(ssl_server_dn_match=yes)))”

# Deployment User
DB_APP_USER=bair_depl
DB_APP_PWD="!...="

# SYS/ADMIN Pass
DB_ADMIN_USER=super
DB_ADMIN_PWD="!...="

# Path to Depot
DEPOT_PATH=_depot

# Stage mapped to source branch ( develop test master )
# this is used to get artifacts from depot_path
STAGE=develop

# ADD this to original APP-NUM
APP_OFFSET=0

# Scripts are executed with
SQLCLI=sql

# TEAMS Channel to Post to on success
TEAMS_WEBHOOK_URL=

# Path to pace logs and artifacts into after installation
LOG_PATH=_logs

Thanks for any assistance you can provide. I am reasonably technical so should be able to do things if it could help you debug.

AshleyAitken commented 7 months ago

Ok, I am guessing it is the DB connection string? I am trying to connect to an Autonomous Database on OCI (ATP). Not the regular host:port/name format? Can dbFlow work with these? If not, is there another way for ATP?

MaikMichel commented 7 months ago

Hi, I think your double quotes are of wrong type. You should use "..." not “...” ! Additionally, I would suggest you to use an alias here. dbFlow executes SQLcl with the vars like: $ sql DB_APP_USER/DB_APP_PWD@DB_TNS Just have a look at: https://blogs.oracle.com/opal/post/how-to-connect-to-oracle-autonomous-cloud-databases

AshleyAitken commented 7 months ago

Oh my, yes that is it, thank you, I have been caught by that before. Copying from Notes, where it automatically uses "smart" quotes.

Thank you for the pointer to using an alias, I will check out the blog post. Next step is also to setup and use dbFlux, which looks great!

Apologies for the distraction.