From 13566e1f8641e74d53a0c36397fa6601441b1682 Mon Sep 17 00:00:00 2001 From: Hanbin Lee Date: Sun, 12 Mar 2023 17:38:15 +0900 Subject: [PATCH 01/12] =?UTF-8?q?[#33]=20test:=20jenkins=20flyway=20runner?= =?UTF-8?q?=20=ED=85=8C=EC=8A=A4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jenkinsfile-service | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile-service b/Jenkinsfile-service index 83f30f2..eaf93b3 100644 --- a/Jenkinsfile-service +++ b/Jenkinsfile-service @@ -16,10 +16,14 @@ pipeline { stage('DB Migrate') { steps { - sh """ - chmod 755 ${MIGRATION_SCRIPT} - /bin/bash ${MIGRATION_SCRIPT} ${FLYWAY_CONFIG} - """ +// sh """ +// chmod 755 ${MIGRATION_SCRIPT} +// /bin/bash ${MIGRATION_SCRIPT} ${FLYWAY_CONFIG} +// """ + flywayrunner installationName: '', + flywayCommand: 'info', + commandLineArgs: 'configFiles=/home/ec2-user/flyway/flyway.conf', + credentialsId: '' } } From e08c02a99a3f3a805778ec9de135f003b52b3af4 Mon Sep 17 00:00:00 2001 From: Hanbin Lee Date: Sun, 12 Mar 2023 17:39:30 +0900 Subject: [PATCH 02/12] =?UTF-8?q?[#33]=20fix:=20flywayrunner=20plugin=20?= =?UTF-8?q?=EB=AC=B8=EB=B2=95=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jenkinsfile-service | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile-service b/Jenkinsfile-service index eaf93b3..98a37bc 100644 --- a/Jenkinsfile-service +++ b/Jenkinsfile-service @@ -21,9 +21,11 @@ pipeline { // /bin/bash ${MIGRATION_SCRIPT} ${FLYWAY_CONFIG} // """ flywayrunner installationName: '', - flywayCommand: 'info', + flywayCommand: 'migrate', commandLineArgs: 'configFiles=/home/ec2-user/flyway/flyway.conf', - credentialsId: '' + credentialsId: '', + locations: '', + url: '' } } From 8cc64c879f52d27a7170456dcc08926338ad9998 Mon Sep 17 00:00:00 2001 From: Hanbin Lee Date: Sun, 12 Mar 2023 17:46:21 +0900 Subject: [PATCH 03/12] [#33] fix: flyway runner installation name setting --- Jenkinsfile-service | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile-service b/Jenkinsfile-service index 98a37bc..90b64a6 100644 --- a/Jenkinsfile-service +++ b/Jenkinsfile-service @@ -20,12 +20,12 @@ pipeline { // chmod 755 ${MIGRATION_SCRIPT} // /bin/bash ${MIGRATION_SCRIPT} ${FLYWAY_CONFIG} // """ - flywayrunner installationName: '', - flywayCommand: 'migrate', + flywayrunner installationName: 'flywaytool-jenkins', + flywayCommand: 'info', commandLineArgs: 'configFiles=/home/ec2-user/flyway/flyway.conf', + url: '', credentialsId: '', - locations: '', - url: '' + locations: '' } } From af1a95b1c746ba4c33e54ec5124516c22e185d15 Mon Sep 17 00:00:00 2001 From: Hanbin Lee Date: Sun, 12 Mar 2023 17:48:19 +0900 Subject: [PATCH 04/12] =?UTF-8?q?[#33]=20fix:=20flyway=20runner=20commandL?= =?UTF-8?q?ineArgs=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jenkinsfile-service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile-service b/Jenkinsfile-service index 90b64a6..727e580 100644 --- a/Jenkinsfile-service +++ b/Jenkinsfile-service @@ -22,7 +22,7 @@ pipeline { // """ flywayrunner installationName: 'flywaytool-jenkins', flywayCommand: 'info', - commandLineArgs: 'configFiles=/home/ec2-user/flyway/flyway.conf', + commandLineArgs: "-configFiles=${FLYWAY_CONFIG}", url: '', credentialsId: '', locations: '' From f4b11c755cc791e6df0c70bb024e79f4d3a13bfb Mon Sep 17 00:00:00 2001 From: Hanbin Lee Date: Sun, 12 Mar 2023 17:55:46 +0900 Subject: [PATCH 05/12] =?UTF-8?q?[#33]=20fix:=20flyway=20credentialsId=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jenkinsfile-service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile-service b/Jenkinsfile-service index 727e580..c79a17b 100644 --- a/Jenkinsfile-service +++ b/Jenkinsfile-service @@ -23,8 +23,8 @@ pipeline { flywayrunner installationName: 'flywaytool-jenkins', flywayCommand: 'info', commandLineArgs: "-configFiles=${FLYWAY_CONFIG}", + credentialsId: 'ecb29499-7272-4e8b-b3ab-a7a3ab7eafab', url: '', - credentialsId: '', locations: '' } } From 9e376bfefb58b9cc9151f3253d8f09af08bacedb Mon Sep 17 00:00:00 2001 From: Hanbin Lee Date: Sun, 12 Mar 2023 18:06:58 +0900 Subject: [PATCH 06/12] =?UTF-8?q?[#33]=20fix:=20locations=20workspace=20?= =?UTF-8?q?=EA=B8=B0=EC=A4=80=EC=9C=BC=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jenkinsfile-service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile-service b/Jenkinsfile-service index c79a17b..2459701 100644 --- a/Jenkinsfile-service +++ b/Jenkinsfile-service @@ -25,7 +25,7 @@ pipeline { commandLineArgs: "-configFiles=${FLYWAY_CONFIG}", credentialsId: 'ecb29499-7272-4e8b-b3ab-a7a3ab7eafab', url: '', - locations: '' + locations: "${WORKSPACE}/db/migration" } } From cb5179abd7bf9546591807fb79f7aae7e1bf3263 Mon Sep 17 00:00:00 2001 From: Hanbin Lee Date: Sun, 12 Mar 2023 18:11:06 +0900 Subject: [PATCH 07/12] =?UTF-8?q?[#33]=20test:=20info,=20validate=20?= =?UTF-8?q?=EC=A7=84=ED=96=89=20=ED=85=8C=EC=8A=A4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jenkinsfile-service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile-service b/Jenkinsfile-service index 2459701..0995343 100644 --- a/Jenkinsfile-service +++ b/Jenkinsfile-service @@ -21,7 +21,7 @@ pipeline { // /bin/bash ${MIGRATION_SCRIPT} ${FLYWAY_CONFIG} // """ flywayrunner installationName: 'flywaytool-jenkins', - flywayCommand: 'info', + flywayCommand: 'info,validate', commandLineArgs: "-configFiles=${FLYWAY_CONFIG}", credentialsId: 'ecb29499-7272-4e8b-b3ab-a7a3ab7eafab', url: '', From 6036bd63ad07c80241d410ec307af5a49c2e25a5 Mon Sep 17 00:00:00 2001 From: Hanbin Lee Date: Sun, 12 Mar 2023 18:11:31 +0900 Subject: [PATCH 08/12] =?UTF-8?q?[#33]=20test:=20info,=20validate=20?= =?UTF-8?q?=EC=A7=84=ED=96=89=20=ED=85=8C=EC=8A=A4=ED=8A=B8(build=20?= =?UTF-8?q?=EC=83=9D=EB=9E=B5)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jenkinsfile-service | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Jenkinsfile-service b/Jenkinsfile-service index 0995343..647bbd6 100644 --- a/Jenkinsfile-service +++ b/Jenkinsfile-service @@ -29,16 +29,16 @@ pipeline { } } - stage('Test') { - steps { - sh './gradlew clean :dongne-service-api:test' - } - } - - stage('Build') { - steps { - sh './gradlew clean :dongne-service-api:build -x test' - } - } +// stage('Test') { +// steps { +// sh './gradlew clean :dongne-service-api:test' +// } +// } +// +// stage('Build') { +// steps { +// sh './gradlew clean :dongne-service-api:build -x test' +// } +// } } } \ No newline at end of file From c0fcefa8c030129bd0d65ebbd42f18c962df032e Mon Sep 17 00:00:00 2001 From: Hanbin Lee Date: Sun, 12 Mar 2023 18:23:58 +0900 Subject: [PATCH 09/12] =?UTF-8?q?[#33]=20test:=20info=EB=A7=8C=20=EC=8B=A4?= =?UTF-8?q?=ED=96=89=20=ED=85=8C=EC=8A=A4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jenkinsfile-service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile-service b/Jenkinsfile-service index 647bbd6..a123785 100644 --- a/Jenkinsfile-service +++ b/Jenkinsfile-service @@ -21,7 +21,7 @@ pipeline { // /bin/bash ${MIGRATION_SCRIPT} ${FLYWAY_CONFIG} // """ flywayrunner installationName: 'flywaytool-jenkins', - flywayCommand: 'info,validate', + flywayCommand: 'info', commandLineArgs: "-configFiles=${FLYWAY_CONFIG}", credentialsId: 'ecb29499-7272-4e8b-b3ab-a7a3ab7eafab', url: '', From 2c8b4c9a09d63f4d5c1d3abb3ab79356bcf9dddd Mon Sep 17 00:00:00 2001 From: Hanbin Lee Date: Sun, 12 Mar 2023 18:57:09 +0900 Subject: [PATCH 10/12] =?UTF-8?q?[#33]=20fix:=20jenkinsfile,=20flyway=20?= =?UTF-8?q?=EC=84=A4=EC=A0=95=EB=82=B4=EC=9A=A9=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jenkinsfile-service | 2 +- README.md | 16 ++++++++++++---- db/flyway.conf | 7 ++++++- script/db_migration.sh | 1 - 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile-service b/Jenkinsfile-service index a123785..69976e8 100644 --- a/Jenkinsfile-service +++ b/Jenkinsfile-service @@ -25,7 +25,7 @@ pipeline { commandLineArgs: "-configFiles=${FLYWAY_CONFIG}", credentialsId: 'ecb29499-7272-4e8b-b3ab-a7a3ab7eafab', url: '', - locations: "${WORKSPACE}/db/migration" + locations: "filesystem:${WORKSPACE}/db/migration" } } diff --git a/README.md b/README.md index da551bb..c3b38a1 100644 --- a/README.md +++ b/README.md @@ -6,10 +6,18 @@
## Specification -- java 17 -- kotlin 1.6.21 -- Spring Boot 2.7.0 -- MySQL 8.0.21 +- Lang + - java 17 + - kotlin 1.6.21 +- Framework + - Spring Boot 2.7.0 +- DB + - MySQL 8.0.21 + - Flyway(migration) +- CI/CD + - Jenkins +- Cloud Server + - AWS Lightsail(Amazon Linux2)
diff --git a/db/flyway.conf b/db/flyway.conf index 1af2acc..621000e 100644 --- a/db/flyway.conf +++ b/db/flyway.conf @@ -2,4 +2,9 @@ flyway.url=jdbc:mysql://localhost:3306/dongne?autoreconnect=true&characterEncodi flyway.user=root flyway.password=beaniejoy flyway.driver=com.mysql.cj.jdbc.Driver -flyway.locations=filesystem:db/migration,db/seed \ No newline at end of file +flyway.locations=filesystem:db/migration,db/seed + +flyway.baselineOnMigrate=true +flyway.baselineVersion=000 +flyway.ignoreMigrationPatterns=*:pending +flyway.cleanDisabled=false \ No newline at end of file diff --git a/script/db_migration.sh b/script/db_migration.sh index c43b2d4..6ba1373 100644 --- a/script/db_migration.sh +++ b/script/db_migration.sh @@ -8,4 +8,3 @@ echo "================ 2. Flyway Validate ============" echo "================ 3. Flyway Migrate =============" ./gradlew :db:flywayMigrate -Dconfig=$1 - From 6f183e38ec6d6228c4523f0cb8262e635efacee4 Mon Sep 17 00:00:00 2001 From: Hanbin Lee Date: Sun, 12 Mar 2023 19:15:50 +0900 Subject: [PATCH 11/12] =?UTF-8?q?[#33]=20fix:=20jenkinsfile=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jenkinsfile-service | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Jenkinsfile-service b/Jenkinsfile-service index 69976e8..c383dac 100644 --- a/Jenkinsfile-service +++ b/Jenkinsfile-service @@ -16,12 +16,8 @@ pipeline { stage('DB Migrate') { steps { -// sh """ -// chmod 755 ${MIGRATION_SCRIPT} -// /bin/bash ${MIGRATION_SCRIPT} ${FLYWAY_CONFIG} -// """ flywayrunner installationName: 'flywaytool-jenkins', - flywayCommand: 'info', + flywayCommand: 'info migrate validate', commandLineArgs: "-configFiles=${FLYWAY_CONFIG}", credentialsId: 'ecb29499-7272-4e8b-b3ab-a7a3ab7eafab', url: '', From dbf8b046b01b628125ad7569280990abc9c41e14 Mon Sep 17 00:00:00 2001 From: Hanbin Lee Date: Sun, 12 Mar 2023 19:20:39 +0900 Subject: [PATCH 12/12] =?UTF-8?q?[#33]=20test:=20=EB=B6=88=ED=95=84?= =?UTF-8?q?=EC=9A=94=ED=95=9C=20=EC=9A=94=EC=86=8C=20=EC=A0=9C=EA=B1=B0=20?= =?UTF-8?q?=ED=85=8C=EC=8A=A4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jenkinsfile-service | 24 +++++++++++------------- db/flyway.conf | 2 +- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/Jenkinsfile-service b/Jenkinsfile-service index c383dac..aaefe1b 100644 --- a/Jenkinsfile-service +++ b/Jenkinsfile-service @@ -9,7 +9,6 @@ pipeline { sh 'printenv' FLYWAY_CONFIG = '/home/ec2-user/flyway/flyway.conf' - MIGRATION_SCRIPT = './script/db_migration.sh' } } } @@ -20,21 +19,20 @@ pipeline { flywayCommand: 'info migrate validate', commandLineArgs: "-configFiles=${FLYWAY_CONFIG}", credentialsId: 'ecb29499-7272-4e8b-b3ab-a7a3ab7eafab', - url: '', locations: "filesystem:${WORKSPACE}/db/migration" } } -// stage('Test') { -// steps { -// sh './gradlew clean :dongne-service-api:test' -// } -// } -// -// stage('Build') { -// steps { -// sh './gradlew clean :dongne-service-api:build -x test' -// } -// } + stage('Test') { + steps { + sh './gradlew clean :dongne-service-api:test' + } + } + + stage('Build') { + steps { + sh './gradlew clean :dongne-service-api:build -x test' + } + } } } \ No newline at end of file diff --git a/db/flyway.conf b/db/flyway.conf index 621000e..f5d1ddc 100644 --- a/db/flyway.conf +++ b/db/flyway.conf @@ -6,5 +6,5 @@ flyway.locations=filesystem:db/migration,db/seed flyway.baselineOnMigrate=true flyway.baselineVersion=000 -flyway.ignoreMigrationPatterns=*:pending +# flyway.ignoreMigrationPatterns=*:pending flyway.cleanDisabled=false \ No newline at end of file