-
Notifications
You must be signed in to change notification settings - Fork 960
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mobile app CI build and deploy (#2890)
* Deploy electricityMap static assets to GCS * update dockerfile paths * Revert * Fix dockerfile * Add config * update container path * Mobile app CI build and deploy * Show app version on mobile info tab * lint * restore build.sh * update * Add staging * Add promote stage * Final * Req changes
- Loading branch information
Showing
8 changed files
with
113 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
steps: | ||
prepare: | ||
image: node:10.19.0-alpine | ||
inputs: | ||
- package.json | ||
- package-lock.json | ||
commands: | ||
- apk add --no-cache git imagemagick | ||
# Install gsutil | ||
- apk add --no-cache curl bash python3 | ||
- curl https://sdk.cloud.google.com | bash > /dev/null | ||
- npm ci | ||
- npm install -g [email protected] [email protected] | ||
|
||
build: | ||
inputs: | ||
- ../web/public | ||
- ../web/{locales,src,views/pages/index.ejs} | ||
- ../web/locales-config.json | ||
- www/index.html | ||
- ./icon*.png | ||
- generate-index.js | ||
- config.xml | ||
- res/screen/ios | ||
- sentry.properties | ||
commands: | ||
- cp -r ../web/public/ www/electricitymap | ||
- cp -r ../web/locales/ . | ||
- cp ../web/locales-config.json ./locales-config.json | ||
- cp -r ../web/src . | ||
# Generate bundle | ||
- node generate-index.js | ||
# Generate icons | ||
- node_modules/.bin/app-icon generate -i icon_ios.png --platforms=ios | ||
- node_modules/.bin/app-icon generate -i icon_android_legacy.png --platforms=android --adaptive-icons | ||
# Set Sentry auth-token | ||
- echo "auth-token=${BRICK_SENTRY_AUTH_TOKEN:-unknown}" >> sentry.properties | ||
|
||
deploy: | ||
commands: | ||
# Prepare | ||
- /root/google-cloud-sdk/bin/gsutil cp gs://electricitymap-secrets/mobileapp/google-services.json . | ||
- /root/google-cloud-sdk/bin/gsutil cp gs://electricitymap-secrets/mobileapp/GoogleService-Info.plist . | ||
- cordova prepare | ||
# Release to staging | ||
- code-push login --accessKey ${BRICK_CODE_PUSH_ACCESS_KEY:-unknown} | ||
- code-push release-cordova electricitymap-android android --noDuplicateReleaseError --description ${BRICK_DRONE_COMMIT_SHA:-latest} | ||
- code-push release-cordova electricitymap-ios ios --noDuplicateReleaseError --description ${BRICK_DRONE_COMMIT_SHA:-latest} | ||
# Promote | ||
- code-push promote electricitymap-android Staging Production | ||
- code-push promote electricitymap-ios Staging Production | ||
secrets: | ||
gcloud: | ||
src: ~/.config/gcloud | ||
target: /root/.config/gcloud |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
defaults.url=https://sentry.io/ | ||
defaults.org=tomorrow | ||
defaults.project=electricitymap-app | ||
cli.executable=node_modules/@sentry/cli/bin/sentry-cli |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters