diff --git a/$REPO_NAME.service b/$REPO_NAME.service new file mode 100644 index 0000000..7411db7 --- /dev/null +++ b/$REPO_NAME.service @@ -0,0 +1,12 @@ +[Unit] +Description=$REPO_DESCRIPTION +After=network-online.target + +[Service] +Type=simple +ExecStart=dist/$REPO_NAME +ExecReload=/bin/kill -s HUP $MAINPID +NoNewPrivileges=true + +[Install] +WantedBy=default.target diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..188ecf8 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,11 @@ +pipeline { + agent any + stages { + stage (‘Deploy’) { + 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 user@server “rm -rf dist/ && mv temp_deploy/ dist/”’ + } + } +} \ No newline at end of file diff --git a/README.md b/README.md index 4d569ed..47b470c 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ -# _template-service +# $REPO_NAME +$REPO_DESCRIPTION \ No newline at end of file