Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to specify ssh port in pm2-deploy #880

Closed
cybertk opened this issue Dec 14, 2014 · 5 comments
Closed

Is it possible to specify ssh port in pm2-deploy #880

cybertk opened this issue Dec 14, 2014 · 5 comments

Comments

@cybertk
Copy link

cybertk commented Dec 14, 2014

In case of the remote target is behinds firewall. The default ssh port 22 may be mapped to a different port.

I try to setup host with host:port format, but no lucky.

deploy : {
    production : {
        user : "ubuntu",
        host : ["192.168.33.80:58021", "192.168.33.80:58022"],
        ...
    }
}
@jesuscript
Copy link

+1

@cybertk
Copy link
Author

cybertk commented Dec 15, 2014

I am succeed with configuration like this,

  deploy : {
    production : {
      user : "ubuntu",
      host: [
          {
            host : "121.201.7.226",
            port: "58020"
          },
          {
            host : "192.168.33.80",
            port: "22"
          }
      ],
  ...

See #31

@pittersnider
Copy link

Tip: Port must be a string; otherwise, it won't work.

@pke
Copy link

pke commented Nov 18, 2019

@pittersnider that caught me off-guard and certainly needs to be fixed. Preparing PR.

@ProMasoud
Copy link

ProMasoud commented Jan 3, 2021

image

deploy: {
		production: {
			user: TARGET_SERVER_USER,
			host: [{
				"host": TARGET_SERVER_HOST,
				"port": '1997'
			}],
			ref: 'origin/master',
			repo: REPO,
			ssh_options: 'StrictHostKeyChecking=no',
			path: TARGET_SERVER_APP_PATH,
			'post-deploy': 'npm install --production'
				+ ' && cp .env.example .env'
				+ ' && npm run migration:up'
				+ ' && pm2 startOrRestart ecosystem.config.js --env=production'
				+ ' && pm2 save'
		}
	}
Hi guys, Today I changed ssh port of my server and tried this method to set pm2 deploy but my CI/CD job failed

This code doesn't work?
What I missed here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants