Skip to content
This repository has been archived by the owner on Aug 14, 2024. It is now read-only.

Commit

Permalink
Update Jenkinsfile to include deployment and server restart steps
Browse files Browse the repository at this point in the history
  • Loading branch information
nmcc1212 committed Apr 5, 2024
1 parent c47f272 commit 731e6be
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Jenkins/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,21 @@ pipeline {
}
stage deploy {
steps {
dir ('next/news-aggregation') {
sh 'scp -i ${key} -r build/* root@newnewtitanium:/var/www/html'
script {
sshagent(['nial-ssh-creds']) {
sh "scp -i ${SSH_KEY} -r ${REACT_APP_BUILD_DIR} ${REMOTE_USER}@${REMOTE_HOST}:${REMOTE_DIR}"
}
}
}
}
stage('Restart Server') {
steps {
script {
sshagent(['nial-ssh-creds']) {
sh "ssh -i ${SSH_KEY} ${REMOTE_USER}@${REMOTE_HOST} 'sudo systemctl restart nginx'"
}
}
}
stage('jest') {
steps {
dir ('next/news-aggregation') {
Expand Down

0 comments on commit 731e6be

Please sign in to comment.