Skip to content

Commit

Permalink
release : Discovery Service (#95)
Browse files Browse the repository at this point in the history
* feat: discovery service settings (#15)

* feat: init project

* feat: set discovery

* feat: create Dockfile (#20)

* feat: create Docker Hub push flow (#22)

* feat: create Docker Hub push flow

* docs : 도커허브에 이미지 푸쉬 전 JAR파일을 빌드하는 작업을 추가합니다.

* docs : GitHubActions jobs내 문법을 수정합니다.

* bug: update build script with right gradle-wrapper.jar (#24)

* fix: add new gradle-wrapper.jar

* fix: add build script with fixed working dir

* refactor: update dockerhub push flow (#27)

* fix: add multi platform (#39)
  • Loading branch information
K-Diger authored Jan 22, 2024
1 parent df58318 commit 02aed1b
Show file tree
Hide file tree
Showing 13 changed files with 529 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/dockerhub-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ jobs:
SOCIAL_DB_USERNAME: ${{ secrets.SOCIAL_DB_USERNAME }}
SOCIAL_DB_PASSWORD: ${{ secrets.SOCIAL_DB_PASSWORD }}
SOCIAL_DB_URI: ${{ secrets.SOCIAL_DB_URI }}

run: |
cd src/${{ env.BRANCH_NAME }}-service
./gradlew clean build
./gradlew clean build -x test
- name: Build and Push Docker Image
env:
Expand All @@ -57,6 +58,7 @@ jobs:
SOCIAL_DB_USERNAME: ${{ secrets.SOCIAL_DB_USERNAME }}
SOCIAL_DB_PASSWORD: ${{ secrets.SOCIAL_DB_PASSWORD }}
SOCIAL_DB_URI: ${{ secrets.SOCIAL_DB_URI }}

run: |
if [ -n "$BRANCH_NAME" ]; then
DOCKERFILE_DIR="src/$BRANCH_NAME-service"
Expand Down
69 changes: 69 additions & 0 deletions src/discovery-service/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
*.class
*.log
*.ctxt
.mtj.tmp/
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
hs_err_pid*
replay_pid*
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
.idea/**/aws.xml
.idea/**/contentModel.xml
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml
.idea/**/gradle.xml
.idea/**/libraries
cmake-build-*/
.idea/**/mongoSettings.xml
*.iws
out/
.idea_modules/
atlassian-ide-plugin.xml
.idea/replstate.xml
.idea/sonarlint/
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
.idea/httpRequests
.idea/caches/build_file_checksums.ser
.gradle
**/build/
!src/**/build/
gradle-app.setting
!gradle-wrapper.jar
!gradle-wrapper.properties
.gradletasknamecache
.project
.classpath
.DS_Store
.AppleDouble
.LSOverride
Icon
._*
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
5 changes: 5 additions & 0 deletions src/discovery-service/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM openjdk:17-oracle
ARG JAR_FILE=build/libs/easel-discovery-service-0.0.1-SNAPSHOT.jar
ADD ${JAR_FILE} easel-discovery-service.jar
ENTRYPOINT ["java", "-jar", "/easel-discovery-service.jar"]

25 changes: 25 additions & 0 deletions src/discovery-service/HELP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Read Me First
The following was discovered as part of building this project:

* The original package name 'org.palette.easel-discovery-service' is invalid and this project uses 'org.palette.easeldiscoveryservice' instead.

# Getting Started

### Reference Documentation
For further reference, please consider the following sections:

* [Official Gradle documentation](https://docs.gradle.org)
* [Spring Boot Gradle Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/3.2.1/gradle-plugin/reference/html/)
* [Create an OCI image](https://docs.spring.io/spring-boot/docs/3.2.1/gradle-plugin/reference/html/#build-image)
* [Eureka Server](https://docs.spring.io/spring-cloud-netflix/docs/current/reference/html/#spring-cloud-eureka-server)

### Guides
The following guides illustrate how to use some features concretely:

* [Service Registration and Discovery with Eureka and Spring Cloud](https://spring.io/guides/gs/service-registration-and-discovery/)

### Additional Links
These additional references should also help you:

* [Gradle Build Scans – insights for your project's build](https://scans.gradle.com#gradle)

39 changes: 39 additions & 0 deletions src/discovery-service/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
plugins {
java
id("org.springframework.boot") version "3.2.1"
id("io.spring.dependency-management") version "1.1.4"
}

group = "org.palette"
version = "0.0.1-SNAPSHOT"

java {
sourceCompatibility = JavaVersion.VERSION_17
}

configurations {
compileOnly {
extendsFrom(configurations.annotationProcessor.get())
}
}

repositories {
mavenCentral()
}

extra["springCloudVersion"] = "2023.0.0"

dependencies {
implementation("org.springframework.cloud:spring-cloud-starter-netflix-eureka-server")
testImplementation("org.springframework.boot:spring-boot-starter-test")
}

dependencyManagement {
imports {
mavenBom("org.springframework.cloud:spring-cloud-dependencies:${property("springCloudVersion")}")
}
}

tasks.withType<Test> {
useJUnitPlatform()
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 02aed1b

Please sign in to comment.