1919# You should have received a copy of the GNU General Public License
2020# along with this program. If not, see <https://www.gnu.org/licenses/>.
2121
22+ trap ' echo Check and update config failed; exit 1' ERR
23+
24+ ACCESS_USER=" igorkorsukov" # For test, should be replaced with muse-bot
25+ ACCESS_TOKEN=$GITHUB_TOKEN
2226S3_KEY=" "
2327S3_SECRET=" "
2428S3_URL=" s3://convertor.musescore.org"
@@ -30,6 +34,8 @@ MU_VERSION_MAJOR_MINOR=""
3034
3135while [[ " $# " -gt 0 ]]; do
3236 case $1 in
37+ -t|--token) ACCESS_TOKEN=" $2 " ; shift ;;
38+ -u|--user) ACCESS_USER=" $2 " ; shift ;;
3339 --s3_key) S3_KEY=" $2 " ; shift ;;
3440 --s3_secret) S3_SECRET=" $2 " ; shift ;;
3541 --stage) STAGE=" $2 " ; shift ;;
@@ -40,6 +46,27 @@ while [[ "$#" -gt 0 ]]; do
4046 shift
4147done
4248
49+ # Check
50+ echo " Login Docker"
51+ echo $ACCESS_TOKEN | docker login ghcr.io -u $ACCESS_USER --password-stdin
52+
53+ echo " Pull Docker"
54+ docker pull ghcr.io/musescore/converter_4:${MU_VERSION}
55+
56+ echo " Check version..."
57+ docker run ghcr.io/musescore/converter_4:${MU_VERSION} /musescore/convertor -v > $ARTIFACTS_DIR /conv_output.txt
58+
59+ APP_VERSION=$( echo " $MU_VERSION " | cut -d ' .' -f 1,2,3)
60+ CONV_OUT=$( cat $ARTIFACTS_DIR /conv_output.txt)
61+ if [[ " $CONV_OUT " == * " $APP_VERSION " ]]; then
62+ echo " The test was successful, convertor output: $CONV_OUT , version: $APP_VERSION "
63+ else
64+ echo " The test failed, convertor output: $CONV_OUT , version: $APP_VERSION "
65+ exit 1
66+ fi
67+
68+ echo " Update config..."
69+
4370bash ./buildscripts/ci/tools/s3_install.sh --s3_key ${S3_KEY} --s3_secret ${S3_SECRET}
4471
4572if [ -z " $ARTIFACT_PATH " ]; then
0 commit comments