see this is the bad thing - i get distracted mid Thing so i have no idea what this is. but it's pending.
Some checks failed
gitea.arg.rip/_template-service/pipeline/head There was a failure building this commit
Some checks failed
gitea.arg.rip/_template-service/pipeline/head There was a failure building this commit
This commit is contained in:
parent
50842128ad
commit
b3853befc8
44
Jenkinsfile
vendored
44
Jenkinsfile
vendored
@ -1,8 +1,14 @@
|
||||
pipeline {
|
||||
agent any
|
||||
environment {
|
||||
linuxServiceAccount=credentials('UUID')
|
||||
productiondatabase_connectionString="?"
|
||||
targetServer="string"
|
||||
}
|
||||
stages {
|
||||
stage('build'){
|
||||
//TODO: dotnet build
|
||||
//"hey self, what if once in your life you try a *different* language?" "then i'll update this file, moai.emoji."
|
||||
//dotnetBuild(outputDirectory: "./", project: "Deployment/Deployment.csproj")
|
||||
}
|
||||
stage('test'){
|
||||
//TODO: run tests
|
||||
@ -16,9 +22,9 @@ pipeline {
|
||||
branch "release"
|
||||
}
|
||||
steps{
|
||||
sh 'ssh user@server rm -rf temp_deploy'
|
||||
sh 'ssh user@server mkdir -p temp_deploy'
|
||||
sh 'scp -r dist user@server:temp_deploy'
|
||||
sh 'ssh ${env.targetServer} rm -rf temp_deploy'
|
||||
sh 'ssh ${env.targetServer} mkdir -p temp_deploy'
|
||||
sh 'scp -r dist ${env.targetServer}:temp_deploy'
|
||||
}
|
||||
}
|
||||
stage ('stop')
|
||||
@ -26,11 +32,13 @@ pipeline {
|
||||
when {
|
||||
branch "release"
|
||||
}
|
||||
script{
|
||||
//user is the service user
|
||||
ssh user@host 'bash -s' << 'ENDSSH'
|
||||
systemctl --user stop $svcname
|
||||
ENDSSH
|
||||
steps{
|
||||
script{
|
||||
//user is the service user
|
||||
ssh ${env.targetServer} 'bash -s' << 'ENDSSH'
|
||||
systemctl --user stop $svcname
|
||||
ENDSSH
|
||||
}
|
||||
}
|
||||
}
|
||||
stage ('backup db')
|
||||
@ -38,7 +46,9 @@ pipeline {
|
||||
when {
|
||||
branch "release"
|
||||
}
|
||||
//TODO: backup database
|
||||
steps{
|
||||
//TODO: backup database
|
||||
}
|
||||
}
|
||||
stage ('update db')
|
||||
{
|
||||
@ -53,17 +63,21 @@ pipeline {
|
||||
when {
|
||||
branch "release"
|
||||
}
|
||||
sh 'ssh user@server “rm -rf dist/ && mv temp_deploy/ dist/”'
|
||||
steps{
|
||||
sh 'ssh ${env.targetServer} "rm -rf dist/ && mv temp_deploy/ dist/"'
|
||||
}
|
||||
}
|
||||
stage ('spin up')
|
||||
{
|
||||
when {
|
||||
branch "release"
|
||||
}
|
||||
script{
|
||||
ssh user@host 'bash -s' << 'ENDSSH'
|
||||
systemctl --user start $svcname
|
||||
ENDSSH
|
||||
steps{
|
||||
script{
|
||||
ssh ${env.targetServer} 'bash -s' << 'ENDSSH'
|
||||
systemctl --user start $svcname
|
||||
ENDSSH
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user