Skip to content

Commit 5917635

Browse files
Merge pull request #20 from BSjaeyoung-kim/main
20241031 CI update, Add feature
2 parents f23a374 + df9df1f commit 5917635

File tree

56 files changed

+3040
-1176
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+3040
-1176
lines changed

.env

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,13 @@ MYSQL_PASSWORD=0000
66
COST_DB_URL=jdbc:mariadb://host.docker.internal:3306/cost?autoReconnect=true&allowMultiQueries=true&useSSL=false&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&characterEncoding=UTF-8
77
COST_DB_USERNM=mcmpcostopti
88
COST_DB_PW=0000
9-
TUMBLEBUG_URL=http://tumblebug.server:80
9+
# BE
10+
TUMBLEBUG_URL=http://tumblebug.server:80/tumblebug
1011
TUMBLEBUG_USERNAME=default
1112
TUMBLEBUG_PASSWORD=default
13+
ASSET_COLLECTOR_URL=http://assetcollector:8091
14+
COST_COLLECTOR_URL=http://costcollector:8081
15+
COST_PROCESSOR_URL=http://costprocessor:8082
1216
# AlarmService
1317
SLACK_DB_URL=jdbc:mariadb://host.docker.internal:3306/slack_test?autoReconnect=true&allowMultiQueries=true&useSSL=false&allowPublicKeyRetrieval=true&characterEncoding=UTF-8
1418
SLACK_DB_USERNM=mcmpcostopti
@@ -26,6 +30,7 @@ AWS_SECRET_ACCESS_KEY=secretkey
2630
# CostProcessor
2731
COST_PROCESS_UNUSED_CRON_SCHEDULE=0 45 * * * ?
2832
COST_PROCESS_ABNORMAL_CRON_SCHEDULE=0 0 1,7 * * ?
33+
# BE, CostProcessor
2934
COST_SELECTOR_URL=http://costselector:8083
3035
ALARM_URL=http://alarmservice:9000
3136
# AssetCollector
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: MC-CostOpti-Alarm-CI (CI)
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- release
8+
tags:
9+
- "v*.*.*"
10+
paths-ignore:
11+
- ".github/**"
12+
- "assetCollector/**"
13+
- "BackEnd/**"
14+
- "cost-fe/**"
15+
- "costCollector/**"
16+
- "costProcessor/**"
17+
- "costSelector/**"
18+
- "mysql/**"
19+
- "**.md"
20+
- "LICENSE.txt"
21+
- ".gitignore"
22+
23+
env:
24+
DOCKER_REGISTRY_NAME: cloudbaristaorg
25+
GHCR_REGISTRY_NAME: ${{ github.repository_owner }}
26+
IMAGE_NAME: mc-costopti-alarm
27+
28+
jobs:
29+
publish-container-image:
30+
name: Publish a container image
31+
runs-on: ubuntu-22.04
32+
33+
steps:
34+
- name: Checkout source code
35+
uses: actions/checkout@v4
36+
37+
- name: Extract metadata from Git reference and GitHub events
38+
id: meta
39+
uses: docker/metadata-action@v5
40+
with:
41+
images: |
42+
# image name for Docker Hub
43+
${{env.DOCKER_REGISTRY_NAME}}/${{env.IMAGE_NAME}}
44+
# image name for GitHub Container Registry (GHCR)
45+
ghcr.io/${{env.GHCR_REGISTRY_NAME}}/${{env.IMAGE_NAME}}
46+
tags: |
47+
type=semver,enable=true,pattern={{version}}
48+
type=edge,enable=true,branch=main
49+
type=ref,event=branch
50+
51+
- name: Set up Docker Buildx
52+
id: buildx
53+
uses: docker/setup-buildx-action@v3
54+
55+
- name: Login to Docker Hub
56+
uses: docker/login-action@v3
57+
with:
58+
username: ${{ secrets.DOCKER_USERNAME }}
59+
password: ${{ secrets.DOCKER_PASSWORD }}
60+
61+
# TODO: Create a PAT with `read:packages` and `write:packages` scopes and save it as an Actions secret `CR_PAT`
62+
- name: Login to GitHub Container Registry
63+
uses: docker/login-action@v3
64+
with:
65+
registry: ghcr.io
66+
username: ${{ github.repository_owner }}
67+
password: ${{ secrets.CR_PAT }}
68+
69+
- name: Build and publish
70+
id: docker_build
71+
uses: docker/build-push-action@v6
72+
with:
73+
builder: ${{ steps.buildx.outputs.name }}
74+
context: ./AlarmService
75+
file: ./AlarmService/Dockerfile
76+
platforms: linux/amd64
77+
push: ${{ github.event_name != 'pull_request' }}
78+
tags: ${{ steps.meta.outputs.tags }}
79+
80+
- name: Image digest
81+
run: echo ${{ steps.docker_build.outputs.digest }}
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: MC-CostOpti-AssetCollector-CI (CI)
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- release
8+
tags:
9+
- "v*.*.*"
10+
paths-ignore:
11+
- ".github/**"
12+
- "AlarmService/**"
13+
- "BackEnd/**"
14+
- "cost-fe/**"
15+
- "costCollector/**"
16+
- "costProcessor/**"
17+
- "costSelector/**"
18+
- "mysql/**"
19+
- "**.md"
20+
- "LICENSE.txt"
21+
- ".gitignore"
22+
23+
env:
24+
DOCKER_REGISTRY_NAME: cloudbaristaorg
25+
GHCR_REGISTRY_NAME: ${{ github.repository_owner }}
26+
IMAGE_NAME: mc-costopti-assetcollector
27+
28+
jobs:
29+
publish-container-image:
30+
name: Publish a container image
31+
runs-on: ubuntu-22.04
32+
33+
steps:
34+
- name: Checkout source code
35+
uses: actions/checkout@v4
36+
37+
- name: Extract metadata from Git reference and GitHub events
38+
id: meta
39+
uses: docker/metadata-action@v5
40+
with:
41+
images: |
42+
# image name for Docker Hub
43+
${{env.DOCKER_REGISTRY_NAME}}/${{env.IMAGE_NAME}}
44+
# image name for GitHub Container Registry (GHCR)
45+
ghcr.io/${{env.GHCR_REGISTRY_NAME}}/${{env.IMAGE_NAME}}
46+
tags: |
47+
type=semver,enable=true,pattern={{version}}
48+
type=edge,enable=true,branch=main
49+
type=ref,event=branch
50+
51+
- name: Set up Docker Buildx
52+
id: buildx
53+
uses: docker/setup-buildx-action@v3
54+
55+
- name: Login to Docker Hub
56+
uses: docker/login-action@v3
57+
with:
58+
username: ${{ secrets.DOCKER_USERNAME }}
59+
password: ${{ secrets.DOCKER_PASSWORD }}
60+
61+
# TODO: Create a PAT with `read:packages` and `write:packages` scopes and save it as an Actions secret `CR_PAT`
62+
- name: Login to GitHub Container Registry
63+
uses: docker/login-action@v3
64+
with:
65+
registry: ghcr.io
66+
username: ${{ github.repository_owner }}
67+
password: ${{ secrets.CR_PAT }}
68+
69+
- name: Build and publish
70+
id: docker_build
71+
uses: docker/build-push-action@v6
72+
with:
73+
builder: ${{ steps.buildx.outputs.name }}
74+
context: ./assetCollector
75+
file: ./assetCollector/Dockerfile
76+
platforms: linux/amd64
77+
push: ${{ github.event_name != 'pull_request' }}
78+
tags: ${{ steps.meta.outputs.tags }}
79+
80+
- name: Image digest
81+
run: echo ${{ steps.docker_build.outputs.digest }}
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: MC-CostOpti-BE-CI (CI)
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- release
8+
tags:
9+
- "v*.*.*"
10+
paths-ignore:
11+
- ".github/**"
12+
- "AlarmService/**"
13+
- "assetCollector/**"
14+
- "cost-fe/**"
15+
- "costCollector/**"
16+
- "costProcessor/**"
17+
- "costSelector/**"
18+
- "mysql/**"
19+
- "**.md"
20+
- "LICENSE.txt"
21+
- ".gitignore"
22+
23+
env:
24+
DOCKER_REGISTRY_NAME: cloudbaristaorg
25+
GHCR_REGISTRY_NAME: ${{ github.repository_owner }}
26+
IMAGE_NAME: mc-costopti-api
27+
28+
jobs:
29+
publish-container-image:
30+
name: Publish a container image
31+
runs-on: ubuntu-22.04
32+
33+
steps:
34+
- name: Checkout source code
35+
uses: actions/checkout@v4
36+
37+
- name: Extract metadata from Git reference and GitHub events
38+
id: meta
39+
uses: docker/metadata-action@v5
40+
with:
41+
images: |
42+
# image name for Docker Hub
43+
${{env.DOCKER_REGISTRY_NAME}}/${{env.IMAGE_NAME}}
44+
# image name for GitHub Container Registry (GHCR)
45+
ghcr.io/${{env.GHCR_REGISTRY_NAME}}/${{env.IMAGE_NAME}}
46+
tags: |
47+
type=semver,enable=true,pattern={{version}}
48+
type=edge,enable=true,branch=main
49+
type=ref,event=branch
50+
51+
- name: Set up Docker Buildx
52+
id: buildx
53+
uses: docker/setup-buildx-action@v3
54+
55+
- name: Login to Docker Hub
56+
uses: docker/login-action@v3
57+
with:
58+
username: ${{ secrets.DOCKER_USERNAME }}
59+
password: ${{ secrets.DOCKER_PASSWORD }}
60+
61+
# TODO: Create a PAT with `read:packages` and `write:packages` scopes and save it as an Actions secret `CR_PAT`
62+
- name: Login to GitHub Container Registry
63+
uses: docker/login-action@v3
64+
with:
65+
registry: ghcr.io
66+
username: ${{ github.repository_owner }}
67+
password: ${{ secrets.CR_PAT }}
68+
69+
- name: Build and publish
70+
id: docker_build
71+
uses: docker/build-push-action@v6
72+
with:
73+
builder: ${{ steps.buildx.outputs.name }}
74+
context: ./BackEnd
75+
file: ./BackEnd/Dockerfile
76+
platforms: linux/amd64
77+
push: ${{ github.event_name != 'pull_request' }}
78+
tags: ${{ steps.meta.outputs.tags }}
79+
80+
- name: Image digest
81+
run: echo ${{ steps.docker_build.outputs.digest }}
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: MC-CostOpti-CostCollector-CI (CI)
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- release
8+
tags:
9+
- "v*.*.*"
10+
paths-ignore:
11+
- ".github/**"
12+
- "AlarmService/**"
13+
- "assetCollector/**"
14+
- "BackEnd/**"
15+
- "cost-fe/**"
16+
- "costProcessor/**"
17+
- "costSelector/**"
18+
- "mysql/**"
19+
- "**.md"
20+
- "LICENSE.txt"
21+
- ".gitignore"
22+
23+
env:
24+
DOCKER_REGISTRY_NAME: cloudbaristaorg
25+
GHCR_REGISTRY_NAME: ${{ github.repository_owner }}
26+
IMAGE_NAME: mc-costopti-costcollector
27+
28+
jobs:
29+
publish-container-image:
30+
name: Publish a container image
31+
runs-on: ubuntu-22.04
32+
33+
steps:
34+
- name: Checkout source code
35+
uses: actions/checkout@v4
36+
37+
- name: Extract metadata from Git reference and GitHub events
38+
id: meta
39+
uses: docker/metadata-action@v5
40+
with:
41+
images: |
42+
# image name for Docker Hub
43+
${{env.DOCKER_REGISTRY_NAME}}/${{env.IMAGE_NAME}}
44+
# image name for GitHub Container Registry (GHCR)
45+
ghcr.io/${{env.GHCR_REGISTRY_NAME}}/${{env.IMAGE_NAME}}
46+
tags: |
47+
type=semver,enable=true,pattern={{version}}
48+
type=edge,enable=true,branch=main
49+
type=ref,event=branch
50+
51+
- name: Set up Docker Buildx
52+
id: buildx
53+
uses: docker/setup-buildx-action@v3
54+
55+
- name: Login to Docker Hub
56+
uses: docker/login-action@v3
57+
with:
58+
username: ${{ secrets.DOCKER_USERNAME }}
59+
password: ${{ secrets.DOCKER_PASSWORD }}
60+
61+
# TODO: Create a PAT with `read:packages` and `write:packages` scopes and save it as an Actions secret `CR_PAT`
62+
- name: Login to GitHub Container Registry
63+
uses: docker/login-action@v3
64+
with:
65+
registry: ghcr.io
66+
username: ${{ github.repository_owner }}
67+
password: ${{ secrets.CR_PAT }}
68+
69+
- name: Build and publish
70+
id: docker_build
71+
uses: docker/build-push-action@v6
72+
with:
73+
builder: ${{ steps.buildx.outputs.name }}
74+
context: ./costCollector
75+
file: ./costCollector/Dockerfile
76+
platforms: linux/amd64
77+
push: ${{ github.event_name != 'pull_request' }}
78+
tags: ${{ steps.meta.outputs.tags }}
79+
80+
- name: Image digest
81+
run: echo ${{ steps.docker_build.outputs.digest }}

0 commit comments

Comments
 (0)