-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 41b364b
Showing
60 changed files
with
3,368 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Consumer-CI | ||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- '04-consumer/**' # Any change in this path, make trigger build action. | ||
- '.github/workflows/consumer-ci.yaml' | ||
|
||
env: | ||
REPO_APP: 'mqtt-consumer' | ||
SLACK_CHANNEL: 'builds-and-ci' | ||
SLACK_MSG_COLOR: '#0092ff' | ||
BUILD_CONTEXT: './04-consumer' | ||
|
||
jobs: | ||
Consumer-CI_build-docker-image: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Generate tag ID | ||
id: tag_id | ||
run: echo "::set-output name=IMAGE_TAG::$(date +%Y.%m)" | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: ${{ env.BUILD_CONTEXT }} | ||
push: true | ||
tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.REPO_APP }}:${{ steps.tag_id.outputs.IMAGE_TAG }} | ||
|
||
- name: Run Trivy vulnerability scanner | ||
uses: aquasecurity/trivy-action@master | ||
with: | ||
image-ref: '${{ secrets.DOCKERHUB_USERNAME }}/${{ env.REPO_APP }}:${{ steps.tag_id.outputs.IMAGE_TAG }}' | ||
format: 'table' | ||
ignore-unfixed: true | ||
vuln-type: 'os,library' | ||
severity: 'CRITICAL,HIGH' | ||
#exit-code: '1' | ||
|
||
- name: Slack Notification | ||
uses: rtCamp/action-slack-notify@v2 | ||
env: | ||
SLACK_CHANNEL: ${{ env.SLACK_CHANNEL }} | ||
SLACK_COLOR: ${{ env.SLACK_MSG_COLOR }} | ||
SLACK_MESSAGE: 'URL: https://hub.docker.com/repository/docker/${{ secrets.DOCKERHUB_USERNAME }}/${{ env.REPO_APP }}' | ||
SLACK_TITLE: ':rocket: GithubAction Build docker image: [ ${{ env.REPO_APP }}:${{ steps.tag_id.outputs.IMAGE_TAG }} ]' | ||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: DBWriter-CI | ||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- '05-dbwriter/**' # Any change in this path, make trigger build action. | ||
- '.github/workflows/dbwriter-ci.yaml' | ||
|
||
env: | ||
REPO_APP: 'mqtt-dbwriter' | ||
SLACK_CHANNEL: 'builds-and-ci' | ||
SLACK_MSG_COLOR: '#0092ff' | ||
BUILD_CONTEXT: './05-dbwriter' | ||
|
||
jobs: | ||
DBWriter-CI_build-docker-image: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Generate tag ID | ||
id: tag_id | ||
run: echo "::set-output name=IMAGE_TAG::$(date +%Y.%m)" | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: ${{ env.BUILD_CONTEXT }} | ||
push: true | ||
tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.REPO_APP }}:${{ steps.tag_id.outputs.IMAGE_TAG }} | ||
|
||
- name: Run Trivy vulnerability scanner | ||
uses: aquasecurity/trivy-action@master | ||
with: | ||
image-ref: '${{ secrets.DOCKERHUB_USERNAME }}/${{ env.REPO_APP }}:${{ steps.tag_id.outputs.IMAGE_TAG }}' | ||
format: 'table' | ||
ignore-unfixed: true | ||
vuln-type: 'os,library' | ||
severity: 'CRITICAL,HIGH' | ||
#exit-code: '1' | ||
|
||
- name: Slack Notification | ||
uses: rtCamp/action-slack-notify@v2 | ||
env: | ||
SLACK_CHANNEL: ${{ env.SLACK_CHANNEL }} | ||
SLACK_COLOR: ${{ env.SLACK_MSG_COLOR }} | ||
SLACK_MESSAGE: 'URL: https://hub.docker.com/repository/docker/${{ secrets.DOCKERHUB_USERNAME }}/${{ env.REPO_APP }}' | ||
SLACK_TITLE: ':rocket: GithubAction Build docker image: [ ${{ env.REPO_APP }}:${{ steps.tag_id.outputs.IMAGE_TAG }} ]' | ||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: k8s-event-exporter-CI | ||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- '12-k8s-event-exporter/**' # Any change in this path, make trigger build action. | ||
- '.github/workflows/k8s-event-exporter-ci.yaml' | ||
|
||
env: | ||
REPO_APP: 'k8s-event-exporter' | ||
SLACK_CHANNEL: 'builds-and-ci' | ||
SLACK_MSG_COLOR: '#0092ff' | ||
BUILD_CONTEXT: './12-k8s-event-exporter' | ||
|
||
jobs: | ||
Build-Docker-image: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Generate tag ID | ||
id: tag_id | ||
run: echo "::set-output name=IMAGE_TAG::$(date +%Y.%m)" | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: ${{ env.BUILD_CONTEXT }} | ||
push: true | ||
tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.REPO_APP }}:${{ steps.tag_id.outputs.IMAGE_TAG }} | ||
|
||
- name: Run Trivy vulnerability scanner | ||
uses: aquasecurity/trivy-action@master | ||
with: | ||
image-ref: '${{ secrets.DOCKERHUB_USERNAME }}/${{ env.REPO_APP }}:${{ steps.tag_id.outputs.IMAGE_TAG }}' | ||
format: 'table' | ||
ignore-unfixed: true | ||
vuln-type: 'os,library' | ||
severity: 'CRITICAL,HIGH' | ||
#exit-code: '1' | ||
|
||
- name: Slack Notification | ||
uses: rtCamp/action-slack-notify@v2 | ||
env: | ||
SLACK_CHANNEL: ${{ env.SLACK_CHANNEL }} | ||
SLACK_COLOR: ${{ env.SLACK_MSG_COLOR }} | ||
SLACK_MESSAGE: 'URL: https://hub.docker.com/repository/docker/${{ secrets.DOCKERHUB_USERNAME }}/${{ env.REPO_APP }}' | ||
SLACK_TITLE: ':rocket: GithubAction Build docker image: [ ${{ env.REPO_APP }}:${{ steps.tag_id.outputs.IMAGE_TAG }} ]' | ||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: Producer-CI | ||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- '03-producer/**' # Any change in this path, make trigger build action. | ||
- '.github/workflows/producer-ci.yaml' | ||
|
||
env: | ||
REPO_APP: 'mqtt-producer' | ||
SLACK_CHANNEL: 'builds-and-ci' | ||
SLACK_MSG_COLOR: '#0092ff' | ||
BUILD_CONTEXT: './03-producer' | ||
|
||
jobs: | ||
Producer-CI_build-docker-image: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Generate tag ID | ||
id: tag_id | ||
run: echo "::set-output name=IMAGE_TAG::$(date +%Y.%m)" | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: ${{ env.BUILD_CONTEXT }} | ||
push: true | ||
tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.REPO_APP }}:${{ steps.tag_id.outputs.IMAGE_TAG }} | ||
|
||
- name: Run Trivy vulnerability scanner | ||
uses: aquasecurity/trivy-action@master | ||
with: | ||
image-ref: '${{ secrets.DOCKERHUB_USERNAME }}/${{ env.REPO_APP }}:${{ steps.tag_id.outputs.IMAGE_TAG }}' | ||
format: 'table' | ||
ignore-unfixed: true | ||
vuln-type: 'os,library' | ||
severity: 'CRITICAL,HIGH' | ||
#exit-code: '1' | ||
|
||
- name: Slack Notification | ||
uses: rtCamp/action-slack-notify@v2 | ||
env: | ||
SLACK_CHANNEL: ${{ env.SLACK_CHANNEL }} | ||
SLACK_COLOR: ${{ env.SLACK_MSG_COLOR }} | ||
SLACK_MESSAGE: 'URL: https://hub.docker.com/repository/docker/${{ secrets.DOCKERHUB_USERNAME }}/${{ env.REPO_APP }}' | ||
SLACK_TITLE: ':rocket: GithubAction Build docker image: [ ${{ env.REPO_APP }}:${{ steps.tag_id.outputs.IMAGE_TAG }} ]' | ||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: webserver-CI | ||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- '06-webserver/**' # Any change in this path, make trigger build action. | ||
- '.github/workflows/webserver-ci.yaml' | ||
|
||
env: | ||
REPO_APP: 'mqtt-webserver' | ||
SLACK_CHANNEL: 'builds-and-ci' | ||
SLACK_MSG_COLOR: '#0092ff' | ||
BUILD_CONTEXT: './06-webserver' | ||
|
||
jobs: | ||
webserver-CI_build-docker-image: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Generate tag ID | ||
id: tag_id | ||
run: echo "::set-output name=IMAGE_TAG::$(date +%Y.%m)" | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: ${{ env.BUILD_CONTEXT }} | ||
push: true | ||
tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.REPO_APP }}:${{ steps.tag_id.outputs.IMAGE_TAG }} | ||
|
||
- name: Run Trivy vulnerability scanner | ||
uses: aquasecurity/trivy-action@master | ||
with: | ||
image-ref: '${{ secrets.DOCKERHUB_USERNAME }}/${{ env.REPO_APP }}:${{ steps.tag_id.outputs.IMAGE_TAG }}' | ||
format: 'table' | ||
ignore-unfixed: true | ||
vuln-type: 'os,library' | ||
severity: 'CRITICAL,HIGH' | ||
#exit-code: '1' | ||
|
||
- name: Slack Notification | ||
uses: rtCamp/action-slack-notify@v2 | ||
env: | ||
SLACK_CHANNEL: ${{ env.SLACK_CHANNEL }} | ||
SLACK_COLOR: ${{ env.SLACK_MSG_COLOR }} | ||
SLACK_MESSAGE: 'URL: https://hub.docker.com/repository/docker/${{ secrets.DOCKERHUB_USERNAME }}/${{ env.REPO_APP }}' | ||
SLACK_TITLE: ':rocket: GithubAction Build docker image: [ ${{ env.REPO_APP }}:${{ steps.tag_id.outputs.IMAGE_TAG }} ]' | ||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
**/*.log | ||
**/*_bkp | ||
**/*_tmp | ||
**/*.ignore | ||
**/*.key | ||
**/*.pem | ||
**/*.secure | ||
temp/ | ||
tmp/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FROM alpine:latest | ||
WORKDIR /app | ||
ADD ./pubsub.py /app/api.py | ||
RUN apk add python3 py3-pip bind-tools && pip3 install flask pika prometheus_client | ||
CMD [ "python3", "-u", "./api.py" ] |
Oops, something went wrong.