From 5dff625fee35d5fd1fbf68cc30af27763f146d67 Mon Sep 17 00:00:00 2001 From: yyeeqii Date: Sun, 27 Apr 2025 13:20:42 +0800 Subject: [PATCH] test webhook trigger 7 --- Jenkinsfile/Jenkinsfile | 56 +++++++++++++++++++++++++++++++++++++++ src/main/scss/header.scss | 2 +- 2 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 Jenkinsfile/Jenkinsfile diff --git a/Jenkinsfile/Jenkinsfile b/Jenkinsfile/Jenkinsfile new file mode 100644 index 000000000..65494cd6d --- /dev/null +++ b/Jenkinsfile/Jenkinsfile @@ -0,0 +1,56 @@ +pipeline { + agent any // This runs the pipeline on any available agent + + environment { + // Set environment variables if needed + APP_DIR = "/home/vagrant/petclinic" + REPO_URL = "https://github.com/yiting68/spring-petclinic.git" + } + + stages { + stage('Checkout') { + steps { + // Checkout the latest code from the Git repository + git branch: 'main', url: 'https://github.com/yiting68/spring-petclinic.git' + } + } + + stage('Build') { + steps { + // Install dependencies and build the project + sh './gradlew clean build' // assuming you are using Gradle + } + } + + stage('Test') { + steps { + // Run tests (JUnit tests in this case) + sh './gradlew test' + } + } + + stage('Deploy') { + steps { + // Deploy the app, e.g., run the JAR file or deploy to your server + sh 'nohup java -jar build/libs/spring-petclinic-3.4.0.jar > /home/vagrant/petclinic/app.log 2>&1 &' + } + } + } + + post { + always { + // Actions to perform after the pipeline finishes + echo 'Cleaning up' + } + + success { + // Actions if the pipeline is successful + echo 'Build and deploy succeeded!' + } + + failure { + // Actions if the pipeline fails + echo 'Build failed!' + } + } +} diff --git a/src/main/scss/header.scss b/src/main/scss/header.scss index 5e4a74087..c5965bd99 100644 --- a/src/main/scss/header.scss +++ b/src/main/scss/header.scss @@ -71,4 +71,4 @@ } } -// Just a comment to test Jenkins webhook, test 6 +// Just a comment to test Jenkins webhook, test 7