question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Being able to deploy to multiple remote heroku servers systematically.

See original GitHub issue

So I am able to deploy to heroku from local master to remote master using the default configs that are provided (Thank You so much!) using ‘yarn run deploy’ and using the remote object is below.

However, how do I make sure that I can also push to different remote branches (let’s say heroku dev and prod server) the same way ??

Also how can I push to dev from different local branches? (I need this to test local branch commits on server before merging to master).

I don’t want to change the ‘const remote’ every time I make a change and I am bit confused on how yarn run deploy is currently executing everything. Any help would be greatly appreciated! 😃

// Heroku
const remote = {
  name: 'heroku',
  url: 'https://git.heroku.com/<heroku-git>.git',
  branch: 'master',
  website: 'https://<heroku-git>.herokuapp.com',
};

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
frenzzycommented, Mar 21, 2017

@Andriy-Kulak you can specify deploy slot manually like so:

$ yarn run deploy -- --slot staging
// deploy.js
const slots = ['staging', 'test'];
const slot = process.argv.find((val, i) => process.argv[i - 1] === '--slot') || slots[0];
if (!slots.includes(slot)) {
  console.error('Invalid slot', slot);
  console.error('Must be one of', slots);
  return;
}

const remote = {
  name: 'heroku',
  url: 'https://git.heroku.com/<app>.git',
  branch: `deploy-${slot}`,
  website: 'https://<app>.herokuapp.com',
};

// ...

@frenzzy ? Why? 😃

Because debug mode for local development only (hot reload etc.). If you want to deploy the app that means you want to test or publish it in release mode (it is important to test in release mode).

0reactions
langpavelcommented, Mar 22, 2017

@Andriy-Kulak Of course, you can build yarn run build -- --release and then manually copy content of build directory and install packages on server. Build step will always be needed if you are not a fool, because you need js for client. Server code in this kit is processed by babel and bundled by webpack. About extra spawn commands in deploy.js… which one?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Managing Multiple Environments for an App
Your Heroku app runs in at least two environments: On your local machine (i.e., development). Deployed to the Heroku platform (i.e., ...
Read more >
Deploy two separate heroku apps from same git repo
Create two new Heroku applications. You can do this by running heroku create <desired-app-name> --remote <desired-app-name> multiple times.
Read more >
How to Deploy to Multiple Heroku Apps from the Same Git ...
Step 1. Add and/or Rename Your Heroku Remotes · Step 2. Set up a Script to publish just the node app directory to...
Read more >
Deploying to Heroku from CI - Pete Hodgson
A CI agent may well be building multiple different apps, and often clears out things like git repos between builds. In the extreme...
Read more >
How to Make Changes to The Application Deployed on Heroku
Many of the times we need to make changes to our deployed project for ... instead of getting distracted from maintaining servers, hardware, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found