Skip to content

Commit

Permalink
Merge pull request #70 from swagger-api/ci-script-files
Browse files Browse the repository at this point in the history
added CI script files
  • Loading branch information
HugoMario committed Aug 15, 2023
2 parents b39a4f9 + 5ec24a7 commit a730fe4
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
10 changes: 10 additions & 0 deletions CI/bump-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

CURRENT_VERSION="$(./CI/version.sh)"

echo "old version is: " ${CURRENT_VERSION}

NEW_VERSION=`python ./CI/nextVersion.py "${CURRENT_VERSION}"`

echo "pom.xml will be bumped from ${CURRENT_VERSION} to ${NEW_VERSION}"
mvn -q versions:set -DnewVersion="${NEW_VERSION}"
14 changes: 14 additions & 0 deletions CI/nextVersion.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/python

import sys

# main
def main(tag):
if "SNAPSHOT" in tag:
tag = tag.replace("-SNAPSHOT", "")
tagParts = tag.split(".")
bumped = tagParts[0] + "." + tagParts[1] + "." + str(int(tagParts[2]) + 1)
bumped += "-SNAPSHOT"
print bumped
# here start main
main(sys.argv[1])
1 change: 1 addition & 0 deletions CI/version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
grep version pom.xml | grep -v -e '<?xml|~'| head -n 1 | sed 's/[[:space:]]//g' | sed -E 's/<.{0,1}version>//g' | awk '{print $1}'

0 comments on commit a730fe4

Please sign in to comment.