chore: use the e2e test method for building uffizi containers

Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
blam
2022-12-21 11:04:21 +01:00
parent bf9d3fc29a
commit 78b593f9ad
3 changed files with 21 additions and 2 deletions
+1 -1
View File
@@ -28,7 +28,7 @@ jobs:
- name: backstage create-app | delete if already exists
run: |
rm -rf ./example-app
npx @backstage/create-app
node ./packages/e2e-test/.bin/e2e-test create -o ./example-app
env:
BACKSTAGE_APP_NAME: example-app
+2 -1
View File
@@ -15,8 +15,9 @@
*/
import { Command } from 'commander';
import { run } from './run';
import { run, create } from './run';
export function registerCommands(program: Command) {
program.command('run').description('Run e2e tests').action(run);
program.command('create').option('-o, --output <path>').action(create);
}
+18
View File
@@ -43,6 +43,24 @@ const templatePackagePaths = [
'packages/create-app/templates/default-app/packages/backend/package.json.hbs',
];
export async function create({ output }: { output: string }) {
const outputDir = resolvePath(process.cwd(), output);
const rootDir = await fs.mkdtemp(resolvePath(os.tmpdir(), 'backstage-e2e-'));
print(`CLI E2E test root: ${rootDir}\n`);
print('Building dist workspace');
const workspaceDir = await buildDistWorkspace('workspace', rootDir);
// // Otherwise yarn will refuse to install with CI=true
process.env.YARN_ENABLE_IMMUTABLE_INSTALLS = 'false';
print('Creating a Backstage App');
const appDir = await createApp('test-app', workspaceDir, rootDir);
await fs.move(appDir, outputDir, { overwrite: true });
}
export async function run() {
const rootDir = await fs.mkdtemp(resolvePath(os.tmpdir(), 'backstage-e2e-'));
print(`CLI E2E test root: ${rootDir}\n`);