generated from konveyor/template-repo
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: M Sajid Mansoori <mmansoor@redhat.com>
- Loading branch information
1 parent
eaca27b
commit 71b003b
Showing
1 changed file
with
98 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
@Library('migrationqe-automation-lib') _ | ||
pipeline{ | ||
agent { | ||
label 'minikube-node' | ||
} | ||
options{ | ||
ansiColor('xterm') | ||
} | ||
environment{ | ||
HUB_USERNAME="admin" | ||
PATH="$PATH:/usr/local/go/bin" | ||
HUB_PASSWORD="Passw0rd!" | ||
JIRA_CLOUD_PASSWORD=credentials('mta_jira_cloud_token') | ||
JIRA_SERVER_TOKEN=credentials('mta_jira_stage_token') | ||
} | ||
|
||
stages{ | ||
stage("Check if their are changed tests"){ | ||
when{ | ||
branch pattern: '^PR-.*$', | ||
comparator: 'REGEXP'; | ||
} | ||
steps{ | ||
script{ | ||
checkout scm | ||
env.RUN_TESTS = "true" | ||
tackle.setGoTestsEnvVars() //Sets env sensitive env vars | ||
} | ||
} | ||
} | ||
stage('Install & run minikube'){ | ||
when { | ||
expression{ | ||
env.RUN_TESTS == "true" | ||
} | ||
} | ||
steps{ | ||
script{ | ||
|
||
sh """ curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 | ||
chmod +x minikube | ||
minikube_homedir=/usr/local/bin/ | ||
|
||
sudo install minikube /usr/local/bin | ||
|
||
minikube delete | ||
sleep 20s | ||
minikube start --driver=podman --memory=4g | ||
minikube addons enable dashboard | ||
minikube addons enable ingress | ||
minikube addons enable olm | ||
kubectl apply -f https://raw.githubusercontent.com/operator-framework/operator-lifecycle-manager/master/deploy/upstream/quickstart/crds.yaml | ||
kubectl apply -f https://raw.githubusercontent.com/operator-framework/operator-lifecycle-manager/master/deploy/upstream/quickstart/olm.yaml | ||
|
||
kubectl apply -f https://raw.githubusercontent.com/konveyor/tackle2-operator/main/tackle-k8s.yaml | ||
|
||
while [ \$(kubectl get crd|grep tackle|wc -l) != 2 ] | ||
do echo "Waiting for Tackle CRDs..." | ||
sleep 5s | ||
done | ||
|
||
""" | ||
|
||
echo "Applying tackle CR" | ||
tackle.applyTackleCR() //Tackle CR will be applied with using default password `Passw0rd!`. | ||
} | ||
} | ||
} | ||
stage('Run tackle go api tests'){ | ||
when { | ||
expression{ | ||
env.RUN_TESTS == "true" | ||
} | ||
} | ||
steps{ | ||
script{ | ||
env.MINIKUBE_IP = sh( | ||
script : 'minikube ip', | ||
returnStdout: true | ||
).trim() | ||
env.HUB_BASE_URL="http://"+env.MINIKUBE_IP+"/hub" | ||
ocp.pollRouteUntilReady("http://"+env.MINIKUBE_IP,15,30) | ||
sh "sleep 40s" //Grace period after the application is serving correctly. | ||
sh (script:"make test-tier3", | ||
label: "Running tier3 tests" | ||
) | ||
} | ||
} | ||
} | ||
} | ||
post{ | ||
always{ | ||
script{ | ||
cleanWs() | ||
} | ||
} | ||
} | ||
} |