Skip to content

Instantly share code, notes, and snippets.

@ekuiter
Created October 18, 2020 11:17
Show Gist options
  • Select an option

  • Save ekuiter/1592a55376f9376c2e7d2d892e7ef4bc to your computer and use it in GitHub Desktop.

Select an option

Save ekuiter/1592a55376f9376c2e7d2d892e7ef4bc to your computer and use it in GitHub Desktop.
gitlab.com MuseScore Exporter
musescore_export:
stage: deploy
image: ubuntu:focal
before_script:
- 'which ssh-agent || ( apt-get update -qy && apt-get install openssh-client -qqy )'
- eval `ssh-agent -s`
- echo "${SSH_PRIVATE_KEY}" | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo "$SSH_PUBLIC_KEY" >> ~/.ssh/id_rsa.pub
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
script:
- apt-get -yqq update
- apt-get -yqq install software-properties-common
- add-apt-repository ppa:mscore-ubuntu/mscore3-stable
- apt-get -yqq update
- apt-get -yqq install git imagemagick ffmpeg musescore3
- git clone https://github.com/ekuiter/bemuse.git
- echo "Added or changed MuseScore files:"
- echo "$(git diff --name-status $(git log --pretty="%H %s" | grep "\[skip ci\]" | cut -d" " -f1 | head -n1) HEAD | grep "^[A|M|R]" | rev | cut -f1 | rev | grep "\.mscz$")"
- echo "$(git diff --name-status $(git log --pretty="%H %s" | grep "\[skip ci\]" | cut -d" " -f1 | head -n1) HEAD | grep "^[A|M|R]" | rev | cut -f1 | rev | grep "\.mscz$")" | while read -r f; do if [[ ! -z "$f" ]]; then mkdir -p "$(dirname "$f")"; QT_QPA_PLATFORM=offscreen bemuse/bemuse --skip-video --skip-jpg --skip-ffmpeg-mp3 "$f"; fi; done
- rm -rf bemuse
- git config --global user.email "${CI_EMAIL}"
- git config --global user.name "${CI_USERNAME}"
- git add -A
- git commit -m "Updated sheet music [skip ci]" || echo "No changes, nothing to commit!"
- git remote rm origin && git remote add origin [email protected]:$CI_PROJECT_PATH.git
- git push origin HEAD:$CI_COMMIT_REF_NAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment