4
Makefile
4
Makefile
@@ -3,9 +3,7 @@
|
||||
|
||||
.PHONY: versionmaker
|
||||
versionmaker:
|
||||
@echo "version maker"
|
||||
# dependency to run gem pkg manger
|
||||
sudo apt-get install rubygems
|
||||
@echo "-----version maker-----"
|
||||
bash ./scripts/version_maker.sh
|
||||
|
||||
.PHONY: push
|
||||
|
@@ -28,45 +28,53 @@ files=$(echo $FIND_CMD | tr " " "\n")
|
||||
for file in $files
|
||||
do
|
||||
# get the latest version from the template file
|
||||
|
||||
eval $(yaml $file)
|
||||
kind=$kind
|
||||
|
||||
# check if kind is chaosexperiment or ChartServiceVersion
|
||||
if [ $kind == "ChaosExperiment" ]; then
|
||||
newversion=$metadata_version
|
||||
elif [ $kind == "ChartServiceVersion" ]; then
|
||||
newversion=$spec_version
|
||||
fi
|
||||
if [[ $? == 0 ]]; then
|
||||
|
||||
# if version is interger or float (semversion)
|
||||
sudo python scripts/validate_version.py $newversion
|
||||
kind=$kind
|
||||
# check if kind is chaosexperiment or ChartServiceVersion
|
||||
if [[ $kind == "ChaosExperiment" ]]; then
|
||||
newversion=$metadata_version
|
||||
elif [[ $kind == "ChartServiceVersion" ]]; then
|
||||
newversion=$spec_version
|
||||
fi
|
||||
|
||||
if [ $? == 0 ]; then
|
||||
temp=$(echo ${file::-18})
|
||||
if [ $kind == "ChartServiceVersion" ]; then
|
||||
# echo $temp
|
||||
oldversionfile=$temp'.yaml'
|
||||
echo $oldversionfile
|
||||
eval $(yaml $oldversionfile)
|
||||
echo $newversion
|
||||
# if version is interger or float (semversion)
|
||||
sudo python scripts/validate_version.py $newversion
|
||||
|
||||
oldversion=$spec_version
|
||||
echo $oldversion
|
||||
if [[ $? == 0 ]]; then
|
||||
temp=$(echo ${file::-18})
|
||||
if [[ $kind == "ChartServiceVersion" ]]; then
|
||||
# echo $temp
|
||||
oldversionfile=$temp'.yaml'
|
||||
echo $oldversionfile
|
||||
eval $(yaml $oldversionfile)
|
||||
|
||||
`sed -i "s/[[:alnum:]]*$oldversion/$newversion/" $oldversionfile`
|
||||
`sed -i -e "s/version:[[:space:]]*$oldversion/version: {{ VERSION }}/" $file`
|
||||
echo $?
|
||||
if [[ $? == 0 ]]; then
|
||||
oldversion=$spec_version
|
||||
echo $oldversion
|
||||
|
||||
elif [ $kind == "ChaosExperiment" ]; then
|
||||
# echo $temp
|
||||
oldversionfile=$temp'.version.yaml'
|
||||
echo $oldversionfile
|
||||
eval $(yaml $oldversionfile)
|
||||
`sed -i "s/$oldversion/$newversion/" $oldversionfile` &&
|
||||
`sed -i "s/version:[[:space:]]*$newversion/version: {{ VERSION }}/" $file`
|
||||
fi
|
||||
|
||||
oldversion=$metadata_version
|
||||
echo $oldversion
|
||||
elif [ $kind == "ChaosExperiment" ]; then
|
||||
# echo $temp
|
||||
oldversionfile=$temp'.version.yaml'
|
||||
echo $oldversionfile
|
||||
eval $(yaml $oldversionfile)
|
||||
|
||||
`sed -i "s/$oldversion/$newversion/" $oldversionfile`
|
||||
`sed -i "s/version:[[:space:]]*$oldversion/version: {{ VERSION }}/" $file`
|
||||
if [[ $? == 0 ]]; then
|
||||
oldversion=$metadata_version
|
||||
echo $oldversion
|
||||
|
||||
`sed -i "s/$oldversion/$newversion/" $oldversionfile`
|
||||
`sed -i "s/version:[[:space:]]*$newversion/version: {{ VERSION }}/" $file`
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
Reference in New Issue
Block a user