Skip to content

Commit aec418b

Browse files
authored
[CHORE] CI Pipeline 구축 (#7)
* CHORE: Create ohhanahana-ci.yml * fix: submodule token 추가 * fix: token명 변경 * FIX: token 필드명 수정 * FIX: gradlew 권한 부여 * REFACTFIX: rvice-key ì 서브모듈 적용 * FIX: Spring-profile-active 필드 추가 * FIX: 오류 - 제거 * Update ohhanahana-ci.yml * Update ohhanahana-ci.yml * Update ohhanahana-ci.yml * Update ohhanahana-ci.yml * Update ohhanahana-ci.yml * Update ohhanahana-ci.yml * f * fix: update * remove application.yml
1 parent 6c0567d commit aec418b

File tree

3 files changed

+54
-2
lines changed

3 files changed

+54
-2
lines changed

.github/workflows/ohhanahana-ci.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
6+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
7+
8+
name: Ohhanahana CI Pipeline
9+
10+
on:
11+
push:
12+
branches: [ "develop" ]
13+
pull_request:
14+
branches: [ "develop" ]
15+
16+
jobs:
17+
build:
18+
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
23+
- name: checkout
24+
uses: actions/checkout@v4
25+
26+
- name: Set up JDK 17
27+
uses: actions/setup-java@v4
28+
with:
29+
java-version: '17'
30+
distribution: 'temurin'
31+
32+
- name: checkout submodule
33+
uses: actions/checkout@v4
34+
with:
35+
submodules: true
36+
token: ${{ secrets.ACTIONS_TOKEN }}
37+
38+
- name: Update submodule
39+
run: |
40+
git submodule update --remote --recursive
41+
42+
- name: Grant execute permission for gradlew
43+
run: chmod +x ./gradlew
44+
45+
- name: Build with Gradle
46+
run: ./gradlew clean build -x test
47+
env:
48+
SPRING_PROFILES_ACTIVE: main
49+

config

src/main/java/com/cloudcomputing/ohhanahana/service/BusService.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import jakarta.xml.bind.JAXBException;
1111
import jakarta.xml.bind.Unmarshaller;
1212
import lombok.RequiredArgsConstructor;
13+
import org.springframework.beans.factory.annotation.Value;
1314
import org.springframework.http.client.ClientHttpRequestFactory;
1415
import org.springframework.http.client.SimpleClientHttpRequestFactory;
1516
import org.springframework.http.converter.StringHttpMessageConverter;
@@ -27,7 +28,9 @@
2728
public class BusService {
2829

2930
private final String baseUri = "http://apis.data.go.kr/6280000/busArrivalService/getAllRouteBusArrivalList?serviceKey=";
30-
private final String serviceKey = "";
31+
32+
@Value("${api.bus-information.service-key}")
33+
private String serviceKey;
3134

3235
public RecommendResponse getBusArrivalData() throws JAXBException {
3336
List<BusStop> busStops = Arrays.stream(BusStop.values()).toList();

0 commit comments

Comments
 (0)