Compare commits
No commits in common. "9ace69a119bec5578da5eb597aba53d3a1fde240" and "8e1fcef0a72aceccadf76179c205a01a096c72df" have entirely different histories.
9ace69a119
...
8e1fcef0a7
@ -4,7 +4,6 @@ After=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
WorkingDirectory=/home/$REPO_NAME/dist/
|
||||
ExecStart=/home/$REPO_NAME/dist/$REPO_NAME
|
||||
ExecReload=/bin/kill -s HUP $MAINPID
|
||||
NoNewPrivileges=true
|
||||
|
@ -2,7 +2,6 @@ namespace $REPO_NAME
|
||||
{
|
||||
public class Configuration
|
||||
{
|
||||
public string urls { get; set; }
|
||||
public string DBConnectionString { get; set; }
|
||||
}
|
||||
}
|
8
Jenkinsfile
vendored
8
Jenkinsfile
vendored
@ -47,7 +47,7 @@ pipeline {
|
||||
withCredentials([sshUserPrivateKey(credentialsId: env.linuxServiceAccountID, keyFileVariable: 'PK')])
|
||||
{
|
||||
sh """#!/bin/bash
|
||||
ssh -i \"$${PK}\" -tt $${linuxServiceAccount_USR}@$${targetHost} 'systemctl --user stop $REPO_NAME'
|
||||
ssh -i \"$${PK}\" -tt $${linuxServiceAccount_USR}@$${targetHost} 'systemctl --user stop $$REPO_NAME'
|
||||
"""
|
||||
}
|
||||
}
|
||||
@ -63,7 +63,9 @@ pipeline {
|
||||
"""
|
||||
|
||||
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
|
||||
@ -79,9 +81,7 @@ pipeline {
|
||||
withCredentials([sshUserPrivateKey(credentialsId: env.linuxServiceAccountID, keyFileVariable: 'PK')])
|
||||
{
|
||||
sh """#!/bin/bash
|
||||
ssh -i \"$${PK}\" -tt $${linuxServiceAccount_USR}@$${targetHost} 'mv dist/appsettings.json appsettings.json'
|
||||
ssh -i \"$${PK}\" -tt $${linuxServiceAccount_USR}@$${targetHost} 'rm -rf dist/ && mv temp_deploy/ dist/'
|
||||
ssh -i \"$${PK}\" -tt $${linuxServiceAccount_USR}@$${targetHost} 'mv appsettings.json dist/appsettings.json'
|
||||
"""
|
||||
}
|
||||
}
|
||||
@ -95,7 +95,7 @@ pipeline {
|
||||
withCredentials([sshUserPrivateKey(credentialsId: env.linuxServiceAccountID, keyFileVariable: 'PK')])
|
||||
{
|
||||
sh """#!/bin/bash
|
||||
ssh -i \"$${PK}\" -tt $${linuxServiceAccount_USR}@$${targetHost} 'systemctl --user start $REPO_NAME'
|
||||
ssh -i \"$${PK}\" -tt $${linuxServiceAccount_USR}@$${targetHost} 'systemctl --user start $$REPO_NAME'
|
||||
"""
|
||||
}
|
||||
}
|
||||
|
@ -5,6 +5,5 @@
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
"urls": "http://0.0.0.0:0;",
|
||||
"DBConnectionString": "Host=localhost;Database=${REPO_NAME}_dev;Username=$REPO_NAME;Password=wnmhOttjA0wCiR9hVoG7jjrf90SxWvAV;IncludeErrorDetail=true;"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user