Files
mattermostest/scripts/cp_artifacts.sh
Guillermo Vayá d2435a561c [MM-18552] Autoupdater (#1714)
* wip

* background download

* various fixes

* wip

* wokring autoupgrade

* fix menu

* fix windows

* cleanup

* add publishername

* fix messages and titles

* Test updates

* Moved module and added functionality to click icon to install (instead of just download)

* Add auto update setting, update on close app if downloaded

* Tests, changes for security fixes, update version number

* Update E2E tests

* Lint fix

* Update to latest electron-updater

* Revert to stable electron-builder (only needed to update electron-updater)

* Fix package-lock

* skip flaky test

* Update package

* Fix E2E test

* Fixes for enabling/disabled autoupdater

* Fixed GPO definitions

* [MM-38300] Set localhost as the test server

* blank

* Switch to s3 bucket for testing

* Update icons to match spec

* Add menu items for download/update actions

* Type and test fixes

* Fix notification circle

* Fix macOS app not restarting on Restart/Update

* Update dialog box titles

* Turn off file system check for Linux

* Changes to support deployments

* Testing autoupdater deployments to s3

* disable tests for now

* asfrehwf

* fine no windows WHATEVER

* remove windows again

* Try universal all in one

* pffftttngggguhhhh

* make sure it's working

* Missed artifacts script

* Modify destination as well

* one more time!

* Update yml files

* Oops

* add yq manually

* oof

* Fix the script to work properly

* Fix release script

* Fix script again so it runs in time

* Build version 2

* Revert build specific changes

* Lint override

* Fix build apps for PR builds

* One more change

* Add file generation for .deb repo

* Deb repo test

* skip tests for now

* Fix artifact push

* Persist after repo creation

* Put tests back

* Fix unit tests

* Enable mac generated builds temp

* Temporarily disable tests

* Fix issue where notification doesn't pop dialog box

* Try version 2 again

* Put the version back

* Attempting to debug mac app path issue

* Fix issue where Mac app will quarantine itself after first update

* Lock versions of yq

* Fix yq for mac

* As usual, Mac is difficult :P

* Add quotes to anti-quarantine command

* Change to spawn to avoid command injection

* Oops

* Nightly deployment changes (#2005)

* Test nightly deploy

* I fixed a some things

* aaaaaaaaa

* Restore old bucket

* Added progress indicator via tooltip

* Ship nightly builds to main S3 bucket

* PR feedback

* Fix a couple security exploits

* Fix opacity on light mode button

* Use large app icon

* Resize icon for Windows

* Resize icon for Mac

* Update to electron-updater final

* Remove Mac support and deb repo

* Typo

* Remove deb script

* Remove checksum function

* Removed autoUpdateSettingsPath

* Update URL

Co-authored-by: = <=>
Co-authored-by: Devin Binnie <devin.binnie@mattermost.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Devin Binnie <52460000+devinbinnie@users.noreply.github.com>
2022-03-08 11:38:38 -05:00

82 lines
3.6 KiB
Bash
Executable File

#!/usr/bin/env bash
set -eu
VERSION="$(jq -r '.version' <package.json)"
SRC="${1}/${VERSION}"
DEST="${2}/${VERSION}"
SOMETHING_COPIED=0
if [[ ! -d "${DEST}" ]]; then
echo "Can't find destination. Creating \"${DEST}\""
mkdir -p "${DEST}"
fi
if [[ -f "${SRC}/mattermost-desktop-${VERSION}-win-ia32.zip" ]]; then
echo -e "Copying Win32\n"
cp "${SRC}/mattermost-desktop-${VERSION}-win-ia32.zip" "${DEST}/mattermost-desktop-${VERSION}-win32.zip"
SOMETHING_COPIED=1
fi
if [[ -f "${SRC}/mattermost-desktop-${VERSION}-win-x64.zip" ]]; then
echo -e "Copying Win64\n"
cp "${SRC}/mattermost-desktop-${VERSION}-win-x64.zip" "${DEST}/mattermost-desktop-${VERSION}-win64.zip"
SOMETHING_COPIED=$((SOMETHING_COPIED + 2))
fi
if [[ ${MM_WIN_INSTALLERS-0} -eq 1 && -f "${SRC}/mattermost-desktop-setup-${VERSION}-win.exe" ]]; then
echo -e "Copying win-no-arch\n"
cp "${SRC}/mattermost-desktop-setup-${VERSION}-win.exe" "${DEST}/"
SOMETHING_COPIED=$((SOMETHING_COPIED + 4))
fi
if [[ -f "${SRC}/mattermost-desktop-${VERSION}-mac.zip" ]]; then
echo -e "Copying mac\n"
cp "${SRC}"/mattermost-desktop-*-mac*.* "${DEST}/"
if [[ -f "${SRC}"/mattermost-desktop-${VERSION}-mac.dmg ]]; then
cp "${SRC}"/*.blockmap "${DEST}/"
fi
SOMETHING_COPIED=$((SOMETHING_COPIED + 8))
fi
if [[ -f "${SRC}/mattermost-desktop-${VERSION}-mac-x64.zip" ]]; then
echo -e "Copying mac-x64\n"
cp "${SRC}/mattermost-desktop-${VERSION}-mac-x64.zip" "${DEST}/mattermost-desktop-${VERSION}-mac-x64.zip"
if [[ -f "${SRC}"/mattermost-desktop-${VERSION}-mac-x64.dmg ]]; then
cp "${SRC}/mattermost-desktop-${VERSION}-mac-x64.dmg.blockmap" "${DEST}/mattermost-desktop-${VERSION}-mac-x64.dmg.blockmap"
cp "${SRC}/mattermost-desktop-${VERSION}-mac-x64.dmg" "${DEST}/mattermost-desktop-${VERSION}-mac-x64.dmg"
fi
SOMETHING_COPIED=$((SOMETHING_COPIED + 8))
fi
if [[ -f "${SRC}/mattermost-desktop-${VERSION}-mac-arm64.zip" ]]; then
echo -e "Copying mac-arm64\n"
cp "${SRC}/mattermost-desktop-${VERSION}-mac-arm64.zip" "${DEST}/mattermost-desktop-${VERSION}-mac-arm64.zip"
if [[ -f "${SRC}"/mattermost-desktop-${VERSION}-mac-arm64.dmg ]]; then
cp "${SRC}/mattermost-desktop-${VERSION}-mac-arm64.dmg.blockmap" "${DEST}/mattermost-desktop-${VERSION}-mac-arm64.dmg.blockmap"
cp "${SRC}/mattermost-desktop-${VERSION}-mac-arm64.dmg" "${DEST}/mattermost-desktop-${VERSION}-mac-arm64.dmg"
fi
SOMETHING_COPIED=$((SOMETHING_COPIED + 16))
fi
if [[ -f "${SRC}/mattermost-desktop-${VERSION}-mac-universal.zip" ]]; then
echo -e "Copying mac-universal\n"
cp "${SRC}/mattermost-desktop-${VERSION}-mac-universal.zip" "${DEST}/mattermost-desktop-${VERSION}-mac-universal.zip"
if [[ -f "${SRC}"/mattermost-desktop-${VERSION}-mac-universal.dmg ]]; then
cp "${SRC}/mattermost-desktop-${VERSION}-mac-universal.dmg.blockmap" "${DEST}/mattermost-desktop-${VERSION}-mac-universal.dmg.blockmap"
cp "${SRC}/mattermost-desktop-${VERSION}-mac-universal.dmg" "${DEST}/mattermost-desktop-${VERSION}-mac-universal.dmg"
fi
SOMETHING_COPIED=$((SOMETHING_COPIED + 32))
fi
if [[ -f "${SRC}"/mattermost-desktop-${VERSION}-linux-x64.tar.gz ]]; then
echo -e "Copying linux\n"
cp "${SRC}"/mattermost-desktop-*-linux-* "${DEST}/"
cp "${SRC}"/mattermost-desktop_"${VERSION}"-1_*.deb "${DEST}/"
SOMETHING_COPIED=$((SOMETHING_COPIED + 64))
fi
if [[ $SOMETHING_COPIED -eq 0 ]]; then
echo "Didn't find anything to copy, it seems like something failed"
# Bash only returns 0-255 values
exit 1
fi
cp "${1}"/*.yml "${2}/"
# exit $SOMETHING_COPIED
exit 0