Skip to content

Instantly share code, notes, and snippets.

@msfidelis
Last active August 6, 2019 02:14
Show Gist options
  • Save msfidelis/6fab7661519481f0aebf4de1ae6d7be0 to your computer and use it in GitHub Desktop.
Save msfidelis/6fab7661519481f0aebf4de1ae6d7be0 to your computer and use it in GitHub Desktop.
pipeline {
// agent any
agent { label 'jenkins-ecs-build' }
stages {
stage('Privisioning Slave') {
steps {
echo 'Done...'
}
}
// Build General Dependencies
stage('Dependencies') {
steps {
sh "apt-get install -y"
sh "curl -sL https://deb.nodesource.com/setup_8.x | bash -"
sh "apt-get install -y nodejs"
}
}
// Build package and install vendor packages
stage('Build') {
steps {
echo 'Building..'
sh "git clone https://github.com/msfidelis/micro-api.git"
dir("micro-api/") {
sh "pwd"
sh "npm install"
sh "ls -lha"
}
}
}
stage('Linter') {
steps {
dir("micro-api/") {
echo 'Fake linter...'
}
}
}
// Run unit tests
stage('Unit Tests') {
steps {
dir("micro-api/") {
sh "ls -lha"
echo 'Testing..'
sh "npm run unit-test"
}
}
}
// Deploy
stage('Deploy') {
steps {
echo 'Fake Deploy'
}
}
}
post {
always {
// Clean Workspace
cleanWs()
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment