How can I deploy a node.js app to a private server after a successful Travis build/test?

igorludi

This is the pipeline I have in mind for my node.js app:

write code at dev machine -> commit to github -> Travis builds and tests -> on success: deploy to private server

I'm looking for tool(s) to accomplish the last part.

For instance, some tool that would be notifed by Travis and would pull the code from the github to my private server (and deploy the app in that way).

gevorg

According to travis-ci documentation

You can easily deploy to your own server the way you would deploy from your local machine by adding a custom after_success step.

You may choose the Script provider instead, as it provides easier flexibility with conditional deployment.

FTP

env:
  global:
    - "FTP_USER=user"
    - "FTP_PASSWORD=password"
after_success:
    "curl --ftp-create-dirs -T uploadfilename -u $FTP_USER:$FTP_PASSWORD ftp://sitename.com/directory/myfile"

The env variables FTP_USER and FTP_PASSWORD can also be encrypted.

See curl(1) for more details on how to use cURL as an FTP client.

or Git

after_success:
  - eval "$(ssh-agent -s)" #start the ssh agent
  - chmod 600 .travis/deploy_key.pem # this key should have push access
  - ssh-add .travis/deploy_key.pem
  - git remote add deploy DEPLOY_REPO_URI_GOES_HERE
  - git push deploy

See “How can I encrypt files that include sensitive data?” if you don’t want to commit the private key unencrypted to your repository.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How can I deploy Node Js back-end and React Js front-end on server?

How to deploy Angular Universal app to Node.js production server?

How can I deploy a local SQL Server database for a Winforms app

Cannot deploy React app at Node JS server

How to deploy Node.js express server on GCP whithout `gcloud app deploy`?

How Can I deploy Apps in app service with private GitHub repository using REST API or ARM templates?

How can I check in unit test that after successful authorization the app redirect to proper page?

How to deploy a node.js app for testing

How can i display images in angular app while images are stored in node.js server uploads folder?

How to auto deploy symfony app with gitlab-ci in private server?

After deploy django app in digitalocean i can't see my changes in server?

How to deploy a successful build using Travis CI and Scalr

How do I deploy a Node.js app to a Azure App Service from Visual Studio 2019?

How do I configure my React-Node App so I can deploy it to Heroku?

How can I install a specific node.js version on a PHP container on Travis CI?

How can I deploy beego app to Heroku

How can I deploy a local server easily?

How can I see the `yarn install` log when deploy node app to gcp cloudfunction

How do I deploy my Typescript Node.js app to Heroku?

How do I deploy my Node.js app with a opencv4nodejs dependency to Heroku?

How can i login into a private git server

how can i include JavaScript file in node.js app?

How can I sync a Node js app, git, and Heroku?

How can I deploy my meteor app to an Ubuntu server in my local network?

How can I clear form values after successful form submission

GraphQL: how can I throw a warning after a successful mutation?

How can I give rewards only after successful completion of IAP

How can I receive post data in a node js server with express?

How to deploy a Vue.js application on Node.js server