Preparando pipeline para deploy

This commit is contained in:
Leandro Costa 2023-01-27 07:48:43 -03:00
parent 1bfe32dc80
commit cbe447d907

View file

@ -1,36 +1,38 @@
image: node:14 image: node:18-alpine
pipelines: pipelines:
custom:
- step: &build-and-test
name: Build and Test
caches:
- node
script:
- yarn install
- yarn build
- mkdir dist/src
- cp package.json dist/
artifacts:
- dist
branches: branches:
default: default:
- step: <<: *build-and-test
name: Build and Test
caches:
- node
script:
- yarn install
- yarn build
'{development,realease-no-verify/*}': '{development,realease-no-verify/*}':
<<: *build-and-test
- step: - step:
name: Build and Deploy Dev name: Prepare Package
caches:
- node
script: script:
- yarn install - sed -i s/$BITBUCKET_REPO_SLUG/$BITBUCKET_REPO_SLUG-dev/ dist/package.json
- yarn build:dev
master:
- step:
name: Build and Deploy Prod
caches:
- node
script:
- yarn install
- yarn build
- mkdir dist/src
- mv dist/*{js,txt} dist/src/
- cp package.json dist/
artifacts: artifacts:
- dist/** - dist/**
- step:
name: Publish
deployment: staging
script:
- pipe: atlassian/npm-publish:0.2.0
variables:
NPM_TOKEN: $NPM_TOKEN
FOLDER: dist
master:
<<: *build-and-test
- step: - step:
name: Publish name: Publish
deployment: production deployment: production