working directory

This commit is contained in:
adam 2024-12-13 21:00:06 -05:00
parent 8e1fcef0a7
commit 6466c6cad6
4 changed files with 5 additions and 4 deletions

View File

@ -4,6 +4,7 @@ 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,6 +2,7 @@ namespace $REPO_NAME
{
public class Configuration
{
public string urls { get; set; }
public string DBConnectionString { get; set; }
}
}

6
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,9 +63,7 @@ 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
@ -95,7 +93,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,5 +5,6 @@
"Microsoft.AspNetCore": "Warning"
}
},
"urls": "http://0.0.0.0:0;",
"DBConnectionString": "Host=localhost;Database=${REPO_NAME}_dev;Username=$REPO_NAME;Password=wnmhOttjA0wCiR9hVoG7jjrf90SxWvAV;IncludeErrorDetail=true;"
}