Skip to content

Commit

Permalink
slack cd folder (#110)
Browse files Browse the repository at this point in the history
* slack cd folder

* bug fix

* rolling updating

* op

* production deploy
  • Loading branch information
anishfyle authored May 25, 2023
1 parent 7e43f86 commit bd1e479
Show file tree
Hide file tree
Showing 4 changed files with 138 additions and 5 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/production_deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Deploy to Production

on:
release:
types: [created]

jobs:
production_deploy:
runs-on: ubuntu-latest
environment: Production
steps:
- uses: actions/checkout@v2
- uses: satackey/[email protected]
continue-on-error: true
- name: push to dockerhub
uses: fylein/docker-release-action@master
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}
IMAGE_NAME: fyle_slack-app
- name: Deploy to Production
uses: fylein/aws-eks-deploy-action@master
env:
EKS_CLUSTER_NAME: ${{ secrets.EKS_CLUSTER_NAME }}
AWS_REGION: ${{ secrets.AWS_REGION }}
LOCAL_HOST: ${{ secrets.LOCAL_HOST }}
LOCAL_PORT: ${{ secrets.LOCAL_PORT }}
REMOTE_PORT: ${{ secrets.REMOTE_PORT }}
EKS_KUBECTL_ROLE: ${{ secrets.EKS_KUBECTL_ROLE }}
ROLE_SESSION_NAME: ${{ secrets.ROLE_SESSION_NAME }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
KUBERNETES_MANIFEST_FILE_PATH: deployment/production/controller.yml
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_COLOR: ${{ job.status }}
SLACK_MESSAGE: Production Deploy Status - ${{ job.status }}
SLACK_TITLE: Deploy Slack APP to Production
SLACK_ICON_EMOJI: ":pepeok:"
SLACK_USERNAME: SLACK_APP
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_FOOTER: ''
2 changes: 1 addition & 1 deletion .github/workflows/staging_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}
IMAGE_NAME: fyle_netsuite-api
IMAGE_NAME: fyle_slack-app
- name: Deploy to Staging
uses: fylein/aws-eks-deploy-action@master
env:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ spec:
matchLabels:
app: slack-app
strategy:
type: RollingUpdateing
rollingUpdate:
maxUnavailable: 0
maxSurge: 1
type: RollingUpdate
template:
metadata:
labels:
Expand Down Expand Up @@ -69,6 +66,8 @@ spec:
selector:
matchLabels:
app: slack-app-qcluster
strategy:
type: RollingUpdate
template:
metadata:
labels:
Expand Down
90 changes: 90 additions & 0 deletions deployment/staging/controller.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
apiVersion: v1
kind: Service
metadata:
name: slack-app
namespace: integrations
labels:
app: slack-app
spec:
type: ClusterIP
ports:
- port: 8000
selector:
app: slack-app
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: slack-app
namespace: integrations
labels:
app: slack-app
spec:
replicas: 1
selector:
matchLabels:
app: slack-app
strategy:
type: RollingUpdate
template:
metadata:
labels:
app: slack-app
spec:
containers:
- name: slack-app
image: docker.io/{{DOCKERHUB_USERNAME}}/fyle_slack-app:{{RELEASE_VERSION}}
resources:
limits:
memory: 200Mi
requests:
memory: 200Mi
ports:
- containerPort: 8000
readinessProbe:
httpGet:
path: /ready
port: 8000
initialDelaySeconds: 10
timeoutSeconds: 1
envFrom:
- secretRef:
name: slack-app-secrets
terminationGracePeriodSeconds: 60
imagePullSecrets:
- name: myregistrykey2
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: slack-app-qcluster
namespace: integrations
labels:
app: slack-app-qcluster
spec:
replicas: 1
selector:
matchLabels:
app: slack-app-qcluster
strategy:
type: RollingUpdate
template:
metadata:
labels:
app: slack-app-qcluster
spec:
containers:
- name: slack-app
image: docker.io/{{DOCKERHUB_USERNAME}}/fyle_slack-app:{{RELEASE_VERSION}}
resources:
limits:
memory: 400Mi
requests:
memory: 400Mi
command: [ 'bash', 'run_qcluster.sh' ]
envFrom:
- secretRef:
name: slack-app-secrets
terminationGracePeriodSeconds: 60
imagePullSecrets:
- name: myregistrykey2

0 comments on commit bd1e479

Please sign in to comment.