Commit 0e49f799 authored by daidekun's avatar daidekun

beautyEcho

parent 07ce10c4
// src/org/foo/Stage.groovy // src/org/foo/Stage.groovy
package org.qg; package org.qg;
import groovy.json.JsonSlurperClassic; import groovy.json.JsonSlurperClassic;
import org.qg.Utils;
def prepare_java(systemName, contextDir) { def prepare_java(systemName, contextDir) {
sh "rm -rf ${contextDir}" sh "rm -rf ${contextDir}"
......
...@@ -6,3 +6,7 @@ def contextDir(workspace) { ...@@ -6,3 +6,7 @@ def contextDir(workspace) {
contextDir = "tmp-context" contextDir = "tmp-context"
return contextDir return contextDir
} }
def beautyEcho(no, content) {
echo "===============Stage[${no}]==${content}==============="
}
\ No newline at end of file
...@@ -30,18 +30,17 @@ def call(body) { ...@@ -30,18 +30,17 @@ def call(body) {
node { node {
try { try {
stage('Clean') { stage('Clean') {
echo "===============Stage[1] Clean===============" _utils.beautyEcho(1, 'Clean')
_stage.clean_dir() _stage.clean_dir()
} }
stage('Checkout') { stage('Checkout') {
echo "===============Stage[2] Checkout===============" _utils.beautyEcho(2, 'Checkout')
_stage.checkout(branchName, gitRepo) _stage.checkout(branchName, gitRepo)
} }
stage('Prepare') { stage('Prepare') {
echo "===============Stage[3] prepare===============" _utils.beautyEcho(3, 'Prepare')
echo "buildType is: ${config.buildType}"
contextDir = _utils.contextDir(workspace) contextDir = _utils.contextDir(workspace)
switch (config.buildType) { switch (config.buildType) {
case "java": case "java":
...@@ -63,7 +62,7 @@ def call(body) { ...@@ -63,7 +62,7 @@ def call(body) {
} }
stage('Build') { stage('Build') {
echo "===============Stage[4] Build===============" _utils.beautyEcho(4, 'Build')
switch (config.buildType) { switch (config.buildType) {
case "java": case "java":
_stage.build_java(namespace, systemName, contextDir) _stage.build_java(namespace, systemName, contextDir)
...@@ -84,7 +83,7 @@ def call(body) { ...@@ -84,7 +83,7 @@ def call(body) {
} }
stage('Docker Build And Push') { stage('Docker Build And Push') {
echo "Stage[5] Docker Build And Push" _utils.beautyEcho(5, 'Docker Build And Push')
if (config.buildType == "java") { if (config.buildType == "java") {
_stage.copy_files_java(systemName, contextDir) _stage.copy_files_java(systemName, contextDir)
} }
...@@ -92,12 +91,12 @@ def call(body) { ...@@ -92,12 +91,12 @@ def call(body) {
} }
stage('Deploy') { stage('Deploy') {
echo "===============Stage[6] Docker Build And Push===============" _utils.beautyEcho(6, 'Docker Build And Push')
_stage.deploy(namespace, systemName, imageTag, config.tier, isDeploy) _stage.deploy(namespace, systemName, imageTag, config.tier, isDeploy)
} }
stage("Clean") { stage("Clean") {
echo "===============Stage[7] Clean===============" _utils.beautyEcho(7, 'Clean')
_stage.clean_images(imageTag) _stage.clean_images(imageTag)
} }
} catch (err) { } catch (err) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment