Repo based Android app not updated through Phonegap API, however, "Update code" button on site works - phonegap-build

Problem:
Issuing a PUT request to "api/v1/apps/:id" with a payload of "{"pull":"true"}" says it was successful, however, when I check the APK it is using the previous build. It is NOT pulling the latest from github. I can load and run the APK, it is just not the latest code.
When I login to the Adobe PhoneGap Build site and click the "Update code" button it DOES pull the latest from github and builds the app. The APK also loads and runs fine.
Questions:
Do I need to bump a version flag somewhere in order for the API to pull latest? If so, what file(s) and what flags do I need to update?
Is there an API call or payload that I can send that will trigger a pull from github?
Is the update api call supposed to pull the latest from github?
Notes:
I am using Phonegap version 6.3.4
I followed the steps outlined on the PhoneGap Build Docs
I am using the "cli project format"
Currently only targeting Android
I am pulling from master branch on github, not from a tag
I have "version="0.0.1"" and "android-versionCode="10"" as attributes in the the widget element of my config.xml
Thank you for any help you can provide.
I also posted this question on the Phonegap Build forum feel free to answer it in either location.

Related

How to compare application version to its github releases?

So i've build an AwesomeApplication.exe with visual studio winforms,
it has a public repository with releases.
I'd like to add update checker to the application (notifying the user that new release is available for download).
I can get latest release info with github api:
https://developer.github.com/v3/repos/releases/#get-the-latest-release
But the application doesn't "know" which github release tag or version it is,
unless i'd manually type that in the application settings (before building it)? and then using the api, compare that hard coded version string with github release tag. That would be possible, but requires bit too much manual work.. wondering that are there other options?
my publish process is:
build app in visual studio
manually zip the exe
manually add release and upload zip to the repository
Solution, modified version of #VonC link:
Add visual studio prebuild event to fetch current latest release tag (my prebuild script that launches powershell to access github api: https://gist.github.com/unitycoder/c4c5330ad3494ee5b2344a0a86324a3d )
The fetched tag is saved in the project folder as PreviousVersion.txt, which is set as a EmbeddedResource in the project (with CopyToOutput set to "Do Not Copy", as i didnt want extra files to the folder)
When user clicks "Check Updates" button in the application, ill read the embedded PreviousVersion.txt and compare it with currently available github release tag using https://developer.github.com/v3/repos/releases/#get-the-latest-release
If the strings are different, that means user must be using older version
Small update on that:
Actually with that checkup above, the string would be always different, since at compile time the current latest release is, lets say 1.10, while after compile and adding new release, its already 1.11 (and compile time string is the old 1.10).
So temporary fix for that is to float or int parse your version tag number,
compare if its larger by 0.1 or 1 for example, then show update available.
You can embed the current version in your exe: see "Embed git commit hash in a .Net dll".
That way, your Application can compare its internal version (based on git describe --long, which includes the closest tag) with the version from the latest release (which is based on a tag as well)

How to include commit messages as changelog in HockeyApp?

It would be useful for us to include what commits are included in the latest version compared to the previously uploaded one.
We use TeamCity to build and a step is to upload to HockeyApp, however I'm not sure how we can add the mentioned part.
You can use the TeamCity REST API to get the same information you'll find on the Changes UI tab in TeamCity. Parse these changes out however you like, and then you can include them in your HockeyApp release notes when you do the upload.

How to set Xcode Bot to run "on commit" for all branches of remote repository?

When creating an Xcode Bot in Xcode 6, it is linked to the current active branch in Xcode source control. There seems to be no supported way to change branches after creating the bot.
Xcode Service: Select Git Branch
I have set my bot to run "on commit". I find when I commit to that branch the bot immediately integrates the project. But when I commit to a different branch, the bot takes no action.
Ideally I would like a single Xcode Bot to look at all branches of the remote repository. When there is a new commit to any branch the bot and its tests should be run.
I do not want to create a new bot for each branch. Is there a solution?
Bug Report:
rdar://20154198
Developer Forum:
https://devforums.apple.com/thread/263490
There is also https://github.com/modcloth-labs/XBotBuilder developed by the same creators of the tool #jeremy-fox. It will create a bot per Pull Request, and re-run the bot for every addition in the PR.
It seems to be in early stages and without documentation but the code seems to be well organized so wouldn't be hard to get it to work or change it's behavior to do what you want.
For the moment we use a tool called Buildasaur (https://github.com/czechboy0/Buildasaur) to improve our CI-workflow. It's written in swift and helps to build/run/ delete bots automatically for one github repository, for example whenever a pullrequest was created or newer commits were pushed to the pullrequest. Actually it works fine on our Xcode Server 6.3. Unfortunately it works for just one repository at the same time. :-(
We also hope, that Apple will implement such features soon.
Apple response from the dev forum:
This isn't something Xcode Server supports. You might be able to craft a pre-integration trigger to switch branches in the working copy and invoke seperate xcodebuild invocations, but the results reported in the UI will only be for the Xcode Server builds (the build that XCS runs after your trigger executes).
https://devforums.apple.com/thread/263490
rdar://20154198
This is not currently possible with Xcode Bots (current versions are Xcode Server 4.0.3 & Xcode 6.2). A Bot will only track the specific branch form which it was created.
This was possible in the past on Xcode Server 3 and Xcode 5 using https://github.com/modcloth-labs/github-xcode-bot-builder but this project hasn't been updated to work with the latest version of Xcode Server and Xcode.
I'm also really hoping Apple introduces this feature soon, it would be great to be able to have a single bot monitoring a repo for new Pull Requests and when found run an integration against that PR. For now though, it's just not possible.
Update 3/19/2015:
As #Gus reports in another answer, there is a new Mac OS X based project that can help with ad hoc bot creation for feature branches/PR's called XBotBuilder - https://github.com/modcloth-labs/XBotBuilder. It should be worth noting that currently, this project only works with one github repo. So, if you have more than one repo you'd like to monitor for PR's, this is still not currently possible unless you have multiple machines each running a different instance of XBotBuilder and targeting a different repo.

Use Github Release model to host application's Sparkle appcast

Can Github's Release feature be used to host an application's Sparkle appcast (RSS feed)? The goal is to eliminate the need to have another server involved to support application updates.
The challenge would be that the file's URL (referenced by an Xcode project's SUFeedURL property) wouldn't be consistent across versions:
https://github.com/user/foobar/releases/tag/v0.1.0
https://github.com/user/foobar/releases/tag/v0.2.0
Is there a way to do this?
While I haven't yet found a way to integrate the appcast directly with GitHub Releases, I've been using GitHub Pages to host the appcast to avoid the need for another server, as you said. It also looks like releases.io might help with creating a release notes link for Sparkle from the GitHub Releases.

Adding an iPhone Project to an existing Github Project

I'm working on a bit of documentation code for an API project.
Someone else already has an existing github account where some people have already submitted a few projects. I will call it {http://github.com/monkeyhouse/}
I've created a project in Xcode (iPhone app), and have that stored under my normal Xcode git, which is backed up everything is fine.
What is the right bit of git foo that I need to put Xcode Project into
{http://github.com/monkeyhouse/examples/iPhoneClient}
I've tried creating a symbolic link to the project on my machine and that didn't work.
Following is a common way to do what you're wanting to do on Github:
Fork http://github.com/monkeyhouse/ under your own Github account.
Clone your forked version of the repo to your development machine.
Make the modifications you want directly to your cloned repo (e.g., don't use a symlink), adding examples/iPhoneClient to the local repo, and commit the changes.
Push your changes to your public Github fork of http://github.com/monkeyhouse/.
Submit a pull request with http://github.com/monkeyhouse/ to have them bring in the changes you pushed to your forked version if they're happy with them.

Resources