Skip to content

Commit

Permalink
chore(workflow): test build push and update value
Browse files Browse the repository at this point in the history
  • Loading branch information
EchoSkorJjj committed Apr 28, 2024
1 parent 5eabb53 commit f54b271
Show file tree
Hide file tree
Showing 8 changed files with 78 additions and 31 deletions.
20 changes: 18 additions & 2 deletions .github/workflows/notes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,21 @@ jobs:
context: ./backend/simple/notes/
file: ./backend/simple/notes/Notes.Dockerfile
push: true
tags: ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/${{ secrets.ECR_REPOSITORY }}:notes
platforms: linux/arm64
tags: ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/${{ secrets.ECR_REPOSITORY }}:notes-${{ github.sha }}
platforms: linux/arm64

- name: Clone deployment repository
uses: actions/checkout@v3
with:
repository: ${{ secrets.DEPLOYMENT_REPO }}
token: ${{ secrets.DEPLOYMENT_REPO_TOKEN }}
path: 'deployment-repo'

- name: Update Kubernetes deployment image
run: |
cd deployment-repo
sed -i 's|image: .*|image: ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/${{ secrets.ECR_REPOSITORY }}:notes-${{ github.sha }}|' ./kubernetes/simple/notes/notes-deployment.yaml
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git commit -am "Update image tag to ${{ github.sha }}"
git push
22 changes: 19 additions & 3 deletions .github/workflows/payment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches:
- main
- feat/build-push
- chore/build-push
paths:
- 'backend/simple/payment/**'

Expand Down Expand Up @@ -35,5 +35,21 @@ jobs:
context: ./backend/simple/payment/
file: ./backend/simple/payment/Payment.Dockerfile
push: true
tags: ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/${{ secrets.ECR_REPOSITORY }}:payment
platforms: linux/arm64
tags: ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/${{ secrets.ECR_REPOSITORY }}:payment-${{ github.sha }}
platforms: linux/arm64

- name: Clone deployment repository
uses: actions/checkout@v3
with:
repository: ${{ secrets.DEPLOYMENT_REPO }}
token: ${{ secrets.DEPLOYMENT_REPO_TOKEN }}
path: 'deployment-repo'

- name: Update Kubernetes deployment image
run: |
cd deployment-repo
sed -i 's|image: .*|image: ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/${{ secrets.ECR_REPOSITORY }}:payment-${{ github.sha }}|' ./kubernetes/simple/payment/payment-deployment.yaml
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git commit -am "Update image tag to ${{ github.sha }}"
git push
22 changes: 19 additions & 3 deletions .github/workflows/subscriptions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches:
- main
- feat/build-push
- chore/build-push
paths:
- 'backend/simple/subscriptions/**'

Expand Down Expand Up @@ -35,5 +35,21 @@ jobs:
context: ./backend/simple/subscriptions/
file: ./backend/simple/subscriptions/Subscriptions.Dockerfile
push: true
tags: ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/${{ secrets.ECR_REPOSITORY }}:subscriptions
platforms: linux/arm64
tags: ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/${{ secrets.ECR_REPOSITORY }}:subscriptions-${{ github.sha }}
platforms: linux/arm64

- name: Clone deployment repository
uses: actions/checkout@v3
with:
repository: ${{ secrets.DEPLOYMENT_REPO }}
token: ${{ secrets.DEPLOYMENT_REPO_TOKEN }}
path: 'deployment-repo'

- name: Update Kubernetes deployment image
run: |
cd deployment-repo
sed -i 's|image: .*|image: ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/${{ secrets.ECR_REPOSITORY }}:subscriptions-${{ github.sha }}|' ./kubernetes/simple/subscriptions/subscriptions-deployment.yaml
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git commit -am "Update image tag to ${{ github.sha }}"
git push
22 changes: 19 additions & 3 deletions .github/workflows/user-storage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches:
- main
- feat/build-push
- chore/build-push
paths:
- 'backend/simple/user-storage/**'

Expand Down Expand Up @@ -35,5 +35,21 @@ jobs:
context: ./backend/simple/user-storage/
file: ./backend/simple/user-storage/UserStorage.Dockerfile
push: true
tags: ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/${{ secrets.ECR_REPOSITORY }}:user-storage
platforms: linux/arm64
tags: ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/${{ secrets.ECR_REPOSITORY }}:user-storage-${{ github.sha }}
platforms: linux/arm64

- name: Clone deployment repository
uses: actions/checkout@v3
with:
repository: ${{ secrets.DEPLOYMENT_REPO }}
token: ${{ secrets.DEPLOYMENT_REPO_TOKEN }}
path: 'deployment-repo'

- name: Update Kubernetes deployment image
run: |
cd deployment-repo
sed -i 's|image: .*|image: ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/${{ secrets.ECR_REPOSITORY }}:user-storage-${{ github.sha }}|' ./kubernetes/simple/user-storage/user-storage-deployment.yaml
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git commit -am "Update image tag to ${{ github.sha }}"
git push
18 changes: 1 addition & 17 deletions backend/simple/notes/Notes.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,4 @@ RUN GRPC_HEALTH_PROBE_VERSION=v0.4.13 && \
chmod +x /bin/grpc_health_probe

COPY --from=builder /app/dist/server server
CMD ["./server"]

# FROM python:3.11.7 as builder
# WORKDIR /app
# RUN pip install pyinstaller
# COPY requirements.txt .
# RUN pip install --no-cache-dir -r requirements.txt
# COPY process_proto.sh .
# COPY src/ /app/
# ENV PYTHONPATH /app/:/app/src/pb/:$PYTHONPATH
# RUN chmod +x process_proto.sh && ./process_proto.sh
# RUN pyinstaller --onefile server.py

# FROM debian:stable-slim
# WORKDIR /app
# COPY --from=builder /app/dist/server server
# CMD ["./server"]
CMD ["./server"]
2 changes: 1 addition & 1 deletion backend/simple/payment/Payment.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ RUN GRPC_HEALTH_PROBE_VERSION=v0.4.13 && \

COPY --from=proto-base /app/pb/ /app/pb/
COPY src/ src/
CMD ["ruby", "src/server.rb"]
CMD ["ruby", "src/server.rb"]
1 change: 0 additions & 1 deletion backend/simple/subscriptions/Subscriptions.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,3 @@ RUN GRPC_HEALTH_PROBE_VERSION=v0.4.13 && \

COPY --from=builder /app/build/SUBSCRIPTIONS_SERVICE /app/server
CMD ["./server"]

2 changes: 1 addition & 1 deletion backend/simple/user-storage/UserStorage.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ COPY --from=build /app/node_modules ./node_modules
COPY --from=build /bin/grpc_health_probe /bin/grpc_health_probe

# Command to run the application
CMD ["./dist/src/index.js"]
CMD ["./dist/src/index.js"]

0 comments on commit f54b271

Please sign in to comment.