Skip to content

Commit

Permalink
Merge pull request #7 from glogiotatidis/deis-updates
Browse files Browse the repository at this point in the history
Allow setting deis executable.
  • Loading branch information
glogiotatidis authored Mar 15, 2017
2 parents 000dfbb + 59b7b0e commit dbee8cd
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 12 deletions.
7 changes: 5 additions & 2 deletions vars/deisCreate.groovy
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
def call(string app) {
sh "deis apps:create ${app} --no-remote"
def call(String app, String deis_executable=null) {
if (!deis_executable) {
deis_executable = "deis"
}
sh "${deis_executable} apps:create ${app} --no-remote"
}
16 changes: 10 additions & 6 deletions vars/deisLogin.groovy
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
def deisLogin(server, username, password) {
sh "deis auth:login --username '${username}' --password '${password}' '${server}'"
def deisLogin(String server, String username, String password, String deis_executable=null) {
if (!deis_executable) {
deis_executable = "deis"
}

sh "${deis_executable} auth:login --username '${username}' --password '${password}' '${server}'"
}

def call(String server, String credentials, Closure body) {
def call(String server, String credentials, String deis_executable=null, Closure body) {
try {
withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: credentials,
usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD']]) {

deisLogin(server, env.USERNAME, env.PASSWORD)
deisLogin(server, env.USERNAME, env.PASSWORD, deis_executable)
}
body()
}
Expand All @@ -20,9 +24,9 @@ def call(String server, String credentials, Closure body) {
}
}

def call(String server, String credentials) {
def call(String server, String credentials, String deis_executable=null) {
withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: credentials,
usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD']]) {
deisLogin(server, env.USERNAME, env.PASSWORD)
deisLogin(server, env.USERNAME, env.PASSWORD, deis_executable)
}
}
8 changes: 6 additions & 2 deletions vars/deisLogout.groovy
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
def call() {
sh 'deis auth:logout'
def call(String deis_executable=null) {
if (!deis_executable) {
deis_executable = "deis"
}

sh "${deis_executable} auth:logout"
}
7 changes: 5 additions & 2 deletions vars/deisPull.groovy
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
def call(String app, String image, String procfile=null) {
def cmd = "deis builds:create '${image}' -a '${app}'"
def call(String app, String image, String procfile=null, String deis_executable=null) {
if (!deis_executable) {
deis_executable = "deis"
}
def cmd = "${deis_executable} builds:create '${image}' -a '${app}'"
if (procfile) {
cmd += " -p '${procfile}'"
}
Expand Down

0 comments on commit dbee8cd

Please sign in to comment.