File tree Expand file tree Collapse file tree 2 files changed +11
-19
lines changed
Expand file tree Collapse file tree 2 files changed +11
-19
lines changed Original file line number Diff line number Diff line change @@ -29,22 +29,15 @@ jobs:
2929 java-version : ${{ matrix.java-version }}
3030 distribution : " adopt"
3131 cache : " gradle"
32-
32+
3333 - name : Replace secrets in application.properties
3434 run : |
35- # Get the secret values and escape special characters
36- escaped_conn_str=$(printf '%s\n' "${{ vars.DB_CONN_STR }}" | sed -e 's/[]\/$*.^[]/\\&/g')
37- escaped_username=$(printf '%s\n' "${{ vars.DB_USERNAME }}" | sed -e 's/[]\/$*.^[]/\\&/g')
38- escaped_secret_value=$(printf '%s\n' "${{ secrets.DB_PASSWORD }}" | sed -e 's/[]\/$*.^[]/\\&/g')
39-
40- # Replace placeholders in application.properties
41- sed -i "s/DB_CONN_STR/${escaped_conn_str}/g" ./src/main/resources/application.properties
42- sed -i "s/DB_USERNAME/${escaped_username}/g" ./src/main/resources/application.properties
43- sed -i "s/DB_PASSWORD/${escaped_secret_value}/g" ./src/main/resources/application.properties
44-
45- # Print the updated file for verification
46- cat ./src/main/resources/application.properties
47- shell : /usr/bin/bash -e {0}
35+ sed -i "s#DB_CONN_STR#${{ vars.DB_CONN_STR }}#g" src/main/resources/application.properties
36+ sed -i "s#DB_USER#${{ vars.DB_USERNAME }}#g" src/main/resources/application.properties
37+ sed -i "s#DB_PASS#${{ secrets.DB_PASSWORD }}#g" src/main/resources/application.properties
38+
39+ # Print the updated file for verification
40+ cat ./src/main/resources/application.properties
4841
4942 - name : Run Gradle Tests
5043 id : run
Original file line number Diff line number Diff line change 11server.use-forward-headers =true
22server.forward-headers-strategy =framework
3- spring.couchbase.bootstrap-hosts =${ DB_CONN_STR}
3+ spring.couchbase.bootstrap-hosts =DB_CONN_STR
44spring.couchbase.bucket.name =travel-sample
5- spring.couchbase.bucket.user =${ DB_USERNAME}
6- spring.couchbase.bucket.password =${ DB_PASSWORD}
5+ spring.couchbase.bucket.user =DB_USERNAME
6+ spring.couchbase.bucket.password =DB_PASSWORD
77spring.couchbase.scope.name =inventory
8- spring.mvc.pathmatch.matching-strategy =ANT_PATH_MATCHER
9-
8+ spring.mvc.pathmatch.matching-strategy =ANT_PATH_MATCHER
You can’t perform that action at this time.
0 commit comments