diff --git a/resources/build/ci/sentry-control.inc.sh b/resources/build/ci/sentry-control.inc.sh index a01a0f730d..aae674f8c9 100644 --- a/resources/build/ci/sentry-control.inc.sh +++ b/resources/build/ci/sentry-control.inc.sh @@ -12,7 +12,7 @@ function isSentryConfigured() { if [ -z "${SENTRY_AUTH_TOKEN-}" ] || [ -z "${SENTRY_ORG-}" ] || [ -z "${SENTRY_URL-}" ]; then - echo "WARNING: Sentry environment variables SENTRY_AUTH_TOKEN, SENTRY_ORG and SENTRY_URL must be configured." + builder_warn "WARNING: Sentry environment variables SENTRY_AUTH_TOKEN, SENTRY_ORG and SENTRY_URL must be configured." return 1 fi return 0 @@ -20,7 +20,7 @@ function isSentryConfigured() { function isSentryCliAvailable() { which sentry-cli > /dev/null && return 0 - echo "WARNING: sentry-cli could not be found. Skipping all sentry integration." + builder_warn "WARNING: sentry-cli could not be found. Skipping all sentry integration." return 1 } @@ -28,29 +28,35 @@ function makeSentryRelease() { if isSentryConfigured; then if isSentryCliAvailable; then # This version tag matches the repository version tag release@x.y.z - echo "Making a Sentry release for tag $KEYMAN_VERSION_GIT_TAG" + builder_echo "Making a Sentry release for tag $KEYMAN_VERSION_GIT_TAG" sentry-cli releases new -p keyman-android -p keyman-developer -p keyman-ios -p keyman-linux -p keyman-mac -p keyman-web -p keyman-windows $KEYMAN_VERSION_GIT_TAG - echo "Setting commits for release tag $KEYMAN_VERSION_GIT_TAG" + builder_echo "Setting commits for release tag $KEYMAN_VERSION_GIT_TAG" sentry-cli releases set-commits --auto $KEYMAN_VERSION_GIT_TAG - echo "Finalizing release tag $KEYMAN_VERSION_GIT_TAG" + builder_echo "Finalizing release tag $KEYMAN_VERSION_GIT_TAG" sentry-cli releases finalize "$KEYMAN_VERSION_GIT_TAG" fi fi } +# +# Upload sourcemaps to Sentry +# +# Parameters: +# 1: Directory containing sourcemaps to upload +# function sentry_upload_web () { + local SOURCEMAP_DIR="$1" if ! isSentryConfigured; then - echo "Skipping Sentry upload: SENTRY_ORG and/or SENTRY_PROJECT are unset." + builder_warn "Skipping Sentry upload: SENTRY_ORG and/or SENTRY_PROJECT are unset." return fi - echo "Uploading $1 to Sentry..." + builder_echo "Uploading ${SOURCEMAP_DIR} to Sentry..." - # --strip-common-prefix does not take an argument, unlike --strip-prefix. It auto-detects - # the most common prefix instead. - sentry-cli releases files "${KEYMAN_VERSION_GIT_TAG}" upload-sourcemaps --strip-common-prefix "$1" \ - --rewrite --ext js --ext map --ext ts - echo "Upload successful." + sentry-cli releases files "${KEYMAN_VERSION_GIT_TAG}" upload-sourcemaps --strip-common-prefix \ + "${SOURCEMAP_DIR}" --rewrite --ext js --ext map --ext ts + + builder_echo "Upload successful." } diff --git a/resources/teamcity/ios/ios-actions.inc.sh b/resources/teamcity/ios/ios-actions.inc.sh index 765e3542ab..fb803aae89 100755 --- a/resources/teamcity/ios/ios-actions.inc.sh +++ b/resources/teamcity/ios/ios-actions.inc.sh @@ -3,21 +3,18 @@ ios_build() { builder_echo start "build" "Building KeymanEngine + Keyman for iOS" - # shellcheck disable=SC2154 - "${KEYMAN_ROOT}/ios/ci.sh" build + builder_launch /ios/ci.sh build builder_echo end "build" success "Finished building KeymanEngine + Keyman for iOS" } ios_capture_build_artifacts() { builder_echo start "prep-release" "Using prep-release script to capture build artifacts" - "${KEYMAN_ROOT}/ios/tools/prepRelease.sh" + builder_launch /ios/tools/prepRelease.sh builder_echo end "prep-release" success "Finished capturing build artifacts" } ios_publish_symbols() { builder_echo start "publish to Sentry" "Publishing source map to Sentry" - builder_launch /ios/build.sh "publish-symbols" - builder_echo end "publish to Sentry" success "Finished publishing source map to Sentry" }