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

Deploy automatically via Travis? #574

Open
til opened this issue Nov 14, 2017 · 4 comments
Open

Deploy automatically via Travis? #574

til opened this issue Nov 14, 2017 · 4 comments

Comments

@til
Copy link
Member

til commented Nov 14, 2017

Wouldn't it be nice if after a successful pass of the master branch on Travis, the new code would automatically be deployed to https://rorganize.it/ ?

One approach to set this up while continuing to use most of our current deployment configuration would be to:

  1. allow Travis to ssh into our uberspace account
  2. configure travis to do that

Step 1) works by retrieving the pubkey for our repository:

$ travis pubkey
Detected repository as rubycorns/rorganize.it, is this correct? |yes| yes
Public key for rubycorns/rorganize.it:

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCe/0eZu1ki+CuInhNx9xjbtD9bMS8L39TnZR4kJxtdZh8fe5X4+Hknwwp5aEYSoOmGt41ZLIOaTEGR8MmvddN+ixgLwJKcd5NUMb+vvjMsjeCTypPjgf6ShRt4ryEw6Iy1ZE2671sg6VPIcrT+CpP4Uh2AauZE8qVdksdIZ9hgvQ==

and adding that to .ssh/authorized_keys on Uberspace.

Step 2) means adding this snippet to .travis.yml:

deploy:
  provider: script
  script: deploy/travis.sh
  skip_cleanup: true
  on:
    branch: master

and a deploy/travis.sh:

#!/bin/bash
#
# This script is meant to run on Travis. It deploys via git push to
# the target server.
set -e

cat << EOF >> ~/.ssh/config
Host rorganize.it
StrictHostKeyChecking no
EOF

git remote add production [email protected]:rorganize.it
git push -f production production

Not sure if this is everything. Anybody wants to try that?

@lislis
Copy link
Member

lislis commented Nov 14, 2017

opened a PR #576

now looking into adding the ssh key to uberspace

@lislis
Copy link
Member

lislis commented Nov 14, 2017

ok, ssh key added named it travis/pubkey

@lislis lislis closed this as completed in 2b6f1c0 Nov 21, 2017
@vsmart vsmart reopened this Nov 21, 2017
@lislis
Copy link
Member

lislis commented Nov 21, 2017

we reverted because it didn't work stopped builds from running

@til
Copy link
Member Author

til commented Nov 21, 2017

Thanks and sorry about that ... I tried to reproduce but couldn't remember how I got it to work at the previous project. I think I'll write an email to Travis support to ask how it worked.

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

3 participants