Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/build_backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,11 @@ jobs:
run: |
bash ./buildscripts/ci/backend/publish_to_registry.sh --token ${{ secrets.PACKAGES_PAT }}

- name: Deploy to musescore.com
- name: Check and update config on S3
if: env.DO_DEPLOY == 'true'
run: |
bash ./buildscripts/ci/backend/update_config_on_s3.sh \
bash ./buildscripts/ci/backend/check_update_config_on_s3.sh \
--token ${{ secrets.PACKAGES_PAT }} \
--s3_key ${{ secrets.S3_KEY_CONVERTER }} \
--s3_secret ${{ secrets.S3_SECRET_CONVERTER }} \
--stage ${{ inputs.build_mode }} \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

trap 'echo Check and update config failed; exit 1' ERR

ACCESS_USER="igorkorsukov" # For test, should be replaced with muse-bot
ACCESS_TOKEN=$GITHUB_TOKEN
S3_KEY=""
S3_SECRET=""
S3_URL="s3://convertor.musescore.org"
Expand All @@ -30,6 +34,8 @@ MU_VERSION_MAJOR_MINOR=""

while [[ "$#" -gt 0 ]]; do
case $1 in
-t|--token) ACCESS_TOKEN="$2"; shift ;;
-u|--user) ACCESS_USER="$2"; shift ;;
--s3_key) S3_KEY="$2"; shift ;;
--s3_secret) S3_SECRET="$2"; shift ;;
--stage) STAGE="$2"; shift ;;
Expand All @@ -40,6 +46,27 @@ while [[ "$#" -gt 0 ]]; do
shift
done

# Check
echo "Login Docker"
echo $ACCESS_TOKEN | docker login ghcr.io -u $ACCESS_USER --password-stdin

echo "Pull Docker"
docker pull ghcr.io/musescore/converter_4:${MU_VERSION}

echo "Check version..."
docker run ghcr.io/musescore/converter_4:${MU_VERSION} /musescore/convertor -v > $ARTIFACTS_DIR/conv_output.txt

APP_VERSION=$(echo "$MU_VERSION" | cut -d '.' -f 1,2,3)
CONV_OUT=$(cat $ARTIFACTS_DIR/conv_output.txt)
if [[ "$CONV_OUT" == *"$APP_VERSION" ]]; then
echo "The test was successful, convertor output: $CONV_OUT, version: $APP_VERSION"
else
echo "The test failed, convertor output: $CONV_OUT, version: $APP_VERSION"
exit 1
fi

echo "Update config..."

bash ./buildscripts/ci/tools/s3_install.sh --s3_key ${S3_KEY} --s3_secret ${S3_SECRET}

if [ -z "$ARTIFACT_PATH" ]; then
Expand Down
Loading