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

chore: remove quickstart from backstage-deploy #35

Merged
merged 2 commits into from
Jan 15, 2024
Merged
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# backstage-deploy

## 0.4.0

### Minor Changes

- Remove all related quickstart functionality. Please refer to the [PR](https://github.com/backstage/backstage-deploy/pull/35) for more information.

## 0.3.2

- Remove trailing slash in container service host url if present
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "backstage-deploy",
"description": "CLI for Backstage deployment tooling",
"version": "0.3.2",
"version": "0.4.0",
"publishConfig": {
"access": "public"
},
Expand Down
2 changes: 1 addition & 1 deletion src/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default async (opts: OptionValues) => {
}
}

const shouldBuildApp = !opts.skipBuild && !opts.destroy && !opts.quickstart;
const shouldBuildApp = !opts.skipBuild && !opts.destroy;
if (shouldBuildApp) {
// run yarn tsc & yarn build for Dockerfile
Task.section(`Building app`);
Expand Down
1 change: 0 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ const main = (argv: string[]) => {
'./.env',
)
.option('--with-db', 'Deploy a Backstage instance with a database', false)
.option('--quickstart', 'Deploys a quickstart instance', false)
.option('--image-uri <image-uri>', 'Url of Docker image')
.action(cmd => deploy(cmd));

Expand Down
38 changes: 10 additions & 28 deletions src/programs/aws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,8 @@ export const AWSProgram = (opts: OptionValues) => {
}

let db: Database | undefined = undefined;
if (opts.withDb || opts.quickstart) {
const DB_ENV_NAME = opts.quickstart
? 'QUICKSTART_SECRET_DATABASE_PASSWORD'
: 'DATABASE_PASSWORD';
if (opts.withDb) {
const DB_ENV_NAME = 'DATABASE_PASSWORD';
if (!providedEnvironmentVariables[DB_ENV_NAME]) {
throw new Error(`Environment variable ${DB_ENV_NAME} is not set`);
}
Expand Down Expand Up @@ -168,22 +166,12 @@ export const AWSProgram = (opts: OptionValues) => {
),
});

const DB_ENVS: Record<string, pulumi.Output<string> | undefined> =
opts.quickstart
? {
QUICKSTART_DATABASE_HOST: db?.masterEndpointAddress,
QUICKSTART_DATABASE_PORT: db?.masterEndpointPort.apply(v =>
v.toString(),
),
QUICKSTART_DATABASE_USER: db?.masterUsername,
QUICKSTART_SECRET_DATABASE_PASSWORD: db?.masterPassword,
}
: {
DATABASE_HOST: db?.masterEndpointAddress,
DATABASE_PORT: db?.masterEndpointPort.apply(v => v.toString()),
DATABASE_USER: db?.masterUsername,
DATABASE_PASSWORD: db?.masterPassword,
};
const DB_ENVS: Record<string, pulumi.Output<string> | undefined> = {
DATABASE_HOST: db?.masterEndpointAddress,
DATABASE_PORT: db?.masterEndpointPort.apply(v => v.toString()),
DATABASE_USER: db?.masterUsername,
DATABASE_PASSWORD: db?.masterPassword,
};

const containerServiceUrl = containerService.url.apply(url =>
url.endsWith('/') ? url.slice(0, -1) : url,
Expand All @@ -202,15 +190,9 @@ export const AWSProgram = (opts: OptionValues) => {
'7007': 'HTTP',
},
environment: {
...(opts.quickstart
? {
APP_CONFIG_app_baseUrl: containerService.url,
}
: {
BACKSTAGE_HOST: containerServiceUrl,
}),
BACKSTAGE_HOST: containerServiceUrl,
...providedEnvironmentVariables,
...(opts.withDb || opts.quickstart ? DB_ENVS : {}),
...(opts.withDb ? DB_ENVS : {}),
},
},
],
Expand Down