ci: merge install into Unit Test stage, drop separate Install stage
Some checks failed
homelab-k8s-services/tcb_devportal/pipeline/head There was a failure building this commit
Some checks failed
homelab-k8s-services/tcb_devportal/pipeline/head There was a failure building this commit
This commit is contained in:
29
Jenkinsfile
vendored
29
Jenkinsfile
vendored
@@ -3,15 +3,12 @@
|
|||||||
import vn.fireflylab.pipeline.BranchStrategy
|
import vn.fireflylab.pipeline.BranchStrategy
|
||||||
|
|
||||||
// ── Stage functions ────────────────────────────────────────────────
|
// ── Stage functions ────────────────────────────────────────────────
|
||||||
def executeInstall() {
|
|
||||||
stage('Install') {
|
|
||||||
container('node') { runNodeInstall() }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
def executeUnitTest() {
|
def executeUnitTest() {
|
||||||
stage('Unit Test') {
|
stage('Unit Test') {
|
||||||
container('node') { runNodeTest(testCmd: 'run test:coverage') }
|
container('node') {
|
||||||
|
runNodeInstall()
|
||||||
|
runNodeTest(testCmd: 'run test:coverage')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,12 +43,12 @@ def executeBumpChart() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ── Pipeline ───────────────────────────────────────────────────────
|
// ── Pipeline ───────────────────────────────────────────────────────
|
||||||
// PR-* → install + test
|
// PR-* → test
|
||||||
// feature/* → install + test + scan + build + push
|
// feature/* → test + scan + build + push
|
||||||
// develop → install + test + scan + build + push
|
// develop → test + scan + build + push
|
||||||
// main → install + test + scan + build + push
|
// main → test + scan + build + push
|
||||||
// release/x.y.z → install + test + scan + build + push
|
// release/x.y.z → test + scan + build + push
|
||||||
// hotfix/* → install + test + scan + build + push
|
// hotfix/* → test + scan + build + push
|
||||||
|
|
||||||
podTemplate(yaml: homelabK8sAgent(withTools: true, withSonar: true)) {
|
podTemplate(yaml: homelabK8sAgent(withTools: true, withSonar: true)) {
|
||||||
node(POD_LABEL) {
|
node(POD_LABEL) {
|
||||||
@@ -59,40 +56,34 @@ podTemplate(yaml: homelabK8sAgent(withTools: true, withSonar: true)) {
|
|||||||
checkout scm
|
checkout scm
|
||||||
|
|
||||||
BranchStrategy.prStrategy(env.BRANCH_NAME) {
|
BranchStrategy.prStrategy(env.BRANCH_NAME) {
|
||||||
executeInstall()
|
|
||||||
executeUnitTest()
|
executeUnitTest()
|
||||||
}
|
}
|
||||||
|
|
||||||
BranchStrategy.featureStrategy(env.BRANCH_NAME) {
|
BranchStrategy.featureStrategy(env.BRANCH_NAME) {
|
||||||
executeInstall()
|
|
||||||
executeUnitTest()
|
executeUnitTest()
|
||||||
executeScanCodeQuality()
|
executeScanCodeQuality()
|
||||||
executeBuildPush()
|
executeBuildPush()
|
||||||
}
|
}
|
||||||
|
|
||||||
BranchStrategy.developStrategy(env.BRANCH_NAME) {
|
BranchStrategy.developStrategy(env.BRANCH_NAME) {
|
||||||
executeInstall()
|
|
||||||
executeUnitTest()
|
executeUnitTest()
|
||||||
executeScanCodeQuality()
|
executeScanCodeQuality()
|
||||||
executeBuildPush()
|
executeBuildPush()
|
||||||
}
|
}
|
||||||
|
|
||||||
BranchStrategy.mainStrategy(env.BRANCH_NAME) {
|
BranchStrategy.mainStrategy(env.BRANCH_NAME) {
|
||||||
executeInstall()
|
|
||||||
executeUnitTest()
|
executeUnitTest()
|
||||||
executeScanCodeQuality()
|
executeScanCodeQuality()
|
||||||
executeBuildPush()
|
executeBuildPush()
|
||||||
}
|
}
|
||||||
|
|
||||||
BranchStrategy.releaseStrategy(env.BRANCH_NAME) {
|
BranchStrategy.releaseStrategy(env.BRANCH_NAME) {
|
||||||
executeInstall()
|
|
||||||
executeUnitTest()
|
executeUnitTest()
|
||||||
executeScanCodeQuality()
|
executeScanCodeQuality()
|
||||||
executeBuildPush()
|
executeBuildPush()
|
||||||
}
|
}
|
||||||
|
|
||||||
BranchStrategy.hotfixStrategy(env.BRANCH_NAME) {
|
BranchStrategy.hotfixStrategy(env.BRANCH_NAME) {
|
||||||
executeInstall()
|
|
||||||
executeUnitTest()
|
executeUnitTest()
|
||||||
executeScanCodeQuality()
|
executeScanCodeQuality()
|
||||||
executeBuildPush()
|
executeBuildPush()
|
||||||
|
|||||||
Reference in New Issue
Block a user