-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING CHANGE: Environment variables have been removed/renamed This removes CircleCI and goes with Jenkins and sets up for the 2.0.0 release Ref: #4
- Loading branch information
Showing
14 changed files
with
5,894 additions
and
1,257 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
library 'magic-butler-catalogue' | ||
|
||
def PROJECT_NAME = "logdna-s3" | ||
def REPO = "logdna/${PROJECT_NAME}" | ||
def TRIGGER_PATTERN = ".*@logdnabot.*" | ||
def CURRENT_BRANCH = [env.CHANGE_BRANCH, env.BRANCH_NAME]?.find{branch -> branch != null} | ||
def DEFAULT_BRANCH = 'master' | ||
|
||
pipeline { | ||
agent none | ||
|
||
options { | ||
timestamps() | ||
ansiColor 'xterm' | ||
} | ||
|
||
triggers { | ||
issueCommentTrigger(TRIGGER_PATTERN) | ||
} | ||
|
||
stages { | ||
stage('Validate PR Source') { | ||
when { | ||
expression { env.CHANGE_FORK } | ||
not { | ||
triggeredBy 'issueCommentCause' | ||
} | ||
} | ||
steps { | ||
error("A maintainer needs to approve this PR for CI by commenting") | ||
} | ||
} | ||
|
||
stage('Test Suite') { | ||
matrix { | ||
axes { | ||
axis { | ||
name 'NODE_VERSION' | ||
values '12', '14', '16' | ||
} | ||
} | ||
|
||
agent { | ||
docker { | ||
image "us.gcr.io/logdna-k8s/node:${NODE_VERSION}-ci" | ||
} | ||
} | ||
|
||
environment { | ||
GITHUB_TOKEN = credentials('github-api-token') | ||
} | ||
|
||
stages { | ||
stage('Test') { | ||
steps { | ||
sh 'mkdir -p coverage' | ||
sh 'npm ci' | ||
sh 'npm run test:ci' | ||
} | ||
|
||
post { | ||
always { | ||
junit 'coverage/test.xml' | ||
|
||
publishHTML target: [ | ||
allowMissing: false, | ||
alwaysLinkToLastBuild: false, | ||
keepAll: true, | ||
reportDir: 'coverage/lcov-report', | ||
reportFiles: 'index.html', | ||
reportName: "coverage-node-v${NODE_VERSION}" | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
stage('Test Release') { | ||
when { | ||
beforeAgent true | ||
not { | ||
branch DEFAULT_BRANCH | ||
} | ||
} | ||
|
||
agent { | ||
docker { | ||
image "us.gcr.io/logdna-k8s/node:12-ci" | ||
customWorkspace "${PROJECT_NAME}-${BUILD_NUMBER}" | ||
} | ||
} | ||
|
||
environment { | ||
GITHUB_TOKEN = credentials('github-api-token') | ||
GIT_BRANCH = "${CURRENT_BRANCH}" | ||
BRANCH_NAME = "${CURRENT_BRANCH}" | ||
CHANGE_ID = "" | ||
} | ||
|
||
steps { | ||
sh 'npm run package' | ||
sh 'npm ci' | ||
sh "npm run release:dry" | ||
} | ||
} | ||
|
||
stage('Release') { | ||
when { | ||
beforeAgent true | ||
branch DEFAULT_BRANCH | ||
} | ||
|
||
agent { | ||
docker { | ||
image "us.gcr.io/logdna-k8s/node:12-ci" | ||
customWorkspace "${PROJECT_NAME}-${BUILD_NUMBER}" | ||
} | ||
} | ||
|
||
environment { | ||
GITHUB_TOKEN = credentials('github-api-token') | ||
} | ||
|
||
steps { | ||
sh 'npm run package' | ||
sh 'npm ci' | ||
sh 'npm run release' | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.