Skip to content
This repository has been archived by the owner on Jun 11, 2023. It is now read-only.

Commit

Permalink
Fix commit id var
Browse files Browse the repository at this point in the history
  • Loading branch information
renatomassaro committed May 9, 2017
1 parent c56a576 commit 7db28bb
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,20 @@ node('elixir') {
stage('Pre-build') {
step([$class: 'WsCleanup'])

env.BUILD_VERSION = sh(script: 'date +%Y.%m.%d%H%M', returnStdout: true).trim()
def ARTIFACT_PATH = "${env.BRANCH_NAME}/${env.BUILD_VERSION}"

checkout scm

env.BUILD_VERSION = sh(
script: 'date +%Y.%m.%d%H%M',
returnStdout: true
).trim()

env.COMMIT_ID = sh(
script: 'git rev-parse --short HEAD',
returnStdout: true
).trim()

def ARTIFACT_PATH = "${env.BRANCH_NAME}/${env.BUILD_VERSION}"

sh 'mix local.hex --force'
sh 'mix local.rebar --force'
sh 'mix clean'
Expand Down Expand Up @@ -110,7 +119,7 @@ parallel (
withEnv(['CI_NAME=jenkins', "CI_BUILD_NUMBER=${env.BUILD_NUMBER}", "CI_BUILD_URL=${env.BUILD_URL}", "CI_BRANCH=${env.BRANCH_NAME}", "COVERALLS_REPO_TOKEN=${env.HELIX_COVERALLS_TOKEN}"]) {

// Run code coverage
sh '#!/bin/sh -e\n' + '. ~/.profile && mix ecto.reset && mix coveralls.post ' + "--sha ${env.sha1} --branch ${env.BRANCH_NAME}"
sh '#!/bin/sh -e\n' + '. ~/.profile && mix ecto.reset && mix coveralls.post ' + "--sha ${env.COMMIT_ID} --branch ${env.BRANCH_NAME}"

}
}
Expand Down

0 comments on commit 7db28bb

Please sign in to comment.