gitignore
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
063a8fd945
commit
7875b9ecb8
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,3 +1,5 @@
|
||||
appsettings.json
|
||||
|
||||
# ---> VisualStudio
|
||||
## Ignore Visual Studio temporary files, build results, and
|
||||
## files generated by popular Visual Studio add-ons.
|
||||
|
30
Jenkinsfile
vendored
30
Jenkinsfile
vendored
@ -2,6 +2,7 @@ pipeline {
|
||||
agent any
|
||||
environment {
|
||||
linuxServiceAccount=creds
|
||||
linuxServiceAccountID=string
|
||||
productiondatabase_connectionString=creds
|
||||
targetHost=string
|
||||
}
|
||||
@ -28,7 +29,7 @@ pipeline {
|
||||
branch "release"
|
||||
}
|
||||
steps{
|
||||
withCredentials([sshUserPrivateKey(credentialsId: env.linuxServiceAccount, keyFileVariable: 'PK')])
|
||||
withCredentials([sshUserPrivateKey(credentialsId: env.linuxServiceAccountID, keyFileVariable: 'PK')])
|
||||
{
|
||||
sh """#!/bin/bash
|
||||
ssh -i \"${PK}\" -tt ${linuxServiceAccount_USR}@${targetHost} 'rm -rf temp_deploy & mkdir -p temp_deploy'
|
||||
@ -43,7 +44,7 @@ pipeline {
|
||||
branch "release"
|
||||
}
|
||||
steps{
|
||||
withCredentials([sshUserPrivateKey(credentialsId: env.linuxServiceAccount, keyFileVariable: 'PK')])
|
||||
withCredentials([sshUserPrivateKey(credentialsId: env.linuxServiceAccountID, keyFileVariable: 'PK')])
|
||||
{
|
||||
sh """#!/bin/bash
|
||||
ssh -i \"${PK}\" -tt ${linuxServiceAccount_USR}@${targetHost} 'systemctl --user stop $REPO_NAME'
|
||||
@ -51,24 +52,21 @@ pipeline {
|
||||
}
|
||||
}
|
||||
}
|
||||
stage ('backup db')
|
||||
{
|
||||
when {
|
||||
branch "release"
|
||||
}
|
||||
steps{
|
||||
//TODO: backup database
|
||||
sh """#!/bin/bash
|
||||
"""
|
||||
}
|
||||
}
|
||||
stage ('update db')
|
||||
{
|
||||
when {
|
||||
branch "release"
|
||||
}
|
||||
steps{
|
||||
//TODO: update database
|
||||
//TODO: backup database
|
||||
sh """#!/bin/bash
|
||||
"""
|
||||
|
||||
sh """#!/bin/bash
|
||||
pushd dist
|
||||
dotnet ef database update --connection "${env.productiondatabase_connectionString}"
|
||||
popd
|
||||
"""
|
||||
//TODO: if updating the db fails, restore the old one
|
||||
sh """#!/bin/bash
|
||||
"""
|
||||
@ -80,7 +78,7 @@ pipeline {
|
||||
branch "release"
|
||||
}
|
||||
steps{
|
||||
withCredentials([sshUserPrivateKey(credentialsId: env.linuxServiceAccount, keyFileVariable: 'PK')])
|
||||
withCredentials([sshUserPrivateKey(credentialsId: env.linuxServiceAccountID, keyFileVariable: 'PK')])
|
||||
{
|
||||
sh """#!/bin/bash
|
||||
ssh -i \"${PK}\" -tt ${linuxServiceAccount_USR}@${targetHost} 'rm -rf dist/ && mv temp_deploy/ dist/'
|
||||
@ -94,7 +92,7 @@ pipeline {
|
||||
branch "release"
|
||||
}
|
||||
steps{
|
||||
withCredentials([sshUserPrivateKey(credentialsId: env.linuxServiceAccount, keyFileVariable: 'PK')])
|
||||
withCredentials([sshUserPrivateKey(credentialsId: env.linuxServiceAccountID, keyFileVariable: 'PK')])
|
||||
{
|
||||
sh """#!/bin/bash
|
||||
ssh -i \"${PK}\" -tt ${linuxServiceAccount_USR}@${targetHost} 'systemctl --user start $REPO_NAME'
|
||||
|
Loading…
Reference in New Issue
Block a user