Hey there,
According to the atlassian/serverless-deploy:1.2.0 (https://bitbucket.org/atlassian/serverless-deploy/src/master/), to set different Serverless configuration file we should define CONFIG param. However, it doesn't say anything about the ts-node.
Anyway, after config it according to the doc:
image: atlassian/default-image:3
pipelines:
pull-requests:
master:
- step:
name: Deploy to Production
deployment: Production
script:
- pipe: atlassian/serverless-deploy:1.0.0
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: 'us-east-1'
CONFIG: 'serverless.ts'
EXTRA_ARGS: '--stage production --verbose'
I got the following error.
So, I was wondering if you guys have any idea.
Hello @Antonio Lopes and thank you for reaching out to Community!
From the error being shown, it seems like your serverless deploy is looking for the ts-node package, but this does come installed in the pipe's container by default.
In such case, you can install the ts-node package and any other package you need by using the pipe's variable
PRE_EXECUTION_SCRIPT
This should point to a script file that will be run inside the pipe's container at the beginning of its execution.
In the example below, we are creating a script during the run-time to install typescript and ts-node packages, and executing it inside the pipe as a PRE_EXECUTION_SCRIPT :
script: - echo 'npm install typescript ts-node' > .my-script.sh - chmod 005 my-script.sh - pipe: atlassian/serverless-deploy:1.2.0 variables: AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: 'us-east-1'
CONFIG: 'serverless.ts'
EXTRA_ARGS: '--stage production --verbose' PRE_EXECUTION_SCRIPT: '.my-script.sh'
Hope that helps! Let me know in case you have any questions.
Thank you, @Antonio Lopes !
Patrik S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.