Skip to content

Commit

Permalink
Merge pull request #503 from Kernel360/develop
Browse files Browse the repository at this point in the history
[merge] develop into main
  • Loading branch information
mooncw authored Apr 5, 2024
2 parents 8f6e000 + d45974a commit ebfe7a8
Show file tree
Hide file tree
Showing 58 changed files with 878 additions and 1,305 deletions.
104 changes: 0 additions & 104 deletions .github/workflows/cd-dev.yml

This file was deleted.

53 changes: 7 additions & 46 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,68 +14,29 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

# - run: touch ./domain-mysql/src/main/resources/application.yml
- run: echo "${{ secrets.APPLICATION }}" > ./domain-mysql/src/main/resources/application.yml
- uses: actions/upload-artifact@v2
with:
name: application.yml
path: ./domain-mysql/src/main/resources/application.yml

- run: echo "${{ secrets.MEMBER_APPLICATION }}" > ./member-api/src/main/resources/application.yml
- uses: actions/upload-artifact@v2
- name: Checkout
uses: actions/checkout@v3
with:
name: application.yml
path: ./member-api/src/main/resources/application.yml
ref: ${{ github.event.pull_request.head.sha }}

- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'

# - name: Set up member-api application.yml
# uses: microsoft/variable-substitution@v1
# with:
# files: ./member-api/src/main/resources/application.yml
# env:
# spring.datasource.url: ${{ secrets.LOCAL_DB_URL }}
# spring.datasource.username: ${{ secrets.LOCAL_DB_HOST }}
# spring.datasource.password: ${{ secrets.LOCAL_DB_PASSWORD }}
# spring.redis.host: ${{ secrets.REDIS_HOST }}
# spring.redis.port: ${{ secrets.REDIS_PORT }}
# spring.data.mongodb.uri: ${{ secrets.MONGO_URI }}
# spring.security.jwt.secret: ${{ secrets.JWT_SECRET_KEY }}
# cloud.aws.s3.bucket: ${{ secrets.S3_BUCKET_NAME }}
# cloud.aws.region.static: ${{ secrets.S3_REGION }}
# cloud.aws.credentials.accessKey: ${{ secrets.AWS_ACCESS_KEY }}
# cloud.aws.credentials.secretKey: ${{ secrets.AWS_ACCESS_SECRET }}
# kafka.url: ${{ secrets.KAFKA_URL }}
# custom.domain.image.baseUrl: ${{ secrets.BASE_URL }}
# chatgpt.rest-api-key: ${{ secrets.CHAT_GPT_API_KEY }}

# - name: Set up domain-mysql application.yml
# uses: microsoft/variable-substitution@v1
# with:
# files: ./domain-mysql/src/main/resources/application.yml
# env:
# spring.datasource.url: ${{ secrets.LOCAL_DB_URL }}
# spring.datasource.username: ${{ secrets.LOCAL_DB_HOST }}
# spring.datasource.password: ${{ secrets.LOCAL_DB_PASSWORD }}

- name: Set up domain-mongodb application.yml
- name: Set up member-api application-common.yml
uses: microsoft/variable-substitution@v1
with:
files: ./domain-mongodb/src/main/resources/application.yml
files: ./member-api/src/main/resources/application-common.yml
env:
spring.data.mongodb.uri: ${{ secrets.MONGO_URI }}
jasypt.password: ${{ secrets.JASYPT_PASSWORD }}

- name: Build member-api with Gradle
run : |
cd member-api
chmod +x ./gradlew
./gradlew clean build
./gradlew build
- name: Login to DockerHub
uses: docker/login-action@v1
Expand Down
47 changes: 28 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,31 +23,40 @@ jobs:
java-version: '21'
distribution: 'temurin'

- name: Set up DataHub with Docker
run: |
echo "${{ secrets.CI_DOCKER_COMPOSE }}" > docker-compose.yml
docker-compose up -d
docker ps
- name: Test domain-mysql with Gradle
run: |
cd domain-mysql
chmod +x ./gradlew
./gradlew test
- name: Set up domain-mongodb test application.yml
uses: microsoft/variable-substitution@v1
with:
files: ./domain-mongodb/src/test/resources/application.yml
env:
spring.data.mongodb.uri: ${{ secrets.MONGO_TEST_URI }}
jasypt.password: ${{ secrets.JASYPT_PASSWORD }}

- name: Test domain-mongodb with Gradle
run: |
cd domain-mongodb
chmod +x ./gradlew
./gradlew test
- name: Set up member-api test application.yml
- name: Set up member-api application-common.yml
uses: microsoft/variable-substitution@v1
with:
files: ./member-api/src/test/resources/application.yml
files: ./member-api/src/main/resources/application-common.yml
env:
spring.datasource.url: ${{ secrets.TEST_DB_URL }}
spring.datasource.username: ${{ secrets.TEST_DB_HOST }}
spring.datasource.password: ${{ secrets.TEST_DB_PASSWORD }}
spring.security.jwt.secret: ${{ secrets.JWT_SECRET_KEY }}
spring.data.mongodb.uri: ${{ secrets.MONGO_TEST_URI }}
custom.domain.image.baseUrl: ${{ secrets.BASE_URL }}
cloud.aws.s3.bucket: ${{ secrets.S3_BUCKET_NAME }}
cloud.aws.region.static: ${{ secrets.S3_REGION }}
cloud.aws.credentials.accessKey: ${{ secrets.AWS_ACCESS_KEY }}
cloud.aws.credentials.secretKey: ${{ secrets.AWS_ACCESS_SECRET }}

- name: Run chmod to make gradlew executable
run: chmod +x ./gradlew

- name: Test with Gradle
run: ./gradlew test
jasypt.password: ${{ secrets.JASYPT_PASSWORD }}

- name: Build member-api with Gradle
run: |
cd member-api
chmod +x ./gradlew
./gradlew build
21 changes: 0 additions & 21 deletions .github/workflows/cr.yml

This file was deleted.

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ member-api/logs/**

member-api/member-api/logs/**

member-api/src/main/resources/application-local.yml

core/src/test/java/com/kernelsqaure/core/config/JasyptConfigTest.java

### STS ###
.apt_generated
.classpath
Expand Down
Loading

0 comments on commit ebfe7a8

Please sign in to comment.