Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!groovy
- def application, manifest, git, environment, artifactory, sonar
- fileLoader.withGit('git@<reducted>', 'v1', '<reducted>') {
- application = fileLoader.load('<reducted>');
- manifest = fileLoader.load('<reducted>');
- git = fileLoader.load('<reducted>');
- environment = fileLoader.load('<reducted>');
- //artifactory = fileLoader.load('<reducted>');
- //sonar = fileLoader.load('<reducted>');
- }
- // def deployStage = environment.<reducted>()
- // def artifactoryServer = artifactory.getArtifactoryServerName()
- def projectName = null
- def githubOrg = null
- def gitCommit = null
- pipeline {
- agent { label 'cf_slave' }
- options {
- skipDefaultCheckout()
- }
- stages {
- stage ("Checkout SCM") {
- steps {
- checkout scm
- script {
- projectName = git.getGitRepositoryName()
- githubOrg = git.getGitOrgName()
- gitCommit = manifest.getGitCommit()
- }
- }
- }
- stage ("Unit tests") {
- steps {
- sh "./node_modules/.bin/mocha --reporter mocha-junit-reporter --reporter-options mochaFile=./testResults/results.xml"
- junit allowEmptyResults: true, testResults: 'testResults/results.xml'
- }
- }
- stage ("SonarQube analysis (TODO)") {
- steps {
- //sonar.replaceTokensAndRunScanner(githubOrg, projectName)
- echo "SonarQube analysis - todo"
- }
- }
- stage("Simple publication (INACTIVE)") {
- steps {
- echo "Simple publication - inactive"
- // Login
- //sh "cf api <reducted>"
- //sh "cf login -u <reducted> -p <reducted>"
- // Deploy
- //sh "cf push"
- }
- }
- }
- post {
- success {
- sh "echo 'Pipeline reached the finish line!'"
- // Notify in Slack
- slackSend color: 'yellow', message: "The Pipeline operation completed successfully. You can check results here: <reducted>"
- }
- failure {
- sh "echo 'Pipeline failed'"
- // Notify in Slack
- slackSend color: 'red', message: "One of the Pipeline stages failed. Check the log file: <reducted>"
- //Clean the execution workspace
- deleteDir()
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement