Skip to content

Commit 12eca6a

Browse files
committed
ci: add PR check for allow-list
1 parent 793ea72 commit 12eca6a

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

.github/workflows/test-sample-apps.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
pull_request_target:
55
branches: [ main ]
66
types: [ opened, synchronize, reopened ]
7+
workflow_dispatch:
78

89
permissions:
910
pull-requests: write
@@ -57,7 +58,7 @@ jobs:
5758
run: cf8 login -a "${{ secrets.CF_API }}" -u "${{ secrets.CF_USERNAME }}" -p "${{ secrets.CF_PASSWORD }}" -o "${{ secrets.CF_ORG }}" -s "${{ secrets.CF_SPACE }}" --origin uaa
5859
- name: Deploy CloudFoundry sample apps
5960
run: cf8 push -f "${GITHUB_WORKSPACE}/http2/apps-manifest.yml" --var domain=${{ secrets.CF_DOMAIN }} --var hostname_prefix="$HOSTNAME_PREFIX" --vars-file "${GITHUB_WORKSPACE}/http2/gradle.properties"
60-
- name: Test Sample apps
61+
- name: Test HTTP/2 Sample apps
6162
run: |
6263
get_route() {
6364
echo "${HOSTNAME_PREFIX}${1}.${{ secrets.CF_DOMAIN }}"
@@ -72,13 +73,28 @@ jobs:
7273
grpcurl -proto http2/node-grpc/example.proto $(get_route node-grpc-test):443 Example.Run
7374
grpcurl -proto http2/python-grpc/example.proto $(get_route python-grpc-test):443 Example.Run
7475
grpcurl -proto http2/ruby-grpc/example.proto $(get_route ruby-grpc-test):443 Example.Run
76+
- name: Deploy IP Allow-List Sample App
77+
run: |
78+
cf8 push --var "domain=${{ secrets.CF_DOMAIN }}" --var "suffix=${HOSTNAME_PREFIX}" --manifest "${GITHUB_WORKSPACE}/ip-allow-listing-route-service/manifest.yml"
79+
cf8 create-user-provided-service "allow-list-${HOSTNAME_PREFIX}" -r "https://ip-allow-list-rs-${HOSTNAME_PREFIX}.${{ secrets.CF_DOMAIN }}"
80+
cf8 bind-route-service "${{ secrets.CF_DOMAIN }}" --hostname "ok-${HOSTNAME_PREFIX}" "allow-list-${HOSTNAME_PREFIX}"
81+
- name: Test IP Allow-List Sample App
82+
run: |
83+
echo "Test IPv4 is accesible"
84+
test "$(curl --silent --output /dev/null --write-out "%{http_code}" -4 "https://ok-${HOSTNAME_PREFIX}.cfapps.eu12.hana.ondemand.com")" -eq 200
7585
- name: Clean-up
7686
if: success() || failure()
7787
run: |
88+
echo "Deleting service instance"
89+
cf8 -f delete-service "allow-list-${HOSTNAME_PREFIX}" || true
7890
echo "Deleting apps and routes"
7991
yq e '.applications.[].name' "${GITHUB_WORKSPACE}/http2/apps-manifest.yml" | while read -r app_name; do
8092
echo "Deleting app: $app_name"
81-
cf8 delete "$app_name" -r -f
93+
cf8 delete "$app_name" -r -f || true
94+
done
95+
yq e '.applications.[].name' "${GITHUB_WORKSPACE}/ip-allow-listing-route-service/manifest.yml" | while read -r app_name; do
96+
echo "Deleting app: $app_name"
97+
cf8 delete "$app_name" -r -f || true
8298
done
8399
automerge:
84100
runs-on: ubuntu-latest

ip-allow-listing-route-service/manifest.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
applications:
22
- name: ip-allow-listing-route-service
3+
path: .
34
lifecycle: cnb
45
buildpacks:
56
- docker://docker.io/paketobuildpacks/go

0 commit comments

Comments
 (0)