-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Foss-Sky1.0.1
- Loading branch information
Showing
39 changed files
with
1,021 additions
and
67 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -17,6 +17,25 @@ pipeline { | |
} | ||
|
||
stages { | ||
stage('stop container') { | ||
|
||
when { | ||
anyOf { | ||
branch 'dev' | ||
} | ||
} | ||
agent { | ||
docker { | ||
image 'node:14.18.0' | ||
reuseNode true | ||
} | ||
} | ||
|
||
steps { | ||
sh './jenkins/script/stop.sh' | ||
} | ||
} | ||
|
||
stage('pre-build') { // 自定义步骤 pre-build | ||
|
||
when { | ||
|
@@ -112,6 +131,25 @@ pipeline { | |
} | ||
} | ||
|
||
stage('restart container') { | ||
|
||
when { | ||
anyOf { | ||
branch 'dev' | ||
} | ||
} | ||
agent { | ||
docker { | ||
image 'node:14.18.0' | ||
reuseNode true | ||
} | ||
} | ||
|
||
steps { | ||
sh './jenkins/script/restart.sh' | ||
} | ||
} | ||
|
||
stage("artifacts-manage"){ | ||
when { | ||
expression{ | ||
|
@@ -130,13 +168,13 @@ pipeline { | |
expression{ | ||
return fileExists("${resetFlagFile}") | ||
} | ||
anyOf { | ||
anyOf { | ||
branch 'dev' | ||
branch 'release' | ||
branch 'master' | ||
} | ||
} | ||
|
||
steps { | ||
echo "是回滚啊啊啊啊" | ||
//当然我们这里为了方便下载 | ||
|
@@ -174,7 +212,7 @@ pipeline { | |
} | ||
|
||
//post 就是流水线的运行结果状态啦,我们慢点会在这里设置邮件通 | ||
post { | ||
post { | ||
changed{ | ||
echo 'I changed!' | ||
} | ||
|
@@ -187,7 +225,7 @@ pipeline { | |
emailext( | ||
subject: "Job [${env.JOB_NAME}] - Status: fail", | ||
body: """${template}""", | ||
recipientProviders: [culprits(),requestor(),developers()], | ||
recipientProviders: [culprits(),requestor(),developers()], | ||
to: "[email protected]", | ||
) | ||
} | ||
|
@@ -203,7 +241,7 @@ pipeline { | |
emailext( | ||
subject: "Job [${env.JOB_NAME}] - Status: Success", | ||
body: """${template}""", | ||
recipientProviders: [requestor(),developers()], | ||
recipientProviders: [requestor(),developers()], | ||
to: "[email protected]", | ||
) | ||
} | ||
|
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 |
---|---|---|
@@ -1,12 +1,6 @@ | ||
#! /bin/bash | ||
|
||
# set -x | ||
# stop nestjs | ||
docker stop nestjs | ||
|
||
npm run build-dev || exit 1 | ||
|
||
# start nestjs | ||
docker start nestjs | ||
|
||
# set +x |
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,13 @@ | ||
#! /bin/bash | ||
|
||
# set -x | ||
# restart mysql | ||
docker start mysql | ||
|
||
# restart nestjs | ||
containerId=`docker ps -a | grep -w nestjs | awk '{print $1}'` | ||
|
||
if [ "$containerId" != "" ] ; then | ||
docker start $containerId | ||
echo "成功运行容器 $containerId" | ||
fi |
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,14 @@ | ||
#! /bin/bash | ||
|
||
# set -x | ||
# stop nestjs | ||
containerId=`docker ps -a | grep -w nestjs | awk '{print $1}'` | ||
|
||
if [ "$containerId" != "" ] ; then | ||
docker stop $containerId | ||
echo "成功停止容器 $containerId" | ||
fi | ||
|
||
# stop mysql | ||
docker stop mysql | ||
|
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
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
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
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
Oops, something went wrong.