I am trying to use the latest version of yarn configured locally also in my pipeline.
I upgraded our node image to version 18 in hopes that would use the latest version of yarn.
Once that didn't work I added a script command in our step to install yarn and it keeps failing and using the old version of yarn.
I am trying to use the latest version of yarn configured locally also in my pipeline.
I upgraded our node image to version 18 in hopes that would use the latest version of yarn.
Once that didn't work I added a script command in our step to install yarn and it keeps failing and using the old version of yarn.
image: node:18
definitions:
steps:
- step: &yarnInstall
name: Yarn Install
script:
- npm install yarn
- yarn
- step: &test
name: Test
script:
- yarn test --detectOpenHandles --forceExit --changedSince $BITBUCKET_COMMIT
- step: &build
name: Build
size: 2x
script:
- NODE_ENV=${BUILD_ENV} yarn build
artifacts:
- build/**
- step: &deploy_s3
name: Deploy to S3
script:
- pipe: atlassian/aws-s3-deploy:0.3.8
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
S3_BUCKET: $S3_BUCKET
LOCAL_PATH: "./build/"
ACL: 'public-read'
- step: &auto_merge_down
name: Auto Merge Down
script:
- ./autoMerge.sh stage || true
- ./autoMerge.sh dev || true
caches:
jest: /tmp/jest_*
# although bitbucket-pipelines provides a predefined node cache
# upon research and running the pipeline, it does not cache
# for the yarn install command and does not improve performance
# from the comments on bitbucket forums, no one is sure why exactly
# so we need a custom node cache
node-custom: ./node_modules
pipelines:
branches:
feature/1204050745005198:
- step:
caches:
- node-custom
<<: *yarnInstall
- parallel:
fail-fast: true
steps:
- step:
caches:
- node-custom
- jest
<<: *test
- step:
caches:
- node-custom
<<: *build
deployment: Release Env
- step:
<<: *deploy_s3
deployment: Release
dev:
- step:
caches:
- node-custom
<<: *yarnInstall
- parallel:
fail-fast: true
steps:
- step:
caches:
- node-custom
- jest
<<: *test
- step:
caches:
- node-custom
<<: *build
deployment: Dev Env
- step:
<<: *deploy_s3
deployment: Dev
stage:
- step:
caches:
- node-custom
<<: *yarnInstall
- parallel:
fail-fast: true
steps:
- step:
caches:
- node-custom
- jest
<<: *test
- step:
caches:
- node-custom
<<: *build
deployment: Staging Env
- step:
<<: *deploy_s3
deployment: Staging
prod:
- step:
caches:
- node-custom
- jest
<<: *yarnInstall
- parallel:
fail-fast: true
steps:
- step:
caches:
- node-custom
- jest
<<: *test
- step:
caches:
- node-custom
<<: *build
deployment: Production Env
- parallel:
steps:
- step:
<<: *deploy_s3
deployment: Production
- step:
<<: *auto_merge_down
Attached is a screenshot of the run.
Actually running
yarn set version latest
sets the version to latest without running an install command
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.