diff --git a/.github/workflows/continuous-deploy.yml b/.github/workflows/be-continuous-deploy-to-dev.yml similarity index 94% rename from .github/workflows/continuous-deploy.yml rename to .github/workflows/be-continuous-deploy-to-dev.yml index f6763693e..6cbc6e99a 100644 --- a/.github/workflows/continuous-deploy.yml +++ b/.github/workflows/be-continuous-deploy-to-dev.yml @@ -11,6 +11,9 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v3 + with: + token: ${{ secrets.SUBMODULE_BE_TOKEN }} + submodules: true - name: Set up JDK 17 uses: actions/setup-java@v3 diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/be-continuous-integration-to-dev.yml similarity index 100% rename from .github/workflows/continuous-integration.yml rename to .github/workflows/be-continuous-integration-to-dev.yml diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..2d48c233c --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "backend/baton/secret"] + path = backend/baton/secret + url = https://github.com/2023-baton/sub-be.git diff --git a/backend/baton/.gitignore b/backend/baton/.gitignore index 3ed283c10..e9f2877d2 100644 --- a/backend/baton/.gitignore +++ b/backend/baton/.gitignore @@ -177,3 +177,6 @@ gradle-app.setting *.hprof # End of https://www.toptal.com/developers/gitignore/api/macos,java,gradle,intellij+all + +src/main/resources/application-prod.yml +src/main/resources/application-dev.yml diff --git a/Dockerfile b/backend/baton/Dockerfile similarity index 61% rename from Dockerfile rename to backend/baton/Dockerfile index 4405c55e5..9c8d784ff 100644 --- a/Dockerfile +++ b/backend/baton/Dockerfile @@ -4,4 +4,4 @@ WORKDIR /app COPY ./build/libs/baton-0.0.1-SNAPSHOT.jar /app/baton.jar -CMD ["java", "-jar", "baton.jar"] +CMD ["java", "-jar", "-Dspring.profiles.active=dev", "baton.jar"] diff --git a/backend/baton/build.gradle b/backend/baton/build.gradle index 94d34b809..9bf5bb0ea 100644 --- a/backend/baton/build.gradle +++ b/backend/baton/build.gradle @@ -51,6 +51,14 @@ tasks.named('test') { useJUnitPlatform() } +processResources.dependsOn('copySecret') + +tasks.register('copySecret', Copy) { + from './secret' + include 'application*.yml' + into 'src/main/resources' +} + tasks.named('asciidoctor') { inputs.dir snippetsDir dependsOn test diff --git a/backend/baton/secret b/backend/baton/secret new file mode 160000 index 000000000..8ff341499 --- /dev/null +++ b/backend/baton/secret @@ -0,0 +1 @@ +Subproject commit 8ff341499e8200fed26054cd6be524a93934381d