Created
June 6, 2021 19:01
-
-
Save barathrm/acf9e1436fec3a7fe64f2cd422a1baa8 to your computer and use it in GitHub Desktop.
publish a new version on OBS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
USER="$1" | |
PASS="$2" | |
REVISION="$3" | |
export API="https://api.opensuse.org" | |
export PROJ="home:fawz:mooltipass" | |
export PKG="moolticute" | |
# for moolticute-testing | |
# export PKG="moolticute-testing" | |
export OBS_COMMIT_MSG="Update package to revision ${REVISION}" | |
# Fetch current _service file to CWD | |
curl -u $USER:$PASS -X GET ${API}/source/${PROJ}/${PKG}/_service -o _service | |
# Update revision to build | |
sed -i "s|<param name=\"revision\">\(.*\)</param>|<param name=\"revision\">${REVISION}</param>|" _service | |
# Push modified _service file back to OBS | |
curl -u $USER:$PASS -X PUT -T _service ${API}/source/${PROJ}/${PKG}/_service | |
# Commit changes, which will trigger a new build and eventually release | |
curl -u $USER:$PASS -X POST ${API}/source/${PROJ}/${PKG}?cmd=commit --data-urlencode "comment=${OBS_COMMIT_MSG}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment