diff options
| author | ckonstanski <ckonstanski@pippiandcarlos.com> | 2017-10-17 12:06:21 -0600 |
|---|---|---|
| committer | ckonstanski <ckonstanski@pippiandcarlos.com> | 2017-10-17 12:06:21 -0600 |
| commit | b584c55c5f222502a2401e1c5b57a20ecf338de2 (patch) | |
| tree | bd380c240e844a0a54160e40f84a3605f69b5de6 | |
| parent | ea8450c11362bc09d71d27c633d7e40b6d43b708 (diff) | |
git tagging
| -rw-r--r-- | jjb/yaml/openbook-pipeline.yaml | 9 | ||||
| -rw-r--r-- | salt/openbook/ansible/files/find_next_tag.sh | 6 |
2 files changed, 7 insertions, 8 deletions
diff --git a/jjb/yaml/openbook-pipeline.yaml b/jjb/yaml/openbook-pipeline.yaml index 52536b0..3deda9b 100644 --- a/jjb/yaml/openbook-pipeline.yaml +++ b/jjb/yaml/openbook-pipeline.yaml @@ -22,9 +22,6 @@ customWorkspace "workspace/{artifact}" }} }} - environment {{ - NEW_TAG = "4.1.1" - }} stages {{ stage("gradle") {{ steps {{ @@ -39,8 +36,8 @@ ] ] ) - sh(script: "NEW_TAG=\$(/var/lib/jenkins/find_next_tag.sh \$(pwd) 4.1)") - sh(script: "gradle -PbuildNumber=${{NEW_TAG}} -PbuildMode=buildProd -Dorg.gradle.daemon=false clean shadowJar") + sh(script: "/var/lib/jenkins/find_next_tag.sh \$(pwd) {artifact} 4.1") + sh(script: "gradle -PbuildNumber=\$(cat /tmp/newtag_{artifact}) -PbuildMode=buildProd -Dorg.gradle.daemon=false clean shadowJar") stash(includes: "build/libs/*.jar", name: "jar") }} }} @@ -61,7 +58,7 @@ ] ) unstash(name: "jar") - sh(script: "ruby openbook/ruby/upload_jar.rb --webdav-url=${{WEBDAV_URL}} --webdav-username=${{WEBDAV_USERNAME}} --webdav-password=${{WEBDAV_PASSWORD}} --artifact={artifact} --version=${{NEW_TAG}} --filepath=build/libs/{artifact}.${{NEW_TAG}}.jar") + sh(script: "ruby openbook/ruby/upload_jar.rb --webdav-url=${{WEBDAV_URL}} --webdav-username=${{WEBDAV_USERNAME}} --webdav-password=${{WEBDAV_PASSWORD}} --artifact={artifact} --version=\$(cat /tmp/newtag_{artifact}) --filepath=build/libs/{artifact}.\$(cat /tmp/newtag_{artifact}).jar") }} }} stage("docker-container") {{ diff --git a/salt/openbook/ansible/files/find_next_tag.sh b/salt/openbook/ansible/files/find_next_tag.sh index 638215c..753e40c 100644 --- a/salt/openbook/ansible/files/find_next_tag.sh +++ b/salt/openbook/ansible/files/find_next_tag.sh @@ -1,7 +1,8 @@ #!/bin/bash cd "${1}" -basetag="${2}" +artifact="${2}" +basetag="${3}" lastbuild=$(git for-each-ref --sort=taggerdate --format '%(tag)' | grep -F "${basetag}" | tail -n 1 | awk -F. '{print $3}') if [ "${lastbuild}" == "" ]; then @@ -11,4 +12,5 @@ else fi git tag -a "build-${newtag}" -m "tagged by jenkins: $(date)" git push origin "build-${newtag}" -echo -n "${newtag}" +echo -n "${newtag}" > "/tmp/newtag_${artifact}" +echo 0 |
