pipeline { // Initially run on any agent agent { label 'docker-amd64' } options { timestamps () } environment { //Set some defaults def workspace = pwd() } stages { // for debugging purposes stage('report') { steps { echo "Branch/Tag : ${env.GIT_BRANCH}" echo "Commit Hash : ${env.GIT_COMMIT}" echo "Workspace directory : ${workspace}" } } stage('Clone Docs') { steps { dir('galasa.dev') { deleteDir() } sh 'mkdir galasa.dev' dir('galasa.dev') { git(url: 'https://github.com/galasa-dev/galasa.dev.git', branch: "master") } } } stage('Build Docs') { steps { dir('galasa.dev') { sh "npm install" dir('public') { deleteDir() } sh "npm run build" } } } stage('Build Docker Image') { steps { withFolderProperties { dir('docker/docs') { dir('public') { deleteDir() } sh "cp -R ../../galasa.dev/public ." sh "docker build -t ${env.DOCKER_REPO}/galasa-docs-generic:${env.DOCKER_VERSION} ." } } } } stage('Push Docker Image') { steps { withFolderProperties { dir('docker/docs') { sh "docker push ${env.DOCKER_REPO}/galasa-docs-generic:${env.DOCKER_VERSION}" } } } } } // post { // // triggered when red sign // failure { // slackSend (channel: '#project-galasa-devs', color: '#FF0000', message: "FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})") // } // } }