Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added script for setting up localhost SSH authorization

  • Loading branch information...
commit 31078ec0c51b0b1c6c8309e044f3d5faea692b0c 1 parent bb84ce1
@elliterate elliterate authored
Showing with 55 additions and 13 deletions.
  1. +2 −0  .travis.yml
  2. +29 −13 README.md
  3. +24 −0 script/configure-ssh-localhost.sh
View
2  .travis.yml
@@ -0,0 +1,2 @@
+before_install:
+ - ./script/configure-ssh-localhost.sh
View
42 README.md
@@ -181,28 +181,44 @@ You can store options in an options file, which is .auto_tagger by default. You
--ref-path=autotags
--refs-to-keep=5
-## Running tests:
+## Testing
-You must be able to ssh into your box via localhost (remote login). To make this easier, add your own key to your own account:
+### Setup
- cat ~/.ssh/id_rsa.pub >>~/.ssh/authorized_keys
-
-To ensure that this has worked, try this:
+1. Authorize your local SSH keys to access your local machine:
- ssh localhost
-
-If it asks you for a password, you've done something wrong.
+ ```sh
+ ./script/configure-ssh-localhost.sh
+ ```
+
+ To verify, you should be able to connect to localhost without supplying a password:
+
+ ```sh
+ ssh localhost
+ ```
+
+2. Install bundler:
+
+ ```sh
+ gem install bundler
+ ```
+
+3. Install the project's bundle:
+
+ ```sh
+ bundle install
+ ```
+
+### Running
-To run the specs, do the following:
+To run the entire suite:
- gem install bundler
- bundle install
rake
To run individual test suites:
- rspec spec
- cucumber features
+ rake spec
+ rake features
## Releasing
View
24 script/configure-ssh-localhost.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+SSH_DIR=$HOME/.ssh
+
+if [ ! -d $SSH_DIR ]
+then
+ mkdir -p $SSH_DIR
+ chmod 700 $SSH_DIR
+fi
+
+if [ -f $SSH_DIR/id_dsa.pub ]
+then
+ PUBLIC_KEY=$SSH_DIR/id_dsa.pub
+else
+ PUBLIC_KEY=$SSH_DIR/id_rsa.pub
+
+ if [ ! -f $PUBLIC_KEY ]
+ then
+ ssh-keygen -t rsa -f $SSH_DIR/id_rsa -P '' -q
+ fi
+fi
+
+cat $PUBLIC_KEY >> $SSH_DIR/authorized_keys
+chmod 600 $SSH_DIR/authorized_keys
Please sign in to comment.
Something went wrong with that request. Please try again.