change tag update from version to upstream

This commit is contained in:
Alexandre
2021-02-21 08:47:19 +01:00
parent 4388ca91f0
commit ab7affe797

View File

@@ -48,7 +48,7 @@ for addons in $(bashio::config "addon|keys"); do
#Find current version
LOGINFO="... $SLUG : get current version" && if [ $VERBOSE = true ]; then bashio::log.info $LOGINFO; fi
CURRENT=$(jq .version config.json) || bashio::log.error "$SLUG addon version in config.json not found. Exiting." exit
CURRENT=$(jq .upstream config.json) || bashio::log.error "$SLUG addon upstream tag not found in config.json. Exiting." exit
#Prepare tag flag
if [ ${FULLTAG} = true ]; then
@@ -68,9 +68,6 @@ fi
LASTVERSION=$(lastversion "https://github.com/$UPSTREAM" $FULLTAG)
fi
# Take only into account first part of tag
# CURRENT=${CURRENT:0:${#LASTVERSION}}
# Add brackets
LASTVERSION='"'$LASTVERSION'"'
@@ -80,7 +77,8 @@ fi
#Change all instances of version
LOGINFO="... $SLUG : updating files" && if [ $VERBOSE = true ]; then bashio::log.info $LOGINFO; fi
files=$(grep -rl ${CURRENT} /data/${BASENAME}/${SLUG}) && echo $files | xargs sed -i "s/${CURRENT}/${LASTVERSION}/g"
files=$(grep -rl ${CURRENT} /data/${BASENAME}/${SLUG}) && echo $files | xargs sed -i "s/${CURRENT}/${LASTVERSION}/g" # change all tags in all addon files
jq --arg LASTVERSION "$LASTVERSION" '.upstream = $LASTVERSION' /data/${BASENAME}/${SLUG}/config.json # Correct config upstream
#Update changelog
touch /data/${BASENAME}/${SLUG}/CHANGELOG.md