I am interested in automating my App Deployment. Meaning deploy new versions of App as Beta or Release to App Store and/or Play Store. With this idea I came acrosse fastlane: https://fastlane.tools
But unfortunately Drone CI is not supported officially (https://docs.fastlane.tools/best-practices/continuous-integration/). What is the best to achieve that? Is there sth. else to implement easily?
But unfortunately Drone CI is not supported officially (https://docs.fastlane.tools/best-practices/continuous-integration/). What is the best to achieve that? Is there sth. else to implement easily?
I am not familiar with Fastlane, however, integrations with third party systems and tools are typically provided via plugins, which are community-built and maintained. We have a registry of plugins [1] and tutorials for creating plugins in bash [2] and Go [3], although plugins are language-agnostic.
I would therefore recommend creating a Fastlane plugin, and submitting a pull request to the plugin registry so the broader community can discover and use your plugin.
[1] http://plugins.drone.io/
[2] http://docs.drone.io/creating-custom-plugins-bash/
[3] http://docs.drone.io/creating-custom-plugins-golang/
Yep I saw the Plugins Site and searched for sth. how to easily deploy to App Stores. But I didn’t found anything so probably all App Developers are using Jenkins or Travis since I didn’t found anything about App Automation Deployment with Drone CI.
I will check what the best way would be, just saw this one and thus thought I don’t need to create new things, when available but seems that there is nothing
There are teams using Drone for mobile (see https://github.com/Ronmi/docker-android for example) but I am not aware of any existing plugins to publish to app stores. If you are unable to find a suitable plugin in the registry or on github (not everyone registers their plugins) then you will need to create one (or wait for someone else to create one).
Unless someone can containerize OS X/macOS, building iOS apps in Drone (read: Docker) is out of the question.
For more information, see: https://stackoverflow.com/questions/48078072/building-a-ios-app-with-fastlane-inside-docker
What you can try is something outlined like this, running ssh commands to a mac machine.
Thx for your ideas.
I now handeled it with an own docker image which uses fastlane…
But one thing is open:
I am trying to add the keystore (to sign apk) as a secret file such as described here:
drone secret add \
--repository <registry> \
--image <image> \
--name <name> \
--value <value>
But then I get an error:
ERROR: Error response from daemon: oci runtime error: container_linux.go:262: starting container process caused “process_linux.go:339: container init caused “setenv: invalid argument””
Most probably because it is not just a text file such as a ssh_key rather it is an .jks Keystore file. What is the best way to inject that to the docker container? Of course we can also add the keystore to the repo because the keystore and key inside is password secured but I think this will not be the optimal way.
Please see the following documentation for debugging secrets: http://docs.drone.io/secrets-not-working/
If you continue to experience issues please provide all of the details requested here: http://docs.drone.io/secrets-not-working/#still-having-trouble
the full yaml configuration file:
pipeline:
staging:
when:
branch: feature/droneci
event: push
image: openjdk
secrets: [ google_play_priv_key_id, google_play_priv_key, store_pass, key_pass, keystore ]
commands:
- bash ci/create_required_files.sh
- bash ci/install_env.sh beta
- echo ">> Testing bundler:" && ls /usr/local/rvm/gems/ruby-2.4.1/gems/bundler-1.16.1/
the relevant logs from your build:
not sure where the logs are stored?
The error from build is:
error_outlineERROR: Error response from daemon: oci runtime error: container_linux.go:262: starting container process caused "process_linux.go:339: container init caused \"setenv: invalid argument\""
the results of drone secrets ls :
drone secret ls binando/binando-routing-app
google_play_priv_key
Events: push, tag, deployment, pull_request
Images: <any>
google_play_priv_key_id
Events: push, tag, deployment, pull_request
Images: <any>
store_pass
Events: push, tag, deployment, pull_request
Images: <any>
key_pass
Events: push, tag, deployment, pull_request
Images: <any>
KEYSTORE
Events: push, tag, deployment
Images: <any>
keystore
Events: push, tag, deployment
Images: <any>
the results of drone repo info :
drone repo info binando/binando-routing-app
Owner: binando
Repo: binando-routing-app
Type: git
Config: .drone.yml
Visibility: private
Private: true
Trusted: false
Gated: false
Remote: https://bitbucket.org/binando/binando-routing-app.git
the results of drone build info <build_number>:
drone build info binando/binando-routing-app 102
Number: 102
Status: failure
Event: push
Commit: 6174b31e8269da2afa8527bb34be879c1b2f26ee
Branch: feature/droneci
Ref: refs/heads/feature/droneci
Message: bump
Author: mpfeiffer
setenv: invalid argument
indicates a problem with an environment variable. I presume you have tested and verified you image is valid locally (eg with docker run). This would mean it is likely a problem with a secret, which is being injected as an environment variable.
I am wondering if it possible one of your environment variables was created with a blank value? eg KEY=
instead of KEY=value
. Maybe try process of elimination. Remove a secret, one at a time, from secrets: [ google_play_priv_key_id, google_play_priv_key, store_pass, key_pass, keystore ]
until the container starts.
Yes it is as I mentioned above:
it is dependent if I am including keystore or not.
As mentioned above it is the Keystore file which contains my android signing key (.jks File). I added it with the following command:
drone secret add -repository binando/binando-routing-app -name KEYSTORE -value @/opt/keystore/binando_keystore.jks
And I am thinking that drone has some problems with it but I am not sure what… So what is the best way to include this file?
And I am thinking that drone has some problems with it but I am not sure what… So what is the best way to include this file?
I read this error and I presume it is a problem with Docker not being able to accept an environment variable that contains the contents of binando_keystore.jks. The error is coming from docker, after all. With that being said, there is not enough information available to be sure where the root cause lies.
I can confirm that there are no known issues with drone secrets at this time. Unfortunately there is not much more I can do to assist here, unless I am given simple and complete instructions and sample files to fully reproduce.
Ok here is a minimal example that works for me to reproduce the error.
Create a new repo.
Create the following .drone.yml
in the repo:
pipeline:
master:
when:
event: push
image: openjdk
secrets: [ test_keystore ]
commands:
- echo "nothing"
Create a Keystore with the following command (I think is available when java is installed):
keytool -genkey -v -keystore key-store.jks -keyalg RSA -keysize 2048 -validity 10000 -alias alias -dname "CN=Tester, OU=Tester, O=Tester, L=GER, S=BW, C=GER" -storepass "Tester" -keypass "Tester" -noprompt
Add the Keystore to drone with the following command:
drone secret add -repository <repo-name> -name test_keystore -value @/opt/keystore/key-store.jks
Commit to the master branch of the repo and for me than exact that error occurs.
Can you provide me a sample file generated by keytool that I can use?
Sure, that one is generated by the above command: https://www.dropbox.com/s/wgt1jv5k130l781/key-store.jks?dl=0
Thanks. I will try the file later to see if I can reproduce. In the meantime, since this is a binary file and conversion from binary to string might cause issues, have you considered base64 encoding the key before uploading to drone, and then decoding in one of your pipeline shell scripts?
No, I did not consider but can give you positive feedback: that worked, thanks!