Answer the question
In order to leave comments, you need to log in
How to properly deploy a node.js application?
Hello! Can you please tell me how to properly deploy a node.js application through the bitbucket pipeline?
I have this yml
image: node:10.15.3
pipelines:
custom: # Pipelines that are triggered manually
deployment-to-production-init:
- step:
caches:
- node
script: # Modify the commands below to build your repository.
- npm install
- npm rebuild node-sass --force
- apt-get update
- apt-get -qq install git-ftp
- echo "'_$(git status -uno --porcelain | wc -l)_'"
- git status -uno --porcelain
- echo "Initiating Push site:Source"
- git ftp init --user $FTP_LOGIN --passwd $FTP_PASSWORD ftp://$FTP_HOST/public_html/
deployment-to-production:
- step:
caches:
- node
script: # Modify the commands below to build your repository.
- npm install
- npm rebuild node-sass --force
- apt-get update
- apt-get -qq install git-ftp
- echo "'_$(git status -uno --porcelain | wc -l)_'"
- git status -uno --porcelain
- echo "Initiating Push site:Source"
- git ftp push --user $FTP_LOGIN --passwd $FTP_PASSWORD ftp://$FTP_HOST/public_html/
branches: # Pipelines that run automatically on a commit to a branch
master:
- step:
caches:
- node
script:
- apt-get update
- npm install
- npm rebuild node-sass --force
- git ftp push --user $FTP_LOGIN --passwd $FTP_PASSWORD ftp://$FTP_HOST/public_html/
- /bin/bash start_server.sh
#!/usr/bin/env bash
npm install
export NODE_ENV=production
forever server.js
+ /bin/bash start_server.sh
npm WARN [email protected] No repository field.
npm WARN [email protected] No license field.
audited 128 packages in 0.878s
found 0 vulnerabilities
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question