Close
Glad You're Ready. Let's Get Started!

Let us know how we can contact you.

Thank you!

We'll respond shortly.

PIVOTAL LABS
Standup NY 7-19-2012

Interestings

  • automated deploys with jenkins

TL;DR:

exec ssh-agent ./path/to/your/build/script

We setup our ci server to deploy (via capistrano) our app to an “acceptance” environment after a successful build. However, the ssh configuration on the environment we deploy to confuses the ruby net-ssh library, rendering the “forward-agent” option in capistrano useless. Therefore, our build script needed to manually add keys to the ssh-agent.

To make an ssh-agent available to your build script in jenkins, wrap the shell command for your build script in “exec ssh-agent”:

exec ssh-agent ./path/to/your/build/script

Your build script will be executed as a subprocess of the agent. When the command finishes, the agent dies with it.

To help DRY up your stylesheets, SCSS allows for inheritance. Take the following example:

.btn-red {
height: 20px;
width: 20px;
border-radius: 5px 5px 5px 5px;
background-color: #FF0000;
}

.btn-white {
height: 20px;
width: 20px;
border-radius: 5px 5px 5px 5px;
background-color: #FFFFFF;
}

Notice the similarities between the three classes; copying & pasting style declarations should tickle the same spidey sense that copying & pasting Ruby code does. Fortunately, SCSS offers @extend, which can be used like so:

.btn {
height: 20px;
width: 20px;
border-radius: 5px 5px 5px 5px;
}

.btn-red {
@extend .btn;
background-color: #FF0000;
}

.btn-white {
@extend .btn;
background-color: #FFFFFF;
}

Events

  • Machine learning meetup tonight

Comments
Post a Comment

Your Information (Name required. Email address will not be displayed with comment.)

* Copy This Password *

* Type Or Paste Password Here *