Compare commits

..

No commits in common. "9ace69a119bec5578da5eb597aba53d3a1fde240" and "8e1fcef0a72aceccadf76179c205a01a096c72df" have entirely different histories.

4 changed files with 4 additions and 7 deletions

View File

@ -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

View File

@ -2,7 +2,6 @@ namespace $REPO_NAME
{
public class Configuration
{
public string urls { get; set; }
public string DBConnectionString { get; set; }
}
}

8
Jenkinsfile vendored
View File

@ -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'
"""
}
}

View File

@ -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;"
}