Skip to content

Commit

Permalink
Merge pull request #187 from OpenLiberty/staging
Browse files Browse the repository at this point in the history
Merge staging to prod - Fix SN test (#186)
  • Loading branch information
gkwan-ibm authored Jul 7, 2021
2 parents 96a218d + 4065531 commit d087e25
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion finish/system/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
<version>2.22.2</version>
<configuration>
<systemPropertyVariables>
<system.service.root>${system.node.port}</system.service.root>
<system.service.root>${system.service.root}</system.service.root>
</systemPropertyVariables>
</configuration>
</plugin>
Expand Down
26 changes: 16 additions & 10 deletions scripts/testAppSN.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,36 @@ docker push us.icr.io/"${NAMESPACE_NAME}"/system:1.0-SNAPSHOT

sed -i 's=system:1.0-SNAPSHOT=us.icr.io/'"${NAMESPACE_NAME}"'/system:1.0-SNAPSHOT=g' kubernetes.yaml
sed -i 's=inventory:1.0-SNAPSHOT=us.icr.io/'"${NAMESPACE_NAME}"'/inventory:1.0-SNAPSHOT=g' kubernetes.yaml
sed -i 's=nodePort: 31000==g' kubernetes.yaml
sed -i 's=nodePort: 32000==g' kubernetes.yaml

kubectl apply -f kubernetes.yaml

sleep 120
sleep 60

kubectl get pods

IPSTR=$(kubectl describe pod system | grep Node: | cut -c 15-)
IFS=/
read -r -a system_ip <<< "${IPSTR}"
curl http://"${system_ip[0]}":31000/system/properties
kubectl proxy &

IPSTR=$(kubectl describe pod inventory | grep Node: | cut -c 15-)
read -r -a inventory_ip <<< "${IPSTR}"
NAMESPACE_NAME=$(bx cr namespace-list | grep sn-labs- | sed 's/ //g')
SYSTEM_PROXY=localhost:8001/api/v1/namespaces/"$NAMESPACE_NAME"/services/system-service/proxy
INVENTORY_PROXY=localhost:8001/api/v1/namespaces/"$NAMESPACE_NAME"/services/inventory-service/proxy

curl http://"${inventory_ip[0]}":32000/inventory/systems
echo "$SYSTEM_PROXY" && echo "$INVENTORY_PROXY"

sed -i 's=localhost='"${inventory_ip[0]}"'=g' inventory/pom.xml
sed -i 's=localhost='"${system_ip[0]}"'=g' system/pom.xml
sed -i 's=localhost:31000='"$SYSTEM_PROXY"'=g' inventory/pom.xml
sed -i 's=localhost:32000='"$INVENTORY_PROXY"'=g' inventory/pom.xml
sed -i 's=localhost:31000='"$SYSTEM_PROXY"'=g' system/pom.xml

mvn failsafe:integration-test
mvn failsafe:verify

curl http://"${SYSTEM_PROXY}"/system/properties
curl http://"${INVENTORY_PROXY}"/inventory/systems

kubectl logs "$(kubectl get pods -o jsonpath='{range .items[*]}{.metadata.name}{"\n"}' | grep system)"
kubectl logs "$(kubectl get pods -o jsonpath='{range .items[*]}{.metadata.name}{"\n"}' | grep inventory)"

kill "$(pidof kubectl)"

kubectl delete -f kubernetes.yaml

0 comments on commit d087e25

Please sign in to comment.