Skip to content
This repository was archived by the owner on Aug 6, 2021. It is now read-only.

Commit

Permalink
Reduce commerce mock image (#39)
Browse files Browse the repository at this point in the history
* Reduce commerce mock image

* Reduce number of steps
  • Loading branch information
pbochynski authored Nov 6, 2020
1 parent 8649492 commit b29ae5e
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 24 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/app-connector-e2e-gardener.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ jobs:
- name: Install Commerce Mock
run: |
./commerce-mock.sh
- name: Run End To End Test
run: |
./app-connector-example.sh
- name: Uninstall Kyma
run: |
./uninstall-kyma.sh
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/app-connector-e2e-k3s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ jobs:
./install-kyma.sh
sudo cp kyma.crt /usr/local/share/ca-certificates
sudo update-ca-certificates
- name: Install Commerce Mock
run: |
./commerce-mock.sh
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
- name: Run End To End Test
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/app-connector-e2e-kind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ jobs:
./install-kyma.sh
sudo cp kyma.crt /usr/local/share/ca-certificates
sudo update-ca-certificates
- name: Install Commerce Mock
run: |
./commerce-mock.sh
- name: Run End To End Test
run: |
./app-connector-example.sh
3 changes: 0 additions & 3 deletions .github/workflows/app-connector-e2e-minikube.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ jobs:
./install-kyma.sh
sudo cp kyma.crt /usr/local/share/ca-certificates
sudo update-ca-certificates
- name: Install Commerce Mock
run: |
./commerce-mock.sh
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
- name: Run End To End Test
Expand Down
9 changes: 6 additions & 3 deletions app-connector-example.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
kubectl apply -f commerce-mock.yaml

MOCK_HOST=""
while [[ -z $MOCK_HOST ]]; do echo "waiting for mock host"; MOCK_HOST=$(kubectl get virtualservice -n mocks -ojsonpath='{.items[0].spec.hosts[0]}'); sleep 1; done

Expand All @@ -15,9 +17,7 @@ apiVersion: applicationconnector.kyma-project.io/v1alpha1
kind: ApplicationMapping
metadata:
name: commerce
EOF

cat <<EOF | kubectl apply -f -
---
apiVersion: serverless.kyma-project.io/v1alpha1
kind: Function
metadata:
Expand Down Expand Up @@ -76,6 +76,9 @@ spec:
name: lastorder
EOF

MOCK_PROVIDER=""
while [[ -z $MOCK_PROVIDER ]]; do echo "waiting for commerce mock to be ready"; MOCK_PROVIDER=$(curl -sk https://$MOCK_HOST/local/apis |jq -r '.[0].provider') ; sleep 5; done

GATEWAY=""
while [[ -z $GATEWAY ]]; do echo "waiting for commerce gateway"; GATEWAY=$(kubectl -n kyma-integration get deployment commerce-application-gateway -ojsonpath='{.metadata.name}'); sleep 2; done

Expand Down
10 changes: 1 addition & 9 deletions commerce-mock.sh → commerce-mock.yaml
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
cat <<EOF |kubectl apply -f -
apiVersion: v1
kind: Namespace
metadata:
Expand Down Expand Up @@ -28,7 +27,7 @@ spec:
spec:
containers:
# - image: eu.gcr.io/kyma-project/xf-application-mocks/commerce-mock:latest
- image: pbochynski/commerce-mock-lite:0.2
- image: pbochynski/commerce-mock-lite:0.3
imagePullPolicy: Always
name: commerce-mock
ports:
Expand Down Expand Up @@ -85,10 +84,3 @@ spec:
host: commerce
name: commerce-mock
port: 10000
EOF

MOCK_HOST=""
while [[ -z $MOCK_HOST ]]; do echo "waiting for mock host"; MOCK_HOST=$(kubectl get virtualservice -n mocks -ojsonpath='{.items[0].spec.hosts[0]}'); sleep 3; done

MOCK_PROVIDER=""
while [[ -z $MOCK_PROVIDER ]]; do echo "waiting for commerce mock to be ready"; MOCK_PROVIDER=$(curl -sk https://$MOCK_HOST/local/apis |jq -r '.[0].provider') ; sleep 5; done

0 comments on commit b29ae5e

Please sign in to comment.