Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If Deploy Two Separate Backend, Use This #56

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions .github/workflows/shared-build-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
uses: pennlabs/shared-actions/.github/workflows/[email protected]
with:
# Inputs
imageName: "penn-courses-backend"
imageName: "penn-degree-plan-backend"
githubRef: ${{ github.ref }}
gitSha: ${{ github.sha }}

Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
strategy:
fail-fast: true
matrix:
product: [review, plan, alert]
product: [degree-plan]
with:
path: frontend/${{ matrix.product }}

Expand All @@ -61,7 +61,7 @@ jobs:
strategy:
fail-fast: true
matrix:
product: [{name: pcr, path: review}, {name: pcp, path: plan}, {name: pca, path: alert}]
product: [{name: pcr, path: review}, {name: pcp, path: plan}, {name: pca, path: alert}, {name: pdp, path: degree-plan}]
with:
# Inputs
imageName: "${{ matrix.product.name }}-frontend"
Expand All @@ -88,26 +88,26 @@ jobs:

# Landing
# ========================================================================================================
publish-landing:
uses: pennlabs/shared-actions/.github/workflows/[email protected]
with:
# Inputs
imageName: "pcx-landing"
githubRef: ${{ github.ref }}
gitSha: ${{ github.sha }}
# publish-landing:
# uses: pennlabs/shared-actions/.github/workflows/[email protected]
# with:
# # Inputs
# imageName: "pcx-landing"
# githubRef: ${{ github.ref }}
# gitSha: ${{ github.sha }}

# Path to the docker context
path: frontend/landing
# # Path to the docker context
# path: frontend/landing

# Path to the dockerfile (relative to `path` variable)
dockerfile: Dockerfile
# # Path to the dockerfile (relative to `path` variable)
# dockerfile: Dockerfile

# If enabled, will cache_from the latest version of the docker image.
cache: true
# # If enabled, will cache_from the latest version of the docker image.
# cache: true

secrets:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
# secrets:
# DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
# DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
# ========================================================================================================

# Deploy
Expand Down
47 changes: 5 additions & 42 deletions k8s/main.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import { Construct } from 'constructs';
import { App } from 'cdk8s';
import { CronJob, DjangoApplication, PennLabsChart, ReactApplication, RedisApplication } from '@pennlabs/kittyhawk';
import { DjangoApplication, PennLabsChart, ReactApplication, RedisApplication } from '@pennlabs/kittyhawk';

const cronTime = require('cron-time-generator');

export class MyChart extends PennLabsChart {
constructor(scope: Construct) {
super(scope);

const backendImage = 'pennlabs/penn-courses-backend';
const backendImage = 'pennlabs/penn-degree-plan-backend';
const secret = 'penn-courses';
const ingressProps = {
annotations: {
Expand Down Expand Up @@ -60,48 +59,12 @@ export class MyChart extends PennLabsChart {
domains: [{ host: 'penncoursereview.com', paths: ["/api/ws"] }],
});

new ReactApplication(this, 'landing', {
new ReactApplication(this, 'degree-plan', {
deployment: {
image: 'pennlabs/pcx-landing',
image: 'pennlabs/pdp-frontend',
},
domain: { host: 'penncourses.org', paths: ['/'] },
domain: { host: 'penndegreeplan.com', paths: ['/'] },
});

new ReactApplication(this, 'plan', {
deployment: {
image: 'pennlabs/pcp-frontend',
},
domain: { host: 'penncourseplan.com', paths: ['/'] },
});

new ReactApplication(this, 'alert', {
deployment: {
image: 'pennlabs/pca-frontend',
},
domain: { host: 'penncoursealert.com', paths: ['/'] },
});

new ReactApplication(this, 'review', {
deployment: {
image: 'pennlabs/pcr-frontend',
},
domain: { host: 'penncoursereview.com', paths: ['/'] },
});

new CronJob(this, 'load-courses', {
schedule: cronTime.everyDayAt(3),
image: backendImage,
secret,
cmd: ['python', 'manage.py', 'registrarimport'],
});

new CronJob(this, 'report-stats', {
schedule: cronTime.everyDayAt(20),
image: backendImage,
secret,
cmd: ['python', 'manage.py', 'alertstats', '1', '--slack'],
});

}
}

Expand Down
Loading