fastlane-community / fastlane-plugin-ionic Goto Github PK
View Code? Open in Web Editor NEWIntegrate your Ionic build into your Fastlane setup
License: MIT License
Integrate your Ionic build into your Fastlane setup
License: MIT License
See #42
This might not be optimal and could/should be fixed.
MVP: if by platform
Kür: Can we get from ionic/cordova if the build really created this file?
Something like this can be used when you built before with gradle
:
supply(
track: "alpha",
apk: "#{lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH]}"
)
This variable is also used by other actions automatically:
https://github.com/fastlane/fastlane/blob/3ce48e60491805749f9b95b11e159376777fe688/fastlane/lib/fastlane/actions/supply.rb#L15
So having something like this called IONIC_APK_OUTPUT_PATH
and IONIC_IOS_OUTPUT_PATH
could be useful for use.
As I do not have the time to properly maintain this plugin (and also am not really using Ionic in my current job) I transferred this plugin to https://github.com/fastlane-community/fastlane-plugin-ionic/.
You can read more about the fastlane-community
org at https://github.com/fastlane-community/README
iOS builds are dependant on the type
param right now as they are used to get the correct certificate for a build:
Builds fails if there is an interactive prompts for e.g. updating Ionic CLI.
Solution:
https://ionicframework.com/docs/cli/configuring.html#flags
Hello,
Is plugin support Ionic V4 (and monorepo) ?
I have an application with Ionic V4 in monorepo (web + mobile).
In my monorepo, I go to my mobile project folder and run
fastlane init swift
[✔] 🚀
[✔] Looking for iOS and Android projects in current directory...
[17:33:34]: Created new folder './fastlane'.
[17:33:34]: It looks like there is no iOS project in the current directory, though we did find one in a sub-directory
[17:33:34]: Pleasecd
into the directory of the intended Xcode project you wish to use.[!] Please
cd
into the directory of the intended Xcode project you wish to use and runfastlane init
again
Right now the build is done by the ionic cordova
command(s).
This does work just fine, but using --no-build
and adding a ionic build
step before this could be seperated. This way for example --prod
would only have to be given to the ionic build
command, not to the ionic cordova
commands.
I use ionic command to build my app with this parameters:
ionic(
platform: 'ios',
build_number: latest_build + 1,
prod: true,
release: true,
device: true,
cordova_prepare: true,
build_flag: [
"EMBEDDED_CONTENT_CONTAINS_SWIFT = YES",
"ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES=NO",
"LD_RUNPATH_SEARCH_PATHS = \"@executable_path/Frameworks\"",
"-UseModernBuildSystem=0"
]
)
But somehow this is calling ionic cordova resources
command and it fails.
> ionic cordova resources ios --force
[ERROR] Source image files were not found for the following platforms/types:
- ios/icon
- ios/splash
Is this part of this plugin? Can I skip this step? Because I manage creating resources manually.
My release lane looks something like this, but it ultimately fails with a code signing error (see below). The app gets built though, and if I fiddle around in xcode and change Signing (Release)
then I can get xcode to build my app for release. But, why doesn't the ionic build command finish successfully? It seems like I've matched my app store profile right before building with ionic
- so it should work?
Thanks!
(I'm using git_branch and team_id with match
because I work across multiple development teams)
lane :release do
match(
type: 'appstore',
git_branch: 'branch_name',
app_identifier: "my.app.identifier",
readonly: false,
username: '[email protected]',
team_id: 'my_team_id'
)
ionic(
platform: 'ios',
prod: true,
release: true
)
end
Error:
Code Signing Error: Provisioning profile "match AppStore my.app.identifier" doesn't include signing certificate "iPhone Developer: My NAME (ABCDEF1234)".
lala
To evaluate and maybe add:
Option | Description |
---|---|
--no-build | Do not invoke an Ionic build |
--aot | Perform ahead-of-time compilation for this build |
--minifyjs | Minify JS for this build |
--minifycss | Minify CSS for this build |
--optimizejs | Perform JS optimizations for this build |
--emulator | Deploy Cordova build to an emulator |
--buildConfig | Use the specified Cordova build configuration |
Already present:
Option | Description |
---|---|
--debug | Create a Cordova debug build |
--release | Create a Cordova release build |
--device | Deploy Cordova build to a device |
--prod | Build the application for production |
I need to output aab
file instead of apk
as per Google current recommendations
Cordova plugin only seems to really work with Xcode 8.
Error handling for sh
call in action.
I'm running ionic(platform: 'ios')
commant after a match(type: "appstore")
but I'm getting a very long error message with the following ending:
CodeSign /var/root/Library/Developer/Xcode/DerivedData/MyApp-ccztmzoxngbmurbvfmxpessvdbbf/Build/Intermediates.noindex/ArchiveIntermediates/MyApp/InstallationBuildProductsLocation/Applications/MyApp.app (in target: MyApp)
cd /Users/xcloud/workspace/DCIOSApp_DummApp/platforms/ios
export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
Signing Identity: "iPhone Distribution: ****"
Provisioning Profile: "match AppStore ***"
(****)
/usr/bin/codesign --force --sign D4DC6C722544727A58C7449A285185812CAD815E --entitlements /var/root/Library/Developer/Xcode/DerivedData/MyApp-ccztmzoxngbmurbvfmxpessvdbbf/Build/Intermediates.noindex/ArchiveIntermediates/MyApp/IntermediateBuildFilesPath/MyApp.build/Release-iphoneos/MyApp.build/MyApp.app.xcent /var/root/Library/Developer/Xcode/DerivedData/MyApp-ccztmzoxngbmurbvfmxpessvdbbf/Build/Intermediates.noindex/ArchiveIntermediates/MyApp/InstallationBuildProductsLocation/Applications/MyApp.app
/var/root/Library/Developer/Xcode/DerivedData/MyApp-ccztmzoxngbmurbvfmxpessvdbbf/Build/Intermediates.noindex/ArchiveIntermediates/MyApp/InstallationBuildProductsLocation/Applications/MyApp.app: errSecInternalComponent
Command CodeSign failed with a nonzero exit code
** ARCHIVE FAILED **
The following build commands failed:
CodeSign /var/root/Library/Developer/Xcode/DerivedData/MyApp-ccztmzoxngbmurbvfmxpessvdbbf/Build/Intermediates.noindex/ArchiveIntermediates/MyApp/InstallationBuildProductsLocation/Applications/MyApp.app
(1 failure)
xcodebuild: Command failed with exit code 65
[ERROR] An error occurred while running subprocess cordova.
cordova compile ios --release --device --packageType=app-store --developmentTeam... exited with exit code 65.
The commant it's trying to run is this:
ionic cordova compile ios --no-interactive --release --device --prod -- --packageType=app-store --developmentTeam=**** --provisioningProfile=***
The Ionic CLI currently supports the --configuration parameter on ionic cordova prepare
.
https://ionicframework.com/docs/cli/commands/cordova-prepare#advanced-options
It looks like there was already a PR to include this, but it was never merged:
#51
Is there any plans to merge this?
Below is some output from calls to match
and then ionic
Should the ionic command be showing summary output like match (and the rest of the fastlane commands)?
+---------------------+----------------------------------------+------------------------+
| Installed Provisioning Profile |
+---------------------+----------------------------------------+------------------------+
| Parameter | Environment Variable | Value |
+---------------------+----------------------------------------+------------------------+
| App Identifier | | XXXXXXXXXXXXXXXXXXXXX |
| Type | | XXXXXXXXXXXXXXXXXXXXX |
| Platform | | XXXXXXXXXXXXXXXXXXXXX |
| Profile UUID | XXXXXXXXXXXXXXXXX | XXXXXXXXXXXXXXXXXXXXX |
| Profile Name | XXXXXXXXXXXXXXXXX | XXXXXXXXXXXXXXXXXXXXX |
| Profile Path | XXXXXXXXXXXXXXXXX | XXXXXXXXXXXXXXXXXXXXX |
| | | XXXXXXXXXXXXXXXXXXXXX |
| | | XXXXXXXXXXXXXXXXXXXXX |
| Development Team ID | XXXXXXXXXXXXXXXXX | XXXXXXXXXXXXXXXXXXXXX |
+---------------------+----------------------------------------+------------------------+
[09:28:19]: All required keys, certificates and provisioning profiles are installed 🙌
[09:28:19]: Setting Provisioning Profile type to 'app-store'
[09:28:19]: -------------------
[09:28:19]: --- Step: ionic ---
[09:28:19]: -------------------
[09:28:19]: $ ionic cordova prepare ios --no-interactive --release --device --prod
Solutions:
Also applies to:
https://github.com/bamlab/fastlane-plugin-cordova/blob/master/lib/fastlane/plugin/cordova/actions/cordova_action.rb#L101-L102
Hi,
I have an issue when I try to do fastlane android build_debug
on MacOS and on Ubuntu 18.04
The error : No such file or directory @ rb_sysopen - config.xml
I use the following version :
[email protected] with a project based on 3.x.x
[email protected]
[email protected]
[email protected]
Is it possible to have a look on that ?
Thanks
Regards
Quit command execution with suitable error message if not platform was specified
type
is too broad, rename to be more specific
I fixed with:
lane :deploy_testflight do
match(type: "appstore")
ionic(
platform: "ios",
prod: true,
release: true,
type: "appstore",
)
testflight(
ipa: ENV["CORDOVA_IOS_RELEASE_BUILD_PATH"],
skip_waiting_for_build_processing: true,
)
end
Actions like hockey
are using SharedValues::GRADLE_APK_OUTPUT_PATH
or SharedValues::IPA_OUTPUT_PATH
so you don't have to explicitly set the APK path:
https://github.com/fastlane/fastlane/blob/master/fastlane/lib/fastlane/actions/hockey.rb#L185
https://github.com/fastlane/fastlane/blob/master/fastlane/lib/fastlane/actions/hockey.rb#L204
This plugin could also set these values when a build succeeded additionally to its own variables so hockey
and similar actions also don't need to manually get the path.
gym
automatically zips the .dsym file and moves it to the right place:
https://github.com/fastlane/fastlane/blob/d2c77f34024394000e44a2f3e840d95693cd3085/gym/lib/gym/runner.rb#L128
This plugin should also do this so it can be uploaded to HockeyApp etc.
(There is also a zip
action that could be used)
In my package.json, I have multiple scripts to build Android (and iOS) to choose my angular environment file
My package.json:
"foo-mobile:android-build-int": "ionic cordova build android --prod --release --configuration=integration-cordova",
"foo-mobile:android-build-int-api": "ionic cordova build android --prod --release --configuration=integration-cordova-api",
"foo-mobile:android-build-qua": "ionic cordova build android --prod --release --configuration=qualif-cordova",
"foo-mobile:android-build": "ionic cordova build android --prod --release --configuration=production-cordova",
My angular.json:
"qualif-cordova": {
"fileReplacements": [
{
"replace": "foo-mobile/src/environments/environment.ts",
"with": "foo-mobile/src/environments/environment.qua.ts"
}
],
How to pass specific parameters with Fastfile ?
My Fastfile:
platform :android do
desc "Build beta"
lane :beta do
ionic(
platform: 'android',
#prod: true,
release: true,
Perhaps the master
branch is broken, so I just wanted to let you know before cutting a release. I created a fork and I got this when running the fastlane command as
ionic(
platform: 'ios',
type: 'adhoc'
)
So we get this stack trace
[12:58:11]: fastlane finished with errors
|
| Looking for related GitHub issues on fastlane/fastlane...
|
| Found no similar issues. To create a new issue, please visit:
| https://github.com/fastlane/fastlane/issues/new
| Run `fastlane env` to append the fastlane environment to your issue
| bundler: failed to load command: fastlane (/Users/semaphore/loadup-driver-ionic/vendor/bundle/ruby/2.5.0/bin/fastlane)
| NoMethodError: [!] undefined method `shellescape' for false:FalseClass
| /Users/semaphore/loadup-driver-ionic/vendor/bundle/ruby/2.5.0/bundler/gems/fastlane-plugin-ionic-45ebb637570f/lib/fastlane/plugin/ionic/actions/ionic_action.rb:45:in `block in get_platform_args'
| /Users/semaphore/loadup-driver-ionic/vendor/bundle/ruby/2.5.0/bundler/gems/fastlane-plugin-ionic-45ebb637570f/lib/fastlane/plugin/ionic/actions/ionic_action.rb:32:in `each'
| /Users/semaphore/loadup-driver-ionic/vendor/bundle/ruby/2.5.0/bundler/gems/fastlane-plugin-ionic-45ebb637570f/lib/fastlane/plugin/ionic/actions/ionic_action.rb:32:in `get_platform_args'
| /Users/semaphore/loadup-driver-ionic/vendor/bundle/ruby/2.5.0/bundler/gems/fastlane-plugin-ionic-45ebb637570f/lib/fastlane/plugin/ionic/actions/ionic_action.rb:58:in `get_android_args'
| /Users/semaphore/loadup-driver-ionic/vendor/bundle/ruby/2.5.0/bundler/gems/fastlane-plugin-ionic-45ebb637570f/lib/fastlane/plugin/ionic/actions/ionic_action.rb:122:in `build'
| /Users/semaphore/loadup-driver-ionic/vendor/bundle/ruby/2.5.0/bundler/gems/fastlane-plugin-ionic-45ebb637570f/lib/fastlane/plugin/ionic/actions/ionic_action.rb:163:in `run'
| /Users/semaphore/loadup-driver-ionic/vendor/bundle/ruby/2.5.0/gems/fastlane-2.125.2/fastlane/lib/fastlane/runner.rb:256:in `block (2 levels) in execute_action'
| /Users/semaphore/loadup-driver-ionic/vendor/bundle/ruby/2.5.0/gems/fastlane-2.125.2/fastlane/lib/fastlane/actions/actions_helper.rb:50:in `execute_action'
| /Users/semaphore/loadup-driver-ionic/vendor/bundle/ruby/2.5.0/gems/fastlane-2.125.2/fastlane/lib/fastlane/runner.rb:235:in `block in execute_action'
| /Users/semaphore/loadup-driver-ionic/vendor/bundle/ruby/2.5.0/gems/fastlane-2.125.2/fastlane/lib/fastlane/runner.rb:227:in `chdir'
| /Users/semaphore/loadup-driver-ionic/vendor/bundle/ruby/2.5.0/gems/fastlane-2.125.2/fastlane/lib/fastlane/runner.rb:227:in `execute_action'
| /Users/semaphore/loadup-driver-ionic/vendor/bundle/ruby/2.5.0/gems/fastlane-2.125.2/fastlane/lib/fastlane/runner.rb:157:in `trigger_action_by_name'
| /Users/semaphore/loadup-driver-ionic/vendor/bundle/ruby/2.5.0/gems/fastlane-2.125.2/fastlane/lib/fastlane/fast_file.rb:154:in `method_missing'
| Fastfile:32:in `block (2 levels) in parsing_binding'
| /Users/semaphore/loadup-driver-ionic/vendor/bundle/ruby/2.5.0/gems/fastlane-2.125.2/fastlane/lib/fastlane/lane.rb:33:in `call'
| /Users/semaphore/loadup-driver-ionic/vendor/bundle/ruby/2.5.0/gems/fastlane-2.125.2/fastlane/lib/fastlane/runner.rb:49:in `block in execute'
| /Users/semaphore/loadup-driver-ionic/vendor/bundle/ruby/2.5.0/gems/fastlane-2.125.2/fastlane/lib/fastlane/runner.rb:45:in `chdir'
| /Users/semaphore/loadup-driver-ionic/vendor/bundle/ruby/2.5.0/gems/fastlane-2.125.2/fastlane/lib/fastlane/runner.rb:45:in `execute'
| /Users/semaphore/loadup-driver-ionic/vendor/bundle/ruby/2.5.0/gems/fastlane-2.125.2/fastlane/lib/fastlane/lane_manager.rb:56:in `cruise_lane'
| /Users/semaphore/loadup-driver-ionic/vendor/bundle/ruby/2.5.0/gems/fastlane-2.125.2/fastlane/lib/fastlane/command_line_handler.rb:36:in `handle'
| /Users/semaphore/loadup-driver-ionic/vendor/bundle/ruby/2.5.0/gems/fastlane-2.125.2/fastlane/lib/fastlane/commands_generator.rb:108:in `block (2 levels) in run'
| /Users/semaphore/loadup-driver-ionic/vendor/bundle/ruby/2.5.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:178:in `call'
| /Users/semaphore/loadup-driver-ionic/vendor/bundle/ruby/2.5.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:153:in `run'
| /Users/semaphore/loadup-driver-ionic/vendor/bundle/ruby/2.5.0/gems/commander-fastlane-4.4.6/lib/commander/runner.rb:476:in `run_active_command'
| /Users/semaphore/loadup-driver-ionic/vendor/bundle/ruby/2.5.0/gems/fastlane-2.125.2/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:76:in `run!'
| /Users/semaphore/loadup-driver-ionic/vendor/bundle/ruby/2.5.0/gems/commander-fastlane-4.4.6/lib/commander/delegates.rb:15:in `run!'
| /Users/semaphore/loadup-driver-ionic/vendor/bundle/ruby/2.5.0/gems/fastlane-2.125.2/fastlane/lib/fastlane/commands_generator.rb:333:in `run'
| /Users/semaphore/loadup-driver-ionic/vendor/bundle/ruby/2.5.0/gems/fastlane-2.125.2/fastlane/lib/fastlane/commands_generator.rb:41:in `start'
| /Users/semaphore/loadup-driver-ionic/vendor/bundle/ruby/2.5.0/gems/fastlane-2.125.2/fastlane/lib/fastlane/cli_tools_distributor.rb:119:in `take_off'
| /Users/semaphore/loadup-driver-ionic/vendor/bundle/ruby/2.5.0/gems/fastlane-2.125.2/bin/fastlane:23:in `<top (required)>'
| /Users/semaphore/loadup-driver-ionic/vendor/bundle/ruby/2.5.0/bin/fastlane:23:in `load'
| /Users/semaphore/loadup-driver-ionic/vendor/bundle/ruby/2.5.0/bin/fastlane:23:in `<top (required)>'
| exit code: 1 duration: 3s
It's failing here. We don't set any fetch policy but the params is cordovaNoFetch
with a value of false
. This shouldn't really execute but false
to string is actually "false"
, which is truthy. However, you can't do false.shellescape
, so it errors.
This would maybe clash with the cordova plugin - or maybe not. Have to see what I do with these.
The Fastlane Cordova plugin that this is based on already supports some/all of the parameters. As ionic
doesn't 1:1 have the same parameters, I have to check what does and what does not work.
https://ionicframework.com/docs/cli/cordova/build/
https://cordova.apache.org/docs/en/7.x/reference/cordova-cli/index.html#cordova-build-command
https://github.com/bamlab/fastlane-plugin-cordova#plugin-api
I'm getting a build error for my android build that has something to do with a gradle configuration. The troubling thing about this is that the plugin doesn't report it.
begin
ionic(
platform: 'android',
keystore_path: ENV['ANDROID_KEYSTORE_PATH'],
keystore_alias: ENV['ANDROID_KEYSTORE_ALIAS'],
keystore_password: ENV['ANDROID_KEYSTORE_PASSWORD'],
)
rescue
puts "Ionic build failed"
end
When this runs I get an error
[14:03:45]: ▸ BUILD FAILED in 2s
[14:03:45]: ▸ at ChildProcess.whenDone (/path/platforms/android/cordova/node_modules/cordova-common/src/superspawn.js:169:23)
[14:03:45]: ▸ at emitTwo (events.js:126:13)
[14:03:46]: ▸ at ChildProcess.emit (events.js:214:7)
[14:03:46]: ▸ at maybeClose (internal/child_process.js:925:16)
[14:03:46]: ▸ at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
When that build error happens, the "Ionic build failed" message is never displayed. So I'm assuming the rescue block is never run. How do I account for a build failure and stop executing my lane?
We have --packageType
(valid values: development, enterprise, ad-hoc, app-store) that "will determine what type of build is generated by Xcode".
And we have --release
and --debug
which defines the general build type.
--release
with development
?--debug
with anything but development
?--debug => development
and --release => app-store
be a sensible default here?Re 1) Not really.
Re 2) Not really.
Re 3) Maybe. debug=development yes, release could also be ad-hoc depending on usecase.
So at least in this plugin here we could couple these together with useful defaults.
To investigate: Is it maybe a problem when we always add a packageType
?
For debugging parameters and similar stuff it would be nice to have a "dry run" option.
cordova plugin is default release, this should better be default development so it closer matches the normal CLI.
Hi,
we migrated our app from cordova to capacitor, but this plugin still runs cordova.
Is there any way to run the capacitor build command instead?
ionic(
team_id: options[:team_id],
platform: 'ios',
prod: true,
release: true
)
seems like it produces this command:
ionic cordova prepare ios --release --device --prod
How do I get it to execute with: IONIC_GENERATE_SOURCE_MAP=true
which forces ionic to generate sourcemaps.
Currently the installed plugin is reported as "0.3.4" which is clearly wrong.
See #45
Would be added here: https://github.com/ionic-zone/fastlane-plugin-ionic/blob/fec09a28722e9657c5dbbfb1e963fc458bf7dde4/lib/fastlane/plugin/ionic/actions/ionic_action.rb#L80-L89
Probably best rewrite so command gets build piece by piece, then executed.
Hello, I'd like to request to add the option to add the --quiet option to the ionic commands. The ionic cordova compile ios commands is generating many 1000s of lines and crashed the gitlab CI runner due to huge logs of the job.
Thank you.
If a command fails, verbose
would be useful to see the details:
[ERROR] An error occurred while running subprocess cordova.
cordova compile ios --release --device --packageType=app-store --developmentTeam... exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
See README: This fastlane plugin helps you build your Ionic Cordova project via the ionic CLI and its ionic cordova build command.
This is a problem because cordova's build.json
is ignored by those two commands which has uses, like setting build flags:
apache/cordova-ios#407
platform
is available via lane context, so no need to specify it.
Example crashlytics action:
https://github.com/fastlane/fastlane/blob/master/fastlane/lib/fastlane/actions/crashlytics.rb#L65-L73
Hello,
I'm trying to generate an apk to upload it to the beta of Google Play, but the plugin is not signing it. What can happen?
I'm using version 0.0.3.
This is my config:
lane :deployBeta do
ionic(
platform: 'android',
release: true,
prod: true,
device: false,
keystore_path: './keystore.jks',
key_password: '*********',
keystore_alias: 'release',
keystore_password: '*********',
build_number: 3,
cordova_prepare: true
)
supply(
track: 'beta',
apk: ENV['CORDOVA_ANDROID_RELEASE_BUILD_PATH']
)
end
Thank you
Option | Description |
---|---|
--prod | Build the application for production |
Other projects that are wrappers for CLIs that do have tests:
https://github.com/getsentry/fastlane-plugin-sentry/tree/master/spec
https://github.com/joshrlesch/fastlane-plugin-yarn/tree/master/spec
https://github.com/dyang/verify_ipa/tree/master/spec
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.