Skip to content

Commit d1c8190

Browse files
committed
Replace secrets in application.properties
1 parent 7709c4e commit d1c8190

File tree

2 files changed

+7
-53
lines changed

2 files changed

+7
-53
lines changed

.github/workflows/tests.yaml

Lines changed: 4 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -30,42 +30,11 @@ jobs:
3030
distribution: "adopt"
3131
cache: "gradle"
3232

33-
- name: Setup couchbase
33+
- name: Replace secrets in application.properties
3434
run: |
35-
sudo apt install -y iputils-ping || echo "apt-install failed"
36-
ping -c 1 couchbase && (
37-
sudo apt install -y socat
38-
socat TCP-LISTEN:8091,fork TCP:couchbase:8091 &
39-
socat TCP-LISTEN:8092,fork TCP:couchbase:8092 &
40-
socat TCP-LISTEN:8093,fork TCP:couchbase:8093 &
41-
socat TCP-LISTEN:8094,fork TCP:couchbase:8094 &
42-
socat TCP-LISTEN:8095,fork TCP:couchbase:8095 &
43-
socat TCP-LISTEN:8096,fork TCP:couchbase:8096 &
44-
socat TCP-LISTEN:9140,fork TCP:couchbase:9140 &
45-
socat TCP-LISTEN:11210,fork TCP:couchbase:11210 &
46-
socat TCP-LISTEN:11211,fork TCP:couchbase:11211 &
47-
socat TCP-LISTEN:11207,fork TCP:couchbase:11207 &
48-
socat TCP-LISTEN:18091,fork TCP:couchbase:18091 &
49-
socat TCP-LISTEN:18092,fork TCP:couchbase:18092 &
50-
socat TCP-LISTEN:18093,fork TCP:couchbase:18093 &
51-
socat TCP-LISTEN:18094,fork TCP:couchbase:18094 &
52-
socat TCP-LISTEN:18095,fork TCP:couchbase:18095 &
53-
socat TCP-LISTEN:18096,fork TCP:couchbase:18096 &
54-
) && echo "Initialized couchbase port forwarding" || echo "ping couchbase failed, not forwarding ports"
55-
printf "Waiting for CB startup..."
56-
wget -O /dev/null http://localhost:8091/ && echo "DONE" || (echo "FAIL" && panic)
57-
curl -v -X POST http://localhost:8091/node/controller/setupServices -d 'services=kv%2Cn1ql%2Cindex'
58-
curl -v -X POST http://localhost:8091/pools/default -d 'memoryQuota=256' -d 'indexMemoryQuota=256'
59-
curl -u Administrator:password -v -X POST http://localhost:8091/settings/web -d 'password=password&username=Administrator&port=SAME'
60-
curl -v -X POST http://localhost:8091/pools/default/buckets \
61-
-u Administrator:password \
62-
-d name=user_profile \
63-
-d bucketType=couchbase\
64-
-d ramQuotaMB=1024 \
65-
-d durabilityMinLevel=majorityAndPersistActive
66-
curl -u Administrator:password -v -X POST http://localhost:8091/settings/indexes -d 'storageMode=memory_optimized'
67-
curl -u Administrator:password -v -X GET http://localhost:8091/pools/default | jq '.' | grep hostname
68-
curl -u Administrator:password -v -X POST http://localhost:8091/sampleBuckets/install -d '["travel-sample"]'
35+
sed -i "s/\${DB_CONN_STR}/${{ secrets.DB_CONN_STR }}/g" src/main/resources/application.properties
36+
sed -i "s/\${DB_USERNAME}/${{ secrets.DB_USERNAME }}/g" src/main/resources/application.properties
37+
sed -i "s/\${DB_PASSWORD}/${{ secrets.DB_PASSWORD }}/g" src/main/resources/application.properties
6938
7039
- name: Run Gradle Tests
7140
id: run
@@ -79,18 +48,3 @@ jobs:
7948
notify_when: "failure"
8049
env:
8150
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
82-
83-
services:
84-
couchbase:
85-
image: public.ecr.aws/z2f7n8a1/couchbase-da-containers:couchbase-neo
86-
options: >-
87-
--health-cmd "wget -q -O - localhost:8091"
88-
--health-interval 10s
89-
--health-timeout 5s
90-
--health-retries 10
91-
ports:
92-
- 8091-8096
93-
- 9140
94-
- 11210-11211
95-
- 11207
96-
- 18091-18096
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
server.use-forward-headers=true
22
server.forward-headers-strategy=framework
3-
spring.couchbase.bootstrap-hosts=localhost
3+
spring.couchbase.bootstrap-hosts=${DB_CONN_STR}
44
spring.couchbase.bucket.name=travel-sample
5-
spring.couchbase.bucket.user=Administrator
6-
spring.couchbase.bucket.password=password
5+
spring.couchbase.bucket.user=${DB_USERNAME}
6+
spring.couchbase.bucket.password=${DB_PASSWORD}
77
spring.couchbase.scope.name=inventory
88
spring.mvc.pathmatch.matching-strategy=ANT_PATH_MATCHER
99

0 commit comments

Comments
 (0)