-
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.
Adding support for Prod Deployment (#188)
- Loading branch information
Showing
4 changed files
with
139 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,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_PASSWORD }} | ||
IMAGE_NAME: fyle_xero-api | ||
- 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 Xero API to Production | ||
SLACK_ICON_EMOJI: ":pepeok:" | ||
SLACK_USERNAME: QBO_API | ||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
SLACK_FOOTER: '' |
File renamed without changes.
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 |
---|---|---|
|
@@ -12,6 +12,7 @@ __pycache__/ | |
|
||
# Test files | ||
test.py | ||
debugger | ||
|
||
# Cache | ||
demo_cache.sqlite | ||
|
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,94 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: xero-api | ||
namespace: integrations | ||
labels: | ||
app: xero-api | ||
spec: | ||
ports: | ||
- port: 8000 | ||
selector: | ||
app: xero-api | ||
type: ClusterIP | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: xero-api | ||
namespace: integrations | ||
labels: | ||
app: xero-api | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: xero-api | ||
strategy: | ||
type: RollingUpdate | ||
template: | ||
metadata: | ||
labels: | ||
app: xero-api | ||
spec: | ||
containers: | ||
- name: xero-api | ||
image: docker.io/{{DOCKERHUB_USERNAME}}/fyle_xero-api:{{RELEASE_VERSION}} | ||
resources: | ||
limits: | ||
memory: 300Mi | ||
requests: | ||
memory: 300Mi | ||
env: | ||
- name: GET_HOSTS_FROM | ||
value: dns | ||
ports: | ||
- containerPort: 8000 | ||
readinessProbe: | ||
httpGet: | ||
path: /api/workspaces/ready/ | ||
port: 8000 | ||
initialDelaySeconds: 10 | ||
timeoutSeconds: 1 | ||
envFrom: | ||
- secretRef: | ||
name: xero-api-secrets | ||
imagePullSecrets: | ||
- name: myregistrykey2 | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: xero-api-qcluster | ||
namespace: integrations | ||
labels: | ||
app: xero-api-qcluster | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: xero-api-qcluster | ||
strategy: | ||
type: RollingUpdate | ||
template: | ||
metadata: | ||
labels: | ||
app: xero-api-qcluster | ||
spec: | ||
containers: | ||
- name: xero-api | ||
image: docker.io/{{DOCKERHUB_USERNAME}}/fyle_xero-api:{{RELEASE_VERSION}} | ||
command: ['/bin/bash', 'start_qcluster.sh'] | ||
resources: | ||
limits: | ||
memory: 650Mi | ||
requests: | ||
memory: 650Mi | ||
env: | ||
- name: GET_HOSTS_FROM | ||
value: dns | ||
envFrom: | ||
- secretRef: | ||
name: xero-api-secrets | ||
imagePullSecrets: | ||
- name: myregistrykey2 |