2022-06-09 08:06:50 +00:00
|
|
|
/*
|
|
|
|
//Original Pipeline
|
|
|
|
|
|
|
|
pipeline {
|
|
|
|
agent { dockerfile true }
|
|
|
|
stages {
|
|
|
|
stage('Test') {
|
|
|
|
steps {
|
|
|
|
echo "Build has worked!"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
|
|
|
|
//New Pipeline
|
|
|
|
|
2022-06-08 17:35:09 +00:00
|
|
|
pipeline {
|
2022-06-09 07:45:33 +00:00
|
|
|
agent none
|
2022-06-09 08:06:50 +00:00
|
|
|
/*
|
|
|
|
//For some reason, this scrashes Jenkins
|
|
|
|
|
|
|
|
tools {
|
|
|
|
nodejs "815Node"
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* We won't be Pushing to Dockerhub YET
|
|
|
|
environment {
|
|
|
|
registry = 'dockerhubusername/dockerhubusername'
|
|
|
|
registryCredential = 'dockerhubcredentials'
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
|
2022-06-09 07:45:33 +00:00
|
|
|
stages {
|
|
|
|
stage('INSTALL PACKAGES') {
|
|
|
|
agent any
|
|
|
|
steps {
|
|
|
|
sh "npm install"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('CODETEST') {
|
|
|
|
agent any
|
|
|
|
steps {
|
|
|
|
echo "insert your testing here"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('BUILD APP') {
|
|
|
|
agent any
|
|
|
|
steps {
|
|
|
|
sh "node_modules/.bin/ng build --prod"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Angular frontend Karma Test') {
|
|
|
|
agent any
|
|
|
|
steps {
|
|
|
|
sh 'npm rebuild'
|
|
|
|
sh 'npm run test'
|
|
|
|
sh 'ng test'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage("BUILD DOCKER") {
|
|
|
|
agent {
|
|
|
|
dockerfile true
|
|
|
|
}
|
|
|
|
steps {
|
|
|
|
script {
|
|
|
|
dockerImageBuild = docker.build registry + ":latest"
|
2022-06-08 17:35:09 +00:00
|
|
|
}
|
2022-06-09 07:45:33 +00:00
|
|
|
}
|
2022-06-08 17:35:09 +00:00
|
|
|
}
|
2022-06-09 08:06:50 +00:00
|
|
|
/*
|
|
|
|
// Again, no pushing to Docker Hub
|
|
|
|
|
|
|
|
stage("DEPLOY DOCKER") {
|
|
|
|
steps {
|
|
|
|
script {
|
|
|
|
docker.withRegistry('', registryCredential) {
|
|
|
|
dockerImageBuild.push()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage("DEPLOY & ACTIVATE") {
|
|
|
|
steps {
|
|
|
|
echo 'this part will differ depending on setup'
|
|
|
|
}
|
|
|
|
}
|
2022-06-09 07:45:33 +00:00
|
|
|
}
|
|
|
|
}
|