codeformilwaukee / DECARCERATION-PLATFORM

https://wisdp.com
GNU General Public License v3.0
18 stars 17 forks source link

Edit amplify yml file to use perl to replace strings in config with #94

Closed paul-rinaldi closed 3 years ago

paul-rinaldi commented 3 years ago

Is your feature request related to a problem? Please describe. config js's firebase configuration strings aren't getting set from Github secrets in the frontend workflow https://github.com/codeformilwaukee/DECARCERATION-PLATFORM/blob/feature/amplify-and-aws-dynamodb/.github/workflows/web-app.yml

Describe the solution you'd like Use one or more perl commands in the yml workflow before Need to replace strings in config.js: "FIREBASE_API_KEY" with the github secrets.FIREBASE_API_KEY "FIREBASE_AUTH_DOMAIN" with the github secrets.FIREBASE_AUTH_DOMAIN "FIREBASE_DB_URL" with the github secrets.FIREBASE_DB_URL "FIREBASE_PROJECT_ID" with the github secrets.FIREBASE_PROJECT_ID "FIREBASE_STORAGE_BUCKET" with the github secrets.FIREBASE_STORAGE_BUCKET "FIREBASE_MESSAGING_SENDER_ID" with the github secrets.FIREBASE_MESSAGING_SENDER_ID "FIREBASE_APP_ID" with the github secrets.FIREBASE_APP_ID "MEASUREMENT_ID" with the github secrets.MEASUREMENT_ID

Describe alternatives you've considered Tried using vercel, amplify, and learning perl for 3hrs, see work in https://github.com/codeformilwaukee/DECARCERATION-PLATFORM/blob/feature/amplify-and-aws-dynamodb/web-app/src/replace.pl

Additional context No additional context

paul-rinaldi commented 3 years ago

made progress I think...

paul-rinaldi commented 3 years ago

Currently using this which doesn't seem to be working or the yml is malformed. @knutsoned any ideas?:


            sed -Ei 's/FIREBASE_API_KEY/$ENV{FIREBASE_API_KEY}/' web-app/src/config.js
            sed -Ei 's/FIREBASE_AUTH_DOMAIN/$ENV{FIREBASE_AUTH_DOMAIN}/' web-app/src/config.js
            sed -Ei 's/FIREBASE_DB_URL/$ENV{FIREBASE_DB_URL}/' web-app/src/config.js
            sed -Ei 's/FIREBASE_MESSAGING_SENDER_ID/$ENV{FIREBASE_MESSAGING_SENDER_ID}/' web-app/src/config.js
            sed -Ei 's/FIREBASE_PROJECT_ID/$ENV{FIREBASE_PROJECT_ID}/' web-app/src/config.js
            sed -Ei 's/FIREBASE_STORAGE_BUCKET/$ENV{FIREBASE_STORAGE_BUCKET}/' web-app/src/config.js
            sed -Ei 's/MEASUREMENT_ID/$ENV{MEASUREMENT_ID}/' web-app/src/config.js
            sed -Ei 's/REACT_APP_GOOGLE_MAPS_API_KEY/$ENV{REACT_APP_GOOGLE_MAPS_API_KEY}/' web-app/src/config.js```