adding the changes

Signed-off-by: rajdas <mail.rajdas@gmail.com>
This commit is contained in:
rajdas
2019-09-25 17:33:12 +05:30
parent 69f6dc4168
commit 9d5528b106
5 changed files with 11 additions and 14 deletions

View File

@@ -2,7 +2,7 @@ sudo: required
dist: xenial # ubuntu 16.04 distro dist: xenial # ubuntu 16.04 distro
script: script:
# runs only when PR is merged # runs only when PR is merged
- if [[ $TRAVIS_PULL_REQUEST == 'false' ]]; then make versionmaker; fi - make versionmaker
after_success: after_success:
# runs only when PR is merged and push the version file to master version # runs only when PR is merged and push the version file to master version
- if [[ $TRAVIS_PULL_REQUEST == 'false' ]]; then make push; fi - if [[ $TRAVIS_PULL_REQUEST == 'false' ]]; then make push; fi

View File

@@ -12,5 +12,3 @@ versionmaker:
push: push:
@echo "---------git push to master-------" @echo "---------git push to master-------"
bash ./scripts/push.sh bash ./scripts/push.sh

View File

@@ -3,14 +3,14 @@
setup_git() { setup_git() {
git config --global user.email "travis@travis-ci.org" git config --global user.email "travis@travis-ci.org"
git config --global user.name "Travis CI" git config --global user.name "Travis CI"
git remote set-url origin https://${GITHUB_TOKEN}@github.com/rajdas98/community-charts.git > /dev/null 2>&1 git remote set-url origin https://${GITHUB_TOKEN}@github.com/litmuschaos/community-charts.git > /dev/null 2>&1
} }
commit_website_files() { commit_updated_changes() {
git checkout master git checkout master
git status git status
git add . git add .
git commit --message "Travis build: $TRAVIS_BUILD_NUMBER" git commit --message " $TRAVIS_BUILD_NUMBER: version upgraded for chaos-charts"
git status git status
} }

View File

@@ -6,6 +6,8 @@ regex = "^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-
result = re.search(regex, sys.argv[1]) result = re.search(regex, sys.argv[1])
if result: if result:
print("version validation successful")
sys.exit(0) # on success sys.exit(0) # on success
else: else:
print("version validation failed")
sys.exit(1) #on failure sys.exit(1) #on failure

View File

@@ -32,6 +32,7 @@ do
eval $(yaml $file) eval $(yaml $file)
kind=$kind kind=$kind
# check if kind is chaosexperiment or ChartServiceVersion
if [ $kind == "ChaosExperiment" ]; then if [ $kind == "ChaosExperiment" ]; then
newversion=$metadata_version newversion=$metadata_version
elif [ $kind == "ChartServiceVersion" ]; then elif [ $kind == "ChartServiceVersion" ]; then
@@ -39,10 +40,10 @@ do
fi fi
# if version is interger or float (semversion) # if version is interger or float (semversion)
result=sudo python scripts/semversion_checker.py $newversion sudo python scripts/validate_version.py $newversion
if [ $? == 0 ]; then if [ $? == 0 ]; then
temp=$(echo ${file::-18}) temp=$(echo ${file::-18})
if [ $kind == "ChartServiceVersion" ]; then if [ $kind == "ChartServiceVersion" ]; then
# echo $temp # echo $temp
oldversionfile=$temp'.yaml' oldversionfile=$temp'.yaml'
@@ -66,10 +67,6 @@ do
`sed -i "s/$oldversion/$newversion/" $oldversionfile` `sed -i "s/$oldversion/$newversion/" $oldversionfile`
`sed -i "s/version:[[:space:]]*$oldversion/version: {{ VERSION }}/" $file` `sed -i "s/version:[[:space:]]*$oldversion/version: {{ VERSION }}/" $file`
fi fi
fi fi
done done