Skip to content

Instantly share code, notes, and snippets.

@Osein
Osein / systemjs.config.js
Created May 20, 2016 08:15
AngularJS Quickstart missing file
/**
* PLUNKER VERSION (based on systemjs.config.js in angular.io)
* System configuration for Angular 2 samples
* Adjust as necessary for your application needs.
*/
(function(global) {
var ngVer = '@2.0.0-rc.1'; // lock in the angular package version; do not let it float to current!
//map tells the System loader where to look for things
pipeline {
agent any
stages {
stage("Build") {
//…
}
stage("Test") {
//…
}
node {
stage ("Build") {
//…
}
stage ("Test") {
//…
}
}
@Osein
Osein / Jenkinsfile
Last active September 15, 2019 10:55
#!groovy
def lastCommitInfo = ""
def skippingText = ""
def commitContainsSkip = 0
def slackMessage = ""
def shouldBuild = false
def pollSpec = ""
stage('Init') {
steps {
script {
lastCommitInfo = sh(script: "git log -1", returnStdout: true).trim()
commitContainsSkip = sh(script: "git log -1 | grep '.*\\[skip ci\\].*'", returnStatus: true)
if(commitContainsSkip == 0) {
skippingText = "Skipping commit."
env.shouldBuild = false
currentBuild.result = "NOT_BUILT"
stage('Run Unit and UI Tests') {
when {
expression {
return env.shouldBuild != "false"
}
}
steps {
script {
try {
// Run your tests here
stage('Build application for beta') {
when {
expression {
return env.shouldBuild != "false"
}
}
steps {
// Build application for pre-prod servers
}
}
stage('Deploy to beta') {
when {
expression {
return env.shouldBuild != "false"
}
}
steps {
// Deploy new build to pre-prod environments
}
}
stage('Build application for prod') {
when {
expression {
return env.shouldBuild != "false" && env.BRANCH_NAME == "master"
}
}
steps {
// Build your application for prod servers
}
}
stage('Send to Prod') {
when {
expression {
return env.shouldBuild != "false" && env.BRANCH_NAME == "master"
}
}
steps {
// Deploy your application to prod servers
}
}