Skip to content

Commit

Permalink
Updated Jenkinsfile
Browse files Browse the repository at this point in the history
  • Loading branch information
IGuy37 committed Jul 1, 2024
1 parent d55e634 commit 4bf6d01
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The Sock Exchange
This guided project was created for the Travelers Engineering Development Program (EDP) bootcamp.
It was developed in the form of varying labs teaching us how to use JavaScript, Git, GitHub, Agile, Jenkins and more!
It was developed in the form of varying labs teaching us how to use JavaScript, Git, GitHub, Agile, the MERN stack, PostgreSQL and more!

## Project Description
Welcome to The Sock Exchange - your one-stop-shop for reuniting lost soles!
Expand Down
39 changes: 33 additions & 6 deletions jenkins/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,43 @@ agent any
}

stages {
stage('Build') {
stage('Install dependencies') {
steps {
// Build placeholder
echo "Building..."
// Run unit tests
bat '''
cd react
npm install
'''
}
}

stage('Test') {
steps {
// Test placeholder
echo "Running tests..."
// Run unit tests
bat '''
cd react
npm run test
'''
}
}

stage('Add .env file') {
steps {
// Run unit tests
bat '''
cd react
(echo VITE_SOCKS_API_URL = http://localhost:3000/socks & echo VITE_ENVIRONMENT = development) > .env
'''
}
}

stage('Build') {
steps {
// Build for production
bat '''
cd react
npm run build
'''
}
}

Expand All @@ -28,7 +54,8 @@ agent any

stage('Deploy') {
steps {
bat "xcopy client\\* \"${env.NGINX_HTML_DIR}\" /s /y"
// Deploy unit tested production build to nginx
bat "xcopy react\\dist\\* \"${env.NGINX_HTML_DIR}\" /s /y"
}
}
}
Expand Down

0 comments on commit 4bf6d01

Please sign in to comment.