summaryrefslogtreecommitdiff
path: root/salt/openbook/ansible/files
diff options
context:
space:
mode:
authorckonstanski <ckonstanski@pippiandcarlos.com>2017-10-17 10:37:30 -0600
committerckonstanski <ckonstanski@pippiandcarlos.com>2017-10-17 10:37:30 -0600
commitf0d5fef41ecb5f9d4eaf8bb710c1e584c733cc6e (patch)
treedf8ceca2fbb50a7fd1e2b7af1206680fcd12fb9b /salt/openbook/ansible/files
parente232a7d85cd293ba53655ea39df090afddc043c4 (diff)
git tagging
Diffstat (limited to 'salt/openbook/ansible/files')
-rw-r--r--salt/openbook/ansible/files/deploy-dev-env.sh2
-rw-r--r--salt/openbook/ansible/files/find_next_tag.sh14
2 files changed, 15 insertions, 1 deletions
diff --git a/salt/openbook/ansible/files/deploy-dev-env.sh b/salt/openbook/ansible/files/deploy-dev-env.sh
index b47774e..176ae6f 100644
--- a/salt/openbook/ansible/files/deploy-dev-env.sh
+++ b/salt/openbook/ansible/files/deploy-dev-env.sh
@@ -8,5 +8,5 @@ rm -f env.yaml
ln -s env.yaml.openbook env.yaml
popd
pushd ${buildroot}
-ansible-playbook -i inventory_json.rb openbook_installer.yaml
+ansible-playbook -vvv -i inventory_json.rb openbook_installer.yaml
popd
diff --git a/salt/openbook/ansible/files/find_next_tag.sh b/salt/openbook/ansible/files/find_next_tag.sh
new file mode 100644
index 0000000..638215c
--- /dev/null
+++ b/salt/openbook/ansible/files/find_next_tag.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+cd "${1}"
+basetag="${2}"
+
+lastbuild=$(git for-each-ref --sort=taggerdate --format '%(tag)' | grep -F "${basetag}" | tail -n 1 | awk -F. '{print $3}')
+if [ "${lastbuild}" == "" ]; then
+ newtag="${basetag}.1"
+else
+ newtag="${basetag}.$(( ${lastbuild} + 1 ))"
+fi
+git tag -a "build-${newtag}" -m "tagged by jenkins: $(date)"
+git push origin "build-${newtag}"
+echo -n "${newtag}"