fastlane get current testflight train - fastlane

using fastlane's spaceship, i'd like to:
get the train version of the binary that is live (or nil)
get the latest train version in testflight... (or nil)
if latest testflight train is nil, then return 0.0.1
if live train equals latest testflight train, then return (live train + 0.0.1)
otherwise return the latest testflight train
I'm stuck figuring out how to query for the "train version" of the build of the live version...

version = app.live_version
latest_version = version.raw_data["preReleaseBuildTrainVersionString"]
Will give you the train version string of the live build

Related

How can I make sure that builds are using v14.x iOS/tvOS simulators?

Some of the builds in our environment are failing because the builds are using a 13.X iOS/tvOS simulator and for some reason that causes issues. I made changes to our Fastfile so that the builds use a 14.2 simulator instead and now the builds are succeeding.
Here are the changes I made to the fast file.
First, I declared a dict:
XCODE_DESTINATION = {
iphoneos: "generic/platform=iOS",
iphonesimulator: "platform=iOS Simulator,OS=14.2,name=iPhone 11 Pro Max",
appletvos: "generic/platform=tvOS",
appletvsimulator: "platform=tvOS Simulator,OS=14.2,name=Apple TV 4K"
}
Then, in the run_tests lane for both iOS and tvOS, I reference the iphonesimulator and the appletvsimulator:
run_tests(
destination: XCODE_DESTINATION[:iphonesimulator],
workspace: WORKSPACE_NAME,
scheme: options[:scheme_tests]
)
run_tests(
destination: XCODE_DESTINATION[:appletvsimulator],
workspace: WORKSPACE_NAME,
scheme: options[:scheme_tests]
)
Even though this solution solves the problem, I don't really want the XCODE_DESTINATION dict to have to specifically reference an OS version and a specific device.
Is there a way I can configure this Fastfile so that it runs the tests only if a 14.X simulator is present within XCode without having to specifically indicate that in the dict?
Thank you!
Currently fastlane does not support this, so feel free to create an issue ->
https://github.com/fastlane/fastlane/issues
But you can specify the simulators and versions in the run_tests:
run_tests(
devices: ['iPhone 11 Pro Max (14.2)'],
workspace: WORKSPACE_NAME,
scheme: options[:scheme_tests],
ensure_devices_found: true
)
Additionally you can set ensure_devices_found to true, so if the specified simulator(s) not found, tests will fail.

NuGet Packager with version using build number, adding -beta

My goal is to deploy NuGet packages (to in-house Nuget server) that auto-increment the version based on date and last Rev, and include a -beta tag.
I am using VSTS to build and package using cake, with a build number format of $(BuildDefinitionName)_2.0.$(Date:yyMMdd)$(Rev:.r).
I have a .nuspec manifest file that specifies: $version$, and a NuGet Packager as such:
This works great. But now, I want to have the option of a NuGet packager that produces a package that is tagged as beta, and therefor show in VS NuGet Package Manager as pre-release. I can do this if I hard code the version number with "-beta" appended in the NuGet Packager:
But how can I include the -beta tag AND the the build number? I think I need to include a variable in NuGet Arguments that will return $(BuildDefinitionName)_2.0.$(Date:yyMMdd)$(Rev:.r) plus "-beta", but I'm not sure how.
I tried creating a variable (under the Variables tab) with the Build Number Format as the value, then referencing the variable in NuGet Arguments (-Version theVariable), but received as error that the variable is not supported.
I may be going about this all wrong, however my searches have not turned up any hints on how to auto-increment versions from the date, and include a -beta tag.
NuGet Packager with version using build number, adding -beta
I could reproduce your scenario on my side. In my opinion, Nuget pack task with build number doesn't support character or numbers. You may check this task:
case "byBuildNumber":
tl.debug("Getting version number from build number")
if(tl.getVariable("SYSTEM_HOSTTYPE") === "release")
{
tl.setResult(tl.TaskResult.Failed, tl.loc("Error_AutomaticallyVersionReleases"));
return;
}
let buildNumber: string = tl.getVariable("BUILD_BUILDNUMBER");
tl.debug(`Build number: ${buildNumber}`);
let versionRegex = /\d+\.\d+\.\d+(?:\.\d+)?/;
let versionMatches = buildNumber.match(versionRegex);
if (!versionMatches)
{
tl.setResult(tl.TaskResult.Failed, tl.loc("Error_NoVersionFoundInBuildNumber"));
return;
}
if (versionMatches.length > 1)
{
tl.warning(tl.loc("Warning_MoreThanOneVersionInBuildNumber"))
}
version = versionMatches[0];
break;
That is the reason why the field $(BuildDefinitionName) and beta could not appear in our package version when we use them in our build number.
If we specify the nuget version in the nuget arguments, but this argument could not parsing predefined variables, like $(Rev:.r).
The limitations of these two situations have caused your current issue.
The workaround to resolve this issue, is using nuget custom task with parameter -version $(Build.BuildNumber) and move the field $(BuildDefinitionName) from our Build number format, otherwise, we still receive the error the version is invalid.
So, you nuget custom looks like:
And the Build number format:
Now, you can see it works fine:
Note:
You said you using VSTS to build and package using cake, but the images you posted shows that you are using NuGet Packagertask in TFS 2015. If you are sure using TFS 2015, I am afraid above workaround will not work for you. Because the custom nuget task is not support for TFS 2015.
Hope this helps.

How can I use the bx ml generate-manifest libraries in watson machine learning

I've built a deep learning model that uses for pre-processing purposes a custom library called Augmentor and I would like to include it when running on Watson Machine learning service on the cloud.
For now I am using a workaround in my code which uses pip to install the library:
import pip
def install(package):
if hasattr(pip, 'main'):
pip.main(['install', package])
else:
pip._internal.main(['install', package])
try:
import Augmentor
except:
install("Augmentor")
import Augmentor
I've been looking at the command line interface bx ml and I noticed that there is a command line bx ml generate-manifest libraries which generates libraries.yml:
name: libraries_custom
description: custom libraries for scoring
version: '1.0'
platform:
name: python
versions:
- '3.5'
I would like to know if this is the right why to declare custom libraries required to run my code on WML ?
I can't find any documentation on this anywhere.
As for as, I am aware of you can create custom components using generate-manifest of ibmcloud CLI
bx ml store libraries thepyfuncpackage-0.1.zip library.json
You can find the complete instructions here
If you want to install additional libraries to support your work, you must create a wheel (.whl) file and include this with the .zip file that you submit as part of your training run or experiment. You can then execute them by running the pip install /.whl command.
Complete instructions here
Hope this is helpful

iOS - How to increase the version number with Fastlane?

So I was wondering how to increase the version number or build number with Fastlane tools, so that I don't have to manually change the version.
So the answer to this question where the following two lanes. Keep in mind you need to activate some settings in your project by following this link.
With them I can increase the build number for the current version, or increase the version number and set the build number to 1.
The result will be [ver++] v1.0.0 (1) (you can change the syntax as you please) and it gets automatically committed to git
Build Bump:
lane :buildbump do
version = get_version_number
build = increment_build_number
commit_version_bump(
xcodeproj:"MyProject.xcodeproj",
message: "[ver++] v#{version} (#{build})"
)
end
Version Bump:
lane :versionbump do
version = increment_version_number
build = increment_build_number(build_number: 1)
commit_version_bump(
xcodeproj:"MyProject.xcodeproj",
message: "[ver++] v#{version} (#{build})"
)
end

EventStore build.cmd Errors

Just getting started with JOlivers event store library and having issues with some of the Nuget commands in the build.cmd. here's the log, perhaps you're already aware of the issue but i thought i'd put it up here.
=== COMPILING ===
Compiling / Target: v4.0 / Config: Release
S:\SourceControl\Test Projects\EventStore\bin\nuget\NuGet.targets(6,9): error : Input string was not in a correct format. [S:\SourceControl\Test Projects\EventStore\src\proj\EventStore.Persistence.RavenPersistence\EventStore.Persistence.RavenPersistence.csproj]
S:\SourceControl\Test Projects\EventStore\bin\nuget\NuGet.targets(6,9): error MSB3073: The command ""S:\SourceControl\Test Projects\EventStore\src\..\bin\nuget\nuget.exe" install "S:\SourceControl\Test Projects\EventStore\src\proj\EventStore.Persistence.RavenPersistence\packages.config" -source "" -o "S:\SourceControl\Test Projects\EventStore\src\..\bin"" exited with code 1. [S:\SourceControl\Test Projects\EventStore\src\proj\EventStore.Persistence.RavenPersistence\EventStore.Persistence.RavenPersistence.csproj]
The master branch of EventStore appears to be broken at the moment. The 3.0 branch is in better shape but is also slightly broken. To fix the 3.0 branch so that it builds, you need to upgrade the 1.5 version of nuget.exe to 1.6. The easiest way to do that is to execute \bin\nuget\NuGet.exe update -self in the repository. I already submitted a pull request to JOliver with that change.
(I also submitted a pull request with a few minor fixes for the example project.)