How to use docker android images on drone.io - android

First of all , i am very beginner in this drone and docker stuffs , so please be kind on me. Now this is the scenario
My organisation has a drone server ready and working.
When I log in into the drone server , I can see all my android repositories.
There is repository named "DockerTesting" which I have made just to set up the drone for Android build.(It might confuse you)
I have added an .drone.yml file in top-level repository "DockerTesting"
My .drone.yml looks like this
image: docker.vokalinteractive.com/android:latest
env:
- ORG_GRADLE_PROJECT_ratsUser={{rats_user}}
- ORG_GRADLE_PROJECT_ratsPass={{rats_pass}}
- ANDROID_HOME=/usr/local/android-sdk
script:
- ./gradlew build device
notify:
slack:
webhook_url: https://hooks.slack.com/services/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
channel: docker_android
username: drone
template: >
{{#success build.status}}
{{ build.author }} successfully pushed to {{ build.branch}}. Code was published.
{{else}}
{{ build.author }} broke the build. Code was not published.
<{{system.link_url}}/{{repo.full_name}}/{{build.number}}|{{repo.name}}#{{build.commit}}>
{{/success}}
I wrote this yml file myself using google
I am getting slack notification this is good at least for me
Below is the problem:
In the repository "Docker Testing" I made a syntax error, as a result the build was failed in my local machine(my laptop) in Android Studio.
Now I did git push command to update this repository in my company's server
3 The push was successful (Why?) . It should have failed as I have done a syntax error & also the build was failed in local machine

Related

Fastlane appcenter upload not working, App not found

on a project I setup with fastlane a lane to build an android app and publish it on appcenter.
Here a snippet of the lane, where, for the sake of simplicity, I surround by curly brackets protected data:
lane :buildAndDeploy do
gradle(task: "clean assembleRelease")
appcenter_upload(
app_name: "{myappname}",
api_token: "{token}",
owner_name: "{ownername}",
owner_type: "user",
file: "{filePath}"
)
Everything worked like a charm till two weeks ago, when suddently it stops working. When the lane cruise to the appcenter upload step I receive this from the plugin.
------------------------------
--- Step: appcenter_upload ---
------------------------------
App with name {appname} not found, create one? (y/n)
as indicated in the documentation the app name and owner name are populated like this:
https://appcenter.ms/users/{ownername}/apps/{appname}
Any idea of what could have happened in the past two weeks? I didn't change anything both on the Fastfile and the Appcenter project.
Finally I discover where was the issue.
Running this command with appcenter cli
appcenter apps list --token <MY_TOKEN> --debug
I found out that the token I was using didn't belong to the owner of the project, instead it belonged to a different user who has been removed from the project.
Adding a new API token resolved the issue.

amplify init fails constantly

I don't know whats really wrong with my amplify. I run amplify init and get this error message. I have downloaded my amplify cli using npm and have successfully run 'amplify configure'.
init failed
InvalidSignatureException: The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.
The Canonical String for this request should have been
'POST
/apps
host:amplify.ap-south-1.amazonaws.com
x-amz-content-sha256:79ec4b759220a7b1d454721bb2c7e1350dccbd691853e5ed1b3c92bec21dbc29
x-amz-date:20210121T154050Z
host;x-amz-content-sha256;x-amz-date
79ec4b759220a7b1d454721bb2c7e1350dccbd691853e5ed1b3c92bec21dbc29'
The String-to-Sign should have been
'AWS4-HMAC-SHA256
20210121T154050Z
20210121/ap-south-1/amplify/aws4_request
b150344845c2c575fd957d63172173a367f2bacf0e817764a02e5b20d03c3811'
Okay, so I finally found out what was bugging me for last three days. A whitespace ( ).
Yes!
I had my folder inside the user with a whitespace in it, as in "First Last". Instead what I should have done is changed my folder name inside my C:\Users\First Last to C:\Users\FirstLast before starting, and then try to install my amplify CLI using the command curl -sL https://aws-amplify.github.io/amplify-cli/install-win -o install.cmd && install.cmd and proceed as mentioned in the documentation here.
To change the name of the User folder in windows 10, I watched this great YT! video
On Mac:
I was also getting the same error while using the aws amplify CLI tool in my nodejs project.
Like #miraquee noted above about the issue being a white space. I suspected that I also had the same issue. What I did to start clean was:
Delete the local .aws folder in my home folder on mac to start clean
rm -rf ~/.aws/
Ran amplify init again. This time when reaching the step where it asks you to create an IAM user, which subsequently takes opens your web browser to finish the creation of the new IAM user, I was very careful about copying in the Access Key Id and Secret Access Key
This time when I went through the flow in the CLI it worked.
If you want to see a video of these steps, checkout this YouTube video built by one of the engineers on the AWS amplify team
Youtube video link: https://www.youtube.com/watch?v=fWbM5DLh25U

Cant push into github from android studio

I can add my projects to one github account but with another account i can't. I have followed this website for GitHub and worked fine: https://www.londonappdeveloper.com/how-to-use-git-hub-with-android-studio/#comment-32683
Steps are: 1. create a new git repo. 2. from android studio- VCS> Import into version control> create git repo. 3. In windows root directory of project open bash command and type > git remote add origin https://github.com/xxx/myProject.git 4. then back to android studio and a)project>Git>add b)project>Git>Commit c) project>Git>repository>push
these steps worked fine and I get a successful message using one github account. But with another account i cant do it, i get the erro:
Failed with error: fatal: unable to access 'https://github.com/Rashedul/myProject.git/': The requested URL returned error: 403
Why is this happening and how to solve it?
First you should set username and password to access the URL and to login , set Authentication first.
git remote set-url origin https://yourusername#github.com/user/repo.git
Then you'll be asked for a password when trying to git push
This is on the http authentication format. You could set a password also:
https://youruser:password#github.com/user/repo.git
You should be aware that if you do this, your github password will be stored in plaintext in your .git directory, which is obviously undesirable.

`arc` fails to parse appium.txt file, failing out at the first line

I'm trying to set up a local test rig for Appium before trying some cloud services. I've got the Appium.app running locally and have put together a very small test script in Ruby (using xpath). I'm trying to utilize arc (the Appium Ruby Console) to do some further scripting but am having trouble getting it launched. I've got everything installed (appium_lib, appium_console) and best I can tell it should be working. However, when I run the arc command at the terminal, I get the following error:
Failed to match sequence (ALL_SPACE (TABLE / TABLE_ARRAY / KEY_VALUE / COMMENT_LINE){0, } ALL_SPACE) at line 1 char 1.
`- Don't know what to do with "[caps]\n " at line 1 char 1.
Here are the contents of my appium.txt as of now.
[caps]
appium-version: '1.0',
platformName: 'Android',
platformVersion: '4.4',
deviceName: 'Nexus_5_API_22_Lollipop',
app: '/Users/justinr/Desktop/Development/TMSampleAndroid-master/app-debug.apk',
appPackage => 'com.marketlytics.calabashtest',
appActivity => 'com.marketlytics.calabashtest.MainActivity'
Thanks a ton in advance for any insight - please let me know if there are other useful files to see.
Running the arc setup android got this working for me (it stumps an appium.txt in the current directory). Still not sure what the problem with my original file was, though - I can't see any key differences.

Jenkins git funny refname

I'm trying to use the git publisher to publish some changes that Jenkins made back to my repo, but getting this weird error:
Pushing HEAD to branch master at repo Android
Opening connection
Counting objects
Finding sources
Writing objects
ERROR: Failed to push branch master to Android
hudson.plugins.git.GitException: funny refname
at org.jenkinsci.plugins.gitclient.JGitAPIImpl$8.execute(JGitAPIImpl.java:1812)
at hudson.plugins.git.GitPublisher.perform(GitPublisher.java:342)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:761)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:721)
at hudson.model.Build$BuildExecution.post2(Build.java:183)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:670)
at hudson.model.Run.execute(Run.java:1776)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:89)
at hudson.model.Executor.run(Executor.java:240)
Build step 'Git Publisher' marked build as failure
Finished: FAILURE
Here are my settings:
repo name: Android
Refspec: {empty -- nothing entered here}
Branches to build: master
Checout to specific local branch: master
Git publisher:
Push only if build succeeds: true
Merge results: true
Force push: true
Branch to push: master
Target remote name: Android
Any ideas?
Additional Info
If I uncheck 'merge results', then it completes successfully, but my nothing is actually pushed to my master branch.
The issue [JENKINS-20393] Git plugin 2.0 JGit implementation does not publish merge result that contains a comment with a message like yours has been resolved "3 days ago". I guess you're not using a version that new.
Description
If I use the jgit implementation in a job which should merge from multiple branches, the merge result is not pushed back to origin. Merge result is pushed if I use the command line implementation in the same job.

Categories

Resources