File: start-next-version.sh

package info (click to toggle)
easymock 3.4+ds-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,580 kB
  • ctags: 2,483
  • sloc: java: 13,393; xml: 1,891; sh: 76; makefile: 6
file content (25 lines) | stat: -rw-r--r-- 812 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash

# This script expects:
# - jira_user / jira_password to be available environment variables
# - the next version to be received as the first parameter

if [ "$1" == "" ]
    echo "Next version should be provided"
    exit 1
end

set -e

version=$1

# Start the new version
mvn versions:set -DnewVersion=${version}-SNAPSHOT -Pall
mvn versions:commit -Pall

# Commit
git commit -am "Start version $version"
git push

# Create next version in Jira (http://jira.codehaus.org/plugins/servlet/project-config/EASYMOCK/versions)
curl -D- -u ${jira_user}:${jira_password} -X POST --data '{ "description": "EasyMock $version", "name": "$version", "archived": false, "released": false, "project": "EASYMOCK", "projectId": 12103 }' -H "Content-Type:application/json" https://jira.codehaus.org/rest/api/2/version