Skip to content

Commit 60f3357

Browse files
committed
fix: add failsafes
1 parent fcc50a6 commit 60f3357

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

packages/build/src/extensions/lightpanda.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { BuildExtension } from "@trigger.dev/core/v3/build";
1+
import type { BuildExtension } from "@trigger.dev/core/v3/build"
22

33
const NAME = 'LightpandaExtension'
44

@@ -11,8 +11,8 @@ type LightpandaOpts = {
1111
export const lightpanda = ({ arch = 'x86_64', version = 'nightly', disableTelemetry = false }: LightpandaOpts = {}): BuildExtension => ({
1212
name: NAME,
1313
onBuildComplete: async (context) => {
14-
context.logger.progress(`Running ${NAME} on ${context.target} env for arch ${arch}`);
15-
context.logger.progress(`version: ${version}`);
14+
context.logger.progress(`Running ${NAME} on ${context.target} env for arch ${arch}`)
15+
context.logger.progress(`version: ${version}`)
1616

1717
if (context.target === "dev") {
1818
return
@@ -35,9 +35,10 @@ export const lightpanda = ({ arch = 'x86_64', version = 'nightly', disableTeleme
3535

3636
/* Install Lightpanda */
3737
instructions.push(
38-
`RUN curl -L -o lightpanda https://github.com/lightpanda-io/browser/releases/download/${version}/lightpanda-${arch}-linux \
38+
`RUN curl -L -f --retry 3 -o lightpanda https://github.com/lightpanda-io/browser/releases/download/${version}/lightpanda-${arch}-linux || (echo "Failed to download Lightpanda binary" && exit 1) \
3939
&& chmod a+x ./lightpanda \
4040
&& mv ./lightpanda /usr/bin/lightpanda \
41+
&& /usr/bin/lightpanda version || (echo "Downloaded binary is not functional" && exit 1)`,
4142
)
4243

4344
context.addLayer({

0 commit comments

Comments
 (0)