Skip to content

Commit

Permalink
gitlabのhostを環境変数指定に変更 (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
tttol authored Jan 30, 2023
1 parent 24f0f07 commit 9acb4b1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,13 @@ cd mrls

2. Dockerイメージ作成 -> `./gradlew bootBuildImage`
3. コンテナ起動
-> `docker run --name mrls --env GITLAB_PROJECT_ID=xxxx --env GITLAB_ACCESS_TOKEN=xxxx -it -p 8888:8080 mrls`

```bash
docker run --name mrls --env GITLAB_PROJECT_ID=xxxx --env GITLAB_ACCESS_TOKEN=xxxx --env GITLAB_HOST=xxx -it -p 8888:8080 mrls
```

- GITLAB_HOST
- GitLabのhost
- GITLAB_PROJECT_ID
- GitLabのプロジェクトID
- GITLAB_ACCESS_TOKEN
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
}

group = 'io.github.tttol'
version = '1.1.0'
version = '1.1.1'
sourceCompatibility = '17'

configurations {
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
app:
gitlab:
host: ${GITLAB_HOST}
project:
id: ${GITLAB_PROJECT_ID}
accessToken: ${GITLAB_ACCESS_TOKEN}
api:
endpoint: https://gitlab.com/api/v4/projects/${app.gitlab.project.id}/merge_requests
endpoint: https://${app.gitlab.host}/api/v4/projects/${app.gitlab.project.id}/merge_requests
logging:
level:
root: INFO
Expand Down
9 changes: 5 additions & 4 deletions src/test/java/io/github/tttol/mrls/MrlsApplicationTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest(properties = {"GITLAB_PROJECT_ID=dummy",
"GITLAB_ACCESS_TOKEN=dummy"})
"GITLAB_ACCESS_TOKEN=dummy",
"GITLAB_HOST=dummy"})
class MrlsApplicationTests {

@Test
void contextLoads() {
@Test
void contextLoads() {

}
}

}

0 comments on commit 9acb4b1

Please sign in to comment.