Skip to content

Commit

Permalink
sed commands for macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
kdacosta0 authored and christophd committed Oct 4, 2023
1 parent 71a835d commit 28cde96
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,14 @@ USER_NAME=$(oc get secret postgres-pguser-postgresadmin --template={{.data.user}
USER_PASSWORD=$(oc get secret postgres-pguser-postgresadmin --template={{.data.password}} | base64 -d)
HOST=$(oc get secret postgres-pguser-postgresadmin --template={{.data.host}} | base64 -d)
PASSWORD_SKIP_SPEC_CHAR=$(sed -e 's/[&\\/]/\\&/g; s/$/\\/' -e '$s/\\$//' <<<"$USER_PASSWORD")
sed -i "s/=camel-k-example/=$USER_NAME/g" transformation.properties
sed -i "s/=transformations/=$PASSWORD_SKIP_SPEC_CHAR/g" transformation.properties
sed -i "s/=mypostgres/=$HOST/g" transformation.properties
```

For macOS use these commands:
```
sed -i '' "s/^postgresql.user=.*/postgresql.user=$USER_NAME/" transformation.properties
sed -i '' "s/^postgresql.password=.*/postgresql.password=$PASSWORD_SKIP_SPEC_CHAR/" transformation.properties
sed -i '' "s/^postgresql.host=.*/postgresql.host=$HOST/" transformation.properties
Expand Down

0 comments on commit 28cde96

Please sign in to comment.