-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build and deploy platform-dev (#110)
* Build and deploy platform-dev * Remove asgi section
- Loading branch information
Showing
4 changed files
with
108 additions
and
7 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 |
---|---|---|
@@ -1,10 +1,51 @@ | ||
import { App } from "cdkactions"; | ||
import { LabsApplicationStack } from "@pennlabs/kraken"; | ||
import { App, Stack, Workflow } from "cdkactions"; | ||
import { DeployJob, DjangoProject, DockerPublishJob, ReactProject } from "@pennlabs/kraken"; | ||
import { Construct } from "constructs"; | ||
|
||
const app = new App(); | ||
new LabsApplicationStack(app, { | ||
djangoProjectName: 'Platform', | ||
dockerImageBaseName: 'platform', | ||
}); | ||
class PlatformStack extends Stack { | ||
public constructor(scope: Construct, name: string) { | ||
super(scope, name); | ||
|
||
const workflow = new Workflow(this, "build-and-deploy", { | ||
name: "Build and Deploy", | ||
on: "push", | ||
}); | ||
|
||
const backend = new DjangoProject(workflow, { | ||
projectName: "Platform", | ||
path: "backend", | ||
imageName: "platform-backend", | ||
}); | ||
|
||
const publishPlatformDev = new DockerPublishJob(workflow, 'platform-dev', { | ||
imageName: "platform-dev", | ||
path: "backend", | ||
dockerfile: "Dockerfile.dev" | ||
}, | ||
{ | ||
needs: "django-check" | ||
}); | ||
|
||
const frontend = new ReactProject(workflow, { | ||
path: "frontend", | ||
imageName: "platform-frontend", | ||
}); | ||
|
||
new DeployJob( | ||
workflow, | ||
{}, | ||
{ | ||
needs: [ | ||
backend.publishJobId, | ||
frontend.publishJobId, | ||
publishPlatformDev.id, | ||
], | ||
} | ||
); | ||
|
||
} | ||
} | ||
|
||
new PlatformStack(app, 'platform') | ||
app.synth(); |
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
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,18 @@ | ||
FROM pennlabs/django-base:9a59b9133a4c82d8391b282a3a39685d7ac6738d | ||
|
||
LABEL maintainer="Penn Labs" | ||
|
||
# Copy project dependencies | ||
COPY Pipfile* /app/ | ||
|
||
# Install project dependencies | ||
RUN pipenv install --system | ||
|
||
# Copy project files | ||
COPY . /app/ | ||
|
||
ENV DJANGO_SETTINGS_MODULE Platform.settings.production | ||
ENV SECRET_KEY 'temporary key just to build the docker image' | ||
|
||
# Collect static files | ||
RUN python3 /app/manage.py collectstatic --noinput |
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