Skip to content

Commit b04d62a

Browse files
committed
ci: add cloud foundyr test
Signed-off-by: Rifa Achrinza <25147899+achrinza@users.noreply.github.com>
1 parent 97d1858 commit b04d62a

2 files changed

Lines changed: 68 additions & 0 deletions

File tree

.github/workflows/continuous-integration.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,71 @@ jobs:
4242
- name: Run tests
4343
run: npm test --ignore-scripts
4444

45+
cf-deployment-test:
46+
name: Cloud Foundry Deployment Test
47+
runs-on: ubuntu-latest
48+
steps:
49+
- uses: engineerd/setup-kind@v0.5.0
50+
with:
51+
name: kubecf
52+
- name: Test Deployment
53+
run: |
54+
kubectl cluster-info
55+
kubectl get pods -n kube-system
56+
echo "current-context:" $(kubectl config current-context)
57+
echo "environment-kubeconfig:" ${KUBECONFIG}
58+
- name: Clone KubeCF Git Repo
59+
run: git clone --depth=1 https://github.com/cloudfoundry-incubator/kubecf.git
60+
61+
- name: Download cf-operator and KubeCF Helm Charts Bundle
62+
run: |
63+
curl -s https://api.github.com/repos/cloudfoundry-incubator/kubecf/releases/latest \
64+
| grep -oP '"browser_download_url": "\K(.*)kubecf-bundle(.*)(?=")' \
65+
| wget -qi -
66+
tar xf kubecf-bundle-v*.tgz
67+
68+
- name: Install KubeCF Required Tools
69+
run: |
70+
pushd ./kubecf
71+
make -I ./kubecf tools-install
72+
popd
73+
74+
- name: Install cf-operator
75+
run: |
76+
kubectl create ns cfo
77+
helm install cf-operator \
78+
--namespace cfo \
79+
--set "global.singleNamespace.name=kubecf" \
80+
./cf-operator.tgz
81+
kubectl wait \
82+
--namespace cfo \
83+
--for=condition=ready pod \
84+
--timeout=30m \
85+
--all
86+
- name: Install KubeCF
87+
run: |
88+
# Configure KubeCF with Node IP address
89+
node_ip=$(kubectl get node kubecf-control-plane \
90+
--output jsonpath='{ .status.addresses[?(@.type == "InternalIP")].address }')
91+
cat << _EOF_ > values.yaml
92+
system_domain: ${node_ip}.nip.io
93+
services:
94+
router:
95+
externalIPs:
96+
- ${node_ip}
97+
_EOF_
98+
99+
# Trust the kubernetes root CA on the kind docker container:
100+
docker exec -t "kubecf-control-plane" bash -c 'cp /etc/kubernetes/pki/ca.crt /etc/ssl/certs/ && \
101+
update-ca-certificates && \
102+
(systemctl list-units | grep containerd > /dev/null && systemctl restart containerd)'
103+
104+
# Install KubeCF
105+
helm install kubecf \
106+
--namespace kubecf \
107+
--values values.yaml \
108+
./kubecf_release.tgz
109+
45110
code-lint:
46111
name: Code Lint
47112
runs-on: ubuntu-latest

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "ci/cf-for-k8s"]
2+
path = ci/cf-for-k8s
3+
url = git@github.com:cloudfoundry/cf-for-k8s.git

0 commit comments

Comments
 (0)