Skip to content

Instantly share code, notes, and snippets.

@yasassri
Created March 15, 2021 16:46
Show Gist options
  • Save yasassri/097c0b37a20217844e4001642c619cbd to your computer and use it in GitHub Desktop.
Save yasassri/097c0b37a20217844e4001642c619cbd to your computer and use it in GitHub Desktop.
import groovy.transform.Field
// Constantants
@Field final def BITBUCKET_URL = "https://github.com/yasassri/unittest-build-demo.git"
@Field final def DOCKER_IMAGE = "ycrnet/wso2mi-1.2.0-unittest:1.0.0"
@Field final def DOCKER_CONTAINER_NAME = "wso2-mi-test"
pipeline {
agent {label ''}
environment {
BUILD_TIMESTAMP = sh(script: "echo `date +%d%m%Y`", returnStdout: true).trim()
}
stages {
stage('Clone Intergration Source from Github') {
steps {
script {
deleteDir()
echo "Cloning Github repository"
sh "git clone $BITBUCKET_URL"
}
}
}
stage("Start MI Server"){
steps {
script {
def workspaceLocation = pwd()
sh """
# We can execute the maven command directly as well, but I'm using a script for this.
docker run -v ${workspaceLocation}/unittest-build-demo:/workspace --workdir /workspace ${DOCKER_IMAGE} 'sh resources/scripts/build.sh'
"""
}
}
}
stage('Deploying the Capp to Dev') {
steps {
script {
def workspaceLocation = pwd()
sh """
ls ${workspaceLocation}/unittest-build-demo/WSO2API_Test_Demo/WSO2API_Test_DemoCompositeExporter/target
"""
echo "Deploy the CApp to the development environment"
}
}
}
stage('Running JMeter Integration Tests') {
steps {
script {
echo "Running JMeter Integration TestTestst!!!"
// sh"""
// sleep 10
// /Users/yasassri/soft/jmeter/apache-jmeter-4.0/bin/jmeter -n -t repository/cicd/IntegrationTest.jmx -l rusults.jtl
// """
}
}
}
}
post {
always {
echo 'The process is successfully Completed....'
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment