Skip to content
Snippets Groups Projects
Jenkinsfile 1.38 KiB
Newer Older
Chef Projet Prodige's avatar
Chef Projet Prodige committed
pipeline {
  agent any
ndurand's avatar
ndurand committed
  options {
    timestamps ()
    disableConcurrentBuilds()
  }
Chef Projet Prodige's avatar
Chef Projet Prodige committed
  stages {
    stage('Fetch dependencies'){
ndurand's avatar
ndurand committed
      //environment {
      //  NEXUS = credentials('Nexus')
      //}
Chef Projet Prodige's avatar
Chef Projet Prodige committed
      agent any
      steps {
        sh 'cicd/build/0_fetch-dependencies.sh'
ndurand's avatar
ndurand committed
        stash includes: 'site/node_modules/', name: 'node_modules', useDefaultExcludes: false, allowEmpty: true
Chef Projet Prodige's avatar
Chef Projet Prodige committed
      }
    }
    //stage('Lint') {
    //  agent any
    //  steps {
    //    unstash 'node_modules'
    //    sh 'cicd/build/1_lint.sh', useDefaultExcludes: false, allowEmpty: true
    //  }
    //}
    stage('Build prod') {
      agent any
      steps {
        unstash 'node_modules'
        sh 'cicd/build/3_build-prod.sh'
ndurand's avatar
ndurand committed
        stash includes: 'site/dist/', name: 'dist', useDefaultExcludes: false, allowEmpty: true
Chef Projet Prodige's avatar
Chef Projet Prodige committed
      }
    }
    stage('Make release') {
      agent any
      steps {
        unstash 'dist'
        sh 'cicd/build/5_make_release.sh'
        stash includes: 'jenkins_release/', name: 'jenkins_release', useDefaultExcludes: false, allowEmpty: true
      }
    }
    stage('Make docker') {
      agent any
      steps {
        unstash 'jenkins_release'
        sh 'cicd/build/6_make_docker.sh'
        stash includes: 'jenkins_release/', name: 'jenkins_release', useDefaultExcludes: false, allowEmpty: true
      }
    }
  }
  post {
    always {
        sh 'cicd/build/99_clean.sh'
    }
  }
}