Skip to content

Commit

Permalink
ci: fix image building
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien-R44 committed Dec 31, 2023
1 parent 31faad2 commit 6c5b337
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@ FROM base as production-deps
WORKDIR /app
ADD package.json pnpm-lock.yaml ./
RUN pnpm install --prod
RUN wget https://gobinaries.com/tj/node-prune --output-document - | /bin/sh && node-prune

# Build stage
FROM base as build
WORKDIR /app
COPY --from=deps /app/node_modules /app/node_modules
ADD . .
RUN node ace build --ignore-ts-errors --package-manager=pnpm
RUN node ace build
RUN node ace build:packages

# Production stage
Expand Down
11 changes: 2 additions & 9 deletions commands/build_packages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,12 @@ import { BaseCommand } from '@adonisjs/core/ace'
import { mkdir, readFile, writeFile } from 'node:fs/promises'
import type { CommandOptions } from '@adonisjs/core/types/ace'

import { PackageFetcher } from '#services/package_fetcher'
import { PackagesDataRefresher } from '#services/packages_data_refresher'

export default class BuildPackages extends BaseCommand {
static options: CommandOptions = { startApp: false }

static commandName = 'build:packages'
static description = 'Create a big packages.json file with all the packages.'

static options: CommandOptions = {
startApp: true,
}

#contentFolder = join(getDirname(import.meta.url), '../content')
#distFolder = join(getDirname(import.meta.url), '../content/build/')

Expand Down Expand Up @@ -50,8 +45,6 @@ export default class BuildPackages extends BaseCommand {
await mkdir(this.#distFolder, { recursive: true })
await writeFile(distFile, JSON.stringify(packages, null, 2))

await new PackagesDataRefresher(new PackageFetcher(), packages as any).refresh()

this.logger.success(`Packages file created successfully at "${distFile}"`)
}
}

0 comments on commit 6c5b337

Please sign in to comment.