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

Feature Branch Deploys #98

Draft
wants to merge 38 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
dbb89d2
Add RUN_POPULATE check to run manage.py populate
joyliu-q Oct 24, 2021
dde5574
Exit from script if errors
joyliu-q Oct 24, 2021
9d2b9d0
:art: Modify env variable
joyliu-q Apr 12, 2022
0dd8059
Merge branch 'master' of https://github.com/pennlabs/infrastructure i…
joyliu-q Apr 12, 2022
7698c00
:art: Test Config
joyliu-q Apr 12, 2022
42fe3d9
:memo: Update snapshots
joyliu-q Apr 12, 2022
7326fab
:art: Generate Cleaner Workflow Files
joyliu-q Apr 17, 2022
46d30d4
:new: ADD NUKE JOBS BAHAHAHAHA
joyliu-q Apr 17, 2022
6a02646
:art: Nit formatting
joyliu-q Apr 17, 2022
f8c14d9
Merge branch 'master' of https://github.com/pennlabs/infrastructure i…
joyliu-q Apr 19, 2022
8cdeb4b
:art: Make feature branch deploys optional (safer transition for each…
joyliu-q Apr 19, 2022
b231014
:bug: Fix dedent backslash bug
joyliu-q Apr 19, 2022
88f2edf
:new: [Kittyhawk] Add IS_FEATURE_BRANCH env variable to applications
joyliu-q Apr 19, 2022
2a647a2
:new: [Kittyhawk] Add IS_FEATURE_BRANCH env variable to cronjob conta…
joyliu-q Apr 19, 2022
54c3d51
:boom: [Kraken] Change Feature Branch Deploy Workflow Behavior
joyliu-q Apr 21, 2022
be16591
:art: Rename branch: follow branch prefix naming convention
joyliu-q Apr 21, 2022
1bcff82
:adhesive_bandage: Add Deployment Needs Oops
joyliu-q Apr 21, 2022
a5363ce
:memo: Add nuke to exports
joyliu-q Apr 21, 2022
d93384f
:bug: Handle feature branch but no PR case
joyliu-q Apr 21, 2022
3a42911
:art: Consistent naming
joyliu-q Jun 19, 2022
d7b663e
:art: Nits
joyliu-q Jun 19, 2022
2a11e50
:art: Fix jest tests
joyliu-q Jun 20, 2022
f962d57
Merge branch 'master' of https://github.com/pennlabs/infrastructure i…
joyliu-q Jun 20, 2022
dbb1cdd
:bug: STOP ESCAPING MY BACKSLASHES DEDENT UR A CLOWN
joyliu-q Jun 20, 2022
fff2270
:sweat_drops: Tears have been shed
joyliu-q Jun 20, 2022
15767c5
:arrow_up: Bump version and add changelog
joyliu-q Jun 23, 2022
1b3aecb
:tada: Add Commenting Feature to Deployment
joyliu-q Jun 23, 2022
63ec282
:art: Clean-up
joyliu-q Jun 25, 2022
0bdb237
:arrow_up: Update package.json
joyliu-q Jun 25, 2022
3ac3f57
:bug: Fix deps
joyliu-q Jun 25, 2022
0c5403e
:arrow_up: Bump kittyhawk
joyliu-q Jun 27, 2022
e820a05
:arrow_up: Bump kraken version
joyliu-q Jun 27, 2022
ac8f6a9
:art: Add Docker Publish Support for Feature Branch Deploys
joyliu-q Jun 28, 2022
2fad452
:tada: Fix deploy announcement
joyliu-q Jun 28, 2022
bfc7f01
:tada: Add announcement & fix nuke job
joyliu-q Jun 30, 2022
6e20bfa
:arrow_up: Bump version
joyliu-q Jun 30, 2022
4c618e7
:art: Fix pushing-to-closed-branch bug
joyliu-q Jun 30, 2022
c887d91
:art: Fix snapshots
joyliu-q Jul 5, 2022
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
9 changes: 9 additions & 0 deletions cdk/kittyhawk/src/application/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export class Application extends Construct {
// We want to prepend the project name to the name of each component
const release_name = process.env.RELEASE_NAME || "undefined_release";
const fullname = `${release_name}-${appname}`;
const isFeatureBranch = process.env.IS_FEATURE_BRANCH == "true";
joyliu-q marked this conversation as resolved.
Show resolved Hide resolved

new Service(this, fullname, props.port);

Expand All @@ -48,6 +49,14 @@ export class Application extends Construct {
new Deployment(this, fullname, {
...props.deployment,
port: props.port,
...(isFeatureBranch
? {
env: [
...(props.deployment.env ?? []),
{ name: "IS_FEATURE_BRANCH", value: "true" },
],
}
: {}),
...(props.createServiceAccount
? { serviceAccountName: release_name }
: {}),
Expand Down
7 changes: 7 additions & 0 deletions cdk/kittyhawk/src/cronjob.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,16 @@ export class CronJob extends Construct {
// We want to prepend the project name to the name of each component
const release_name = process.env.RELEASE_NAME ?? "undefined_release";
const fullname = `${release_name}-${jobname}`;
const isFeatureBranch = process.env.IS_FEATURE_BRANCH == "true";

const containers: Container[] = [
new Container({
...props,
...(isFeatureBranch
? {
env: [{ name: "IS_FEATURE_BRANCH", value: "true" }],
}
: {}),
noContainerPorts: true,
}),
];
Expand Down
Loading