Commit 92bd63df authored by Asad Ullah Khan's avatar Asad Ullah Khan

added jenkinsfile

parent 44d5b176
pipeline {
agent { label 'master' }
environment {
GCLOUD_PATH ="/home/asad/google-cloud-sdk/bin"
}
stages {
stage('build') {
steps {
echo "Hello World!"
sh """
echo "Atrifact version is "$artifactVersion
echo "Atrifact name is "$artifactName
echo "Atrifact Environment is "$environment
echo ${env.JOB_NAME}
echo ${BUILD_NUMBER}
"""
}
}
}
post {
always{
script
{
sh """
cat <<'EOF' > output.json
{
"artifactName": "$artifactName",
"artifactVersion": "$artifactVersion",
"environment": "$environment",
"requesterEmail": "$requesterEmail",
"approverEmail": "$approverEmail",
"projectName": "$projectName",
"intendID": "$intendID",
"jobId": "$BUILD_NUMBER"
}
"""
sh 'cat output.json'
sh 'cat output.json | jq "." '
sh '$GCLOUD_PATH/gcloud pubsub topics publish trigger-func-db --message "$(cat output.json | jq ".")"'
}
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment