Revision control

Copy as Markdown

format_version: '8'
workflows:
L10nBuild:
before_run:
# - skip_macro_validation # TODO screenshost need build?
steps:
- activate-ssh-key@4:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone@8: {}
- cache-pull@2: {}
- certificate-and-profile-installer@1: {}
- script@1:
inputs:
- content: |-
brew trust mozilla-mobile/fxios
brew tap mozilla-mobile/fxios
brew install fxios
fxios bootstrap
title: Run bootstrap
- script@1:
title: NPM install and build
inputs:
- content: |-
#!/usr/bin/env bash
# fail if any commands fails
set -e
# debug log
set -x
npm install
npm run build
- script@1:
inputs:
- content: |-
#!/usr/bin/env bash
# fail if any commands fails
set -e
# debug log
set -x
gem install fastlane -v 2.241.1
fastlane -version
xcodebuild -version
./firefox-ios/l10n-screenshots.sh en-US
title: Generate screenshots
- save-cache@1:
inputs:
- key: l10n-screenshots-dd-$GIT_CLONE_COMMIT_HASH
- paths: l10n-screenshots-dd
- deploy-to-bitrise-io@2:
inputs:
- deploy_path: l10n-screenshots/en-US/en-US
- is_compress: 'true'
- script@1:
title: Upload screenshots to Google Cloud Storage
run_if: '{{getenv "BITRISEIO_GCP_L10N_SCREENSHOTS_KEY_URL" | ne ""}}'
inputs:
- content: |-
#!/usr/bin/env bash
set -euo pipefail
curl -sfo /tmp/gcs-key.json "$BITRISEIO_GCP_L10N_SCREENSHOTS_KEY_URL"
gcloud auth activate-service-account -q --key-file /tmp/gcs-key.json
rm -f /tmp/gcs-key.json
ZIP="Firefox-iOS-L10n-en-US-$(date +%Y%m%d).zip"
(cd l10n-screenshots/en-US/en-US && zip -q -9 "$OLDPWD/$ZIP" ./*.png)
DEST="gs://mobile-reports/public/l10n-screenshots/$(date +%F)-${BITRISE_BUILD_NUMBER}/$ZIP"
gcloud storage cp "$ZIP" "$DEST"
echo "Screenshots uploaded to $URL"
envman add --key L10N_SCREENSHOTS_URL --value "$URL"
- slack@4:
title: Notify Slack that screenshots are ready
run_if: '{{and (not .IsBuildFailed) (getenv "L10N_SCREENSHOTS_URL" | ne "") (getenv "NOTIFY_L10N_SLACK" | eq "true")}}'
inputs:
- title: ''
- author_name: ''
- webhook_url: "$WEBHOOK_L10N_TEST_ENG"
- footer_icon: https://emoji.slack-edge.com/T07DB2PSS3W/testops-notify/55edcdb3371320b6.png
- footer: Created by Mobile Test Engineering
- pretext: "*Firefox-iOS* :firefox: *L10n screenshots (en-US)* :camera_with_flash: :translation_icon:"
- message: ''
- timestamp: 'no'
- fields: |
Branch | ${BITRISE_GIT_BRANCH}
- buttons: |
Download screenshots (zip)|${L10N_SCREENSHOTS_URL}
Build Log|${BITRISE_BUILD_URL}
envs:
- opts:
is_expand: false
BITRISE_SCHEME: L10nSnapshotTest
description: >-
This Workflow is to run L10n tests in one locale and then share the bundle with
the rest of the builds
L10nBuild_Scheduled:
envs:
- NOTIFY_L10N_SLACK: "true"
after_run:
- L10nBuild
description: >-
Weekly scheduled run of L10nBuild that also posts the en-US screenshots link to Slack
L10nScreenshotsTests:
steps:
- activate-ssh-key@4:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone@8: {}
- certificate-and-profile-installer@1: {}
- restore-cache@2:
inputs:
- key: |-
l10n-screenshots-dd-$GIT_CLONE_COMMIT_HASH
l10n-screenshots-dd-
- paths: l10n-screenshots-dd
title: Download derived data path
- script@1:
inputs:
- content: |-
#!/usr/bin/env bash
# fail if any commands fails
set -e
# debug log
set -x
gem install fastlane -v 2.241.1
fastlane -version
./firefox-ios/l10n-screenshots.sh --test-without-building $MOZ_LOCALES
mkdir -p artifacts
for locale in $(echo $MOZ_LOCALES); do
zip -9 -j "$locale.zip" "l10n-screenshots/$locale/$locale/"*
mv "$locale.zip" artifacts/
done
title: Generate screenshots
- deploy-to-bitrise-io@2:
inputs:
- deploy_path: artifacts/
envs:
- opts:
is_expand: false
BITRISE_SCHEME: L10nSnapshotTest
description: >-
This Workflow is to run L10n tests for all locales
# # Update the name change in Taskcluster files
# focus_l10n_build:
# before_run:
# - focus-clone-and-build-dependencies
# steps:
# - script@1:
# title: Set Default Web Browser Entitlement
# inputs:
# - content: |-
# #!/usr/bin/env bash
# set -x
# /usr/libexec/PlistBuddy -c "Add :com.apple.developer.web-browser bool true" focus-ios/Focus.entitlements
# /usr/libexec/PlistBuddy -c "Add :com.apple.developer.web-browser bool true" focus-ios/Klar.entitlements
# - script@1:
# title: Generate screenshots
# inputs:
# - content: |-
# #!/usr/bin/env bash
# set -x
# # workaround until 2.187 version is installed. Error with 2.186
# ./focus-ios/focus-ios-tests/l10n-screenshots.sh en-US
# - deploy-to-bitrise-io@1.10:
# inputs:
# - deploy_path: l10n-screenshots-dd/
# - is_compress: 'true'
# - deploy-to-bitrise-io@1.10:
# inputs:
# - deploy_path: l10n-screenshots/en-US/en-US
# - is_compress: 'true'
# focus_l10n_screenshots_tests:
# steps:
# - activate-ssh-key@4:
# run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
# - git-clone@8: {}
# - cache-pull@2: {}
# - certificate-and-profile-installer@1: {}
# - script@1:
# title: Set Default Web Browser Entitlement
# inputs:
# - content: |-
# #!/usr/bin/env bash
# set -x
# /usr/libexec/PlistBuddy -c "Add :com.apple.developer.web-browser bool true" focus-ios/Focus.entitlements
# /usr/libexec/PlistBuddy -c "Add :com.apple.developer.web-browser bool true" focus-ios/Klar.entitlements
# - script@1:
# inputs:
# - content: >-
# #!/usr/bin/env bash
# # fail if any commands fails
# set -e
# # debug log
# set -x
# echo "curl to Download derived data"
# curl --location --retry 5 --output l10n-screenshots-dd.zip "$MOZ_DERIVED_DATA_PATH"
# mkdir l10n-screenshots-dd
# unzip l10n-screenshots-dd.zip -d l10n-screenshots-dd
# rm l10n-screenshots-dd.zip
# title: Download derived data path
# - script@1:
# title: Generate screenshots
# inputs:
# - content: |-
# #!/usr/bin/env bash
# # fail if any commands fails
# set -e
# # debug log
# set -x
# # workaround until 2.187 version is installed. Error with 2.186
# ./focus-ios/focus-ios-tests/l10n-screenshots.sh --test-without-building $MOZ_LOCALES
# mkdir -p artifacts
# for locale in $(echo $MOZ_LOCALES); do
# # Only Focus for now
# zip -9 -j "$locale.zip" "l10n-screenshots/$locale/$locale/"*
# mv "$locale.zip" artifacts/
# done
# - deploy-to-bitrise-io@1.10:
# inputs:
# - deploy_path: artifacts/