forked from pivotal-cf/cf-redis-example-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixup!chore(github-action): build cnb image - remove host network, us…
…e link instead
- Loading branch information
Showing
2 changed files
with
23 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,18 +9,19 @@ on: | |
- "v?[0-9]+.[0-9]+.[0-9]+*" | ||
env: | ||
CNB_IMAGE_NAME: cnb-app | ||
SERVICE_VERSION: '6.0' | ||
SERVICE_PORT: 6379 # Default value: 27017 | ||
SERVICE_USERNAME: '22032e25-4aba-417f-a394-8bbd78d920cd' | ||
# SERVICE_VERSION: '6.0' | ||
SERVICE_HOST: redis | ||
SERVICE_PORT: 6379 | ||
# SERVICE_USERNAME: '22032e25-4aba-417f-a394-8bbd78d920cd' | ||
SERVICE_PASSWORD: 'StbQ4EovUpwQjD0cT1Hr7PKBG' | ||
DATABASE_NAME: my-redis-db | ||
# DATABASE_NAME: my-redis-db | ||
|
||
jobs: | ||
package-app: | ||
name: "Package ${{ github.repository }} as CNB app" | ||
runs-on: ubuntu-latest | ||
services: | ||
redis: | ||
redis-service: | ||
# Docker Hub image | ||
image: redis | ||
# Set health checks to wait until redis has started | ||
|
@@ -49,8 +50,8 @@ jobs: | |
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
with: | ||
driver-opts: network=host | ||
# with: | ||
# driver-opts: network=host | ||
- | ||
name: Setup pack for ${{ github.repository }} | ||
uses: buildpacks/github-actions/[email protected] | ||
|
@@ -80,7 +81,7 @@ jobs: | |
cat vcap-services-template.sh|envsubst >vcap-service.env | ||
cat vcap-service.env | ||
echo "Starting sample app" | ||
container_id=$(docker run -d --network host -e PORT=8080 --env-file vcap-service.env --name "cnb-app-container" ${{env.CNB_IMAGE_NAME}}) | ||
container_id=$(docker run -d --link redis-service -e PORT=8080 --env-file vcap-service.env --name "cnb-app-container" ${{env.CNB_IMAGE_NAME}}) | ||
echo "Cnb app started (id: $container_id)" | ||
docker inspect -f '{{.HostConfig.LogConfig.Type}}' $container_id | ||
# docker run -e PORT=80 --env-file vcap-service.env -p 8080:80 --name "cnb-app-container" ${{env.CNB_IMAGE_NAME}} | ||
|
@@ -108,7 +109,7 @@ jobs: | |
echo "Dumping logs using docker logs cnb-app-container" | ||
docker logs cnb-app-container | ||
ls -lrt | ||
exit $exit_status | ||
#exit $exit_status | ||
- | ||
name: Tag version ${{github.ref_name}} | ||
if: github.ref_type == 'tag' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,30 @@ | ||
VCAP_SERVICES=' | ||
{ | ||
"mongodb-dedicated":[ | ||
"redis-dedicated":[ | ||
{ | ||
"binding_guid":"${SERVICE_USERNAME}", | ||
"binding_guid":"532023be-5847-4dc7-90f4-2f207f2bb440", | ||
"binding_name":null, | ||
"credentials":{ | ||
"database":"${DATABASE_NAME}", | ||
"hostname":"localhost:${SERVICE_PORT}", | ||
"host":"${SERVICE_HOST}", | ||
"password":"${SERVICE_PASSWORD}", | ||
"uri":"mongodb://${SERVICE_USERNAME}:${SERVICE_PASSWORD}@localhost:${SERVICE_PORT}/${DATABASE_NAME}?replicaSet=rs0", | ||
"username":"${SERVICE_USERNAME}" | ||
"port":"${SERVICE_PORT}" | ||
}, | ||
"instance_guid":"cc252ef5-2541-49fd-8a57-fe73957905a5", | ||
"instance_name":"mongodb-github-test", | ||
"label":"mongodb-dedicated", | ||
"name":"mongodb-github-test", | ||
"instance_guid":"98645cee-2810-408c-abcd-2c2b41fed9aa", | ||
"instance_name":"redis-smoketest-1727200788", | ||
"label":"redis-dedicated", | ||
"name":"redis-smoketest-1727200788", | ||
"plan":"small", | ||
"provider":null, | ||
"syslog_drain_url":null, | ||
"tags":[ | ||
"mongodb", | ||
"document" | ||
"Redis", | ||
"Document" | ||
], | ||
"volume_mounts":[] | ||
} | ||
] | ||
} | ||
' |