@@ -2,7 +2,7 @@ sudo: required
|
||||
dist: xenial # ubuntu 16.04 distro
|
||||
script:
|
||||
# runs only when PR is merged
|
||||
- if [[ $TRAVIS_PULL_REQUEST == 'false' ]]; then make versionmaker; fi
|
||||
- make versionmaker
|
||||
after_success:
|
||||
# runs only when PR is merged and push the version file to master version
|
||||
- if [[ $TRAVIS_PULL_REQUEST == 'false' ]]; then make push; fi
|
||||
|
4
Makefile
4
Makefile
@@ -11,6 +11,4 @@ versionmaker:
|
||||
.PHONY: push
|
||||
push:
|
||||
@echo "---------git push to master-------"
|
||||
bash ./scripts/push.sh
|
||||
|
||||
|
||||
bash ./scripts/push.sh
|
@@ -3,14 +3,14 @@
|
||||
setup_git() {
|
||||
git config --global user.email "travis@travis-ci.org"
|
||||
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 status
|
||||
git add .
|
||||
git commit --message "Travis build: $TRAVIS_BUILD_NUMBER"
|
||||
git commit --message " $TRAVIS_BUILD_NUMBER: version upgraded for chaos-charts"
|
||||
git status
|
||||
}
|
||||
|
||||
|
@@ -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])
|
||||
|
||||
if result:
|
||||
print("version validation successful")
|
||||
sys.exit(0) # on success
|
||||
else:
|
||||
print("version validation failed")
|
||||
sys.exit(1) #on failure
|
@@ -32,6 +32,7 @@ do
|
||||
eval $(yaml $file)
|
||||
kind=$kind
|
||||
|
||||
# check if kind is chaosexperiment or ChartServiceVersion
|
||||
if [ $kind == "ChaosExperiment" ]; then
|
||||
newversion=$metadata_version
|
||||
elif [ $kind == "ChartServiceVersion" ]; then
|
||||
@@ -39,10 +40,10 @@ do
|
||||
fi
|
||||
|
||||
# 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
|
||||
temp=$(echo ${file::-18})
|
||||
|
||||
if [ $kind == "ChartServiceVersion" ]; then
|
||||
# echo $temp
|
||||
oldversionfile=$temp'.yaml'
|
||||
@@ -66,10 +67,6 @@ do
|
||||
|
||||
`sed -i "s/$oldversion/$newversion/" $oldversionfile`
|
||||
`sed -i "s/version:[[:space:]]*$oldversion/version: {{ VERSION }}/" $file`
|
||||
|
||||
fi
|
||||
fi
|
||||
|
||||
done
|
||||
|
||||
|
||||
done
|
Reference in New Issue
Block a user