Remove Vici from Easy2Use bundles (#87) #25
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
name: easy2use-ci | |
on: | |
push: | |
branches: | |
- issue-87 | |
pull_request: | |
branches: | |
- issue-87 | |
env: | |
DOMAIN: eiffel4eiffel.nordix.org | |
NAMESPACE: eiffel | |
TARGET: Kubernetes | |
BUNDLE: Eiffel | |
PATH_TO_BUNDLE: ./bundles | |
READY_POD_TIMEOUT: 120s | |
jobs: | |
build: | |
runs-on: self-hosted | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Kubernetes Version | |
run: | | |
: # Get kubectl version | |
kubectl version | |
- name: Install Easy2Use on cluster | |
id: installation | |
run: | | |
: # Create the NAMESPACE | |
kubectl create ns $NAMESPACE | |
: # Install the BUNDLE via easy2use | |
./easy2use start -t $TARGET -d $DOMAIN -e $PATH_TO_BUNDLE -n $NAMESPACE $BUNDLE -y | |
: # Wait until all pods are running | |
kubectl wait pod \ | |
--all \ | |
--for=condition=Ready \ | |
--field-selector=status.phase=Running \ | |
--selector job-name!=mongodb-seed \ | |
--namespace=$NAMESPACE \ | |
--timeout=$READY_POD_TIMEOUT | |
: # Check that the mongodb seed job is completed | |
kubectl wait \ | |
--for=condition=complete \ | |
--namespace=$NAMESPACE \ | |
job/mongodb-seed | |
- name: List the Eiffel pods and ingresses | |
run: | | |
kubectl get pods -n $NAMESPACE | |
kubectl get ingress -n $NAMESPACE | |
: # Wait for a while | |
echo "Waiting..." && sleep 30 | |
- name: Get the EI-frontend subscriptions | |
run: | | |
cd ./utilities/eiffel && \ | |
bash ei_subscriptions.bash -d $DOMAIN -n $NAMESPACE | |
- name: POST an Eiffel ArtC event | |
run: | | |
cd ./utilities/eiffel && \ | |
bash remrem_publish_event.bash -d $DOMAIN -n $NAMESPACE | |
: # Wait for a while until the processing of the events | |
echo "Waiting..." && sleep 90 | |
- name: Ensure that Jenkins jobs executed successfully | |
run: | | |
: # The ArtC event should trigger three different jobs. | |
: # ei-artifact-triggered-job, ei-artifact-triggered-parameterized-job | |
: # and event-triggered-job | |
cd ./utilities/eiffel && \ | |
output=$(bash er_events.bash -d $DOMAIN -n $NAMESPACE -l 8 | bash jq_query.bash | wc -l) | |
echo "Output: ${output}" | |
if [ $output -eq 3 ]; | |
then | |
echo "Jenkins jobs passed." | |
else | |
echo "Jenkins jobs failed." && exit 1 | |
fi | |
- name: Remove Easy2Use from cluster | |
id: removal | |
if: always() | |
run: | | |
: # Remove the BUNDLE from the cluster via easy2use | |
./easy2use remove -t $TARGET -d $DOMAIN -e $PATH_TO_BUNDLE -n $NAMESPACE $BUNDLE -y | |
: # Delete the NAMESPACE | |
kubectl delete ns $NAMESPACE |