microsoft / vsts-cloudfoundry Goto Github PK
View Code? Open in Web Editor NEWAzure DevOps Extension for Cloud Foundry
License: MIT License
Azure DevOps Extension for Cloud Foundry
License: MIT License
Currently the Cloud Foundry task in VSTS does not have a means for the user to specify the Private Docker Registry Username (although we can use the manifest to specify that) and the private Docker Registry Password when pushing apps.
More information can be found at: https://docs.cloudfoundry.org/devguide/deploy-apps/push-docker.html#private-repo
We are having to get around this by creating a custom VSTS Agent image with the CLI Installed. It however, needs us to do a lot of work to enable many of the other great features this task offers out of the box.
Currently, the task forces a choice between using a manifest and providing cmdline arguments manually. However, the CF CLI itself allows for both, with cmdline arguments overriding conflicting manifest values. Ideally, the VSTS task would mirror that behavior.
https://docs.cloudfoundry.org/devguide/deploy-apps/manifest.html#precedence
Add a task to support installing the Cloud Foundery cli on to the build agent.
We have a VSTS on a server which has around 4 agents. When this task logs in to CF it uses the location "/.cf/config.json" as a semaphore to persist the session. If I login from an agent and start the release and parallelly if another release is going on, they both touch the same semaphore and results in conflict.
The Cloud Foundry CLI task does not allow passing (global) options to the cf command, which makes it harder to debug stuff. For instance, we want to see the results of cf CF_TRACE=true bgd
, but I see no way to provide this CF_TRACE=true
flag.
Is it possible to add this to a future version of the Cloud Foundry CLI plugin?
Please add documentation on how to use this extension with Azure Pipelines YAML since this is the preferred way now and the classic GUI is being deprecated.
Currently it is only supported in build definitions.
I can use the Install Cloud Foundry to download CLI 7.0.1, but then I get this :
##[error]Error: ENOENT: no such file or directory, stat 'd:\builds\agent1\_temp\........\cf.exe'
that is because the executable is now called cf7.exe
If I mark the "Start on Deploy" option, CF command is issued with --no-start
If I unmarket the "Start on Deploy" option, CF command is issued without --no-start.
It may not be necessary on certain platforms to use the -u and -p parameters when using a one-time-passcode. Using an explicit option (or maybe when the username is not provided in the service), the -u and -p flags should not be included in the cf login command line.
// Extension\CloudFoundry\cloudfoundry.ts
if (tl.getBoolInput('useRoute')) {
let domainOption: string = tl.getInput('domainOptions');
if (domainOption === 'custom') {
if (tl.getInput('domain')) {
cfPush.arg('-d');
cfPush.arg(tl.getInput('domain'));
}
}
if (tl.getInput('host')) {
cfPush.arg('--hostname');
cfPush.arg(tl.getInput('host'));
}
} else {
cfPush.arg('--no-route');
}
There is no option for "domainOptions" so it is defaulted to empty srtring. check should be removed
Randomly we see this error message while doing a CF Push using the plug-in with VSTS:
2018-01-31T21:25:36.2968541Z -----> Publish dotnet
2018-01-31T21:25:36.5978540Z System.IndexOutOfRangeException: Index was outside the bounds of the array.
2018-01-31T21:25:36.5988228Z at System.String.get_Chars(Int32 index)
2018-01-31T21:25:36.5988228Z at Microsoft.DotNet.Cli.CommandLine.StringExtensions.HasPrefix(String arg)
2018-01-31T21:25:36.5988228Z at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable`1 source, Int32& length)
2018-01-31T21:25:36.5988228Z at System.Collections.Generic.Queue`1..ctor(IEnumerable`1 collection)
2018-01-31T21:25:36.5988228Z at Microsoft.DotNet.Cli.CommandLine.Parser.Parse(IReadOnlyCollection`1 rawArgs, Boolean isProgressive)
2018-01-31T21:25:36.5988228Z at Microsoft.DotNet.Cli.CommandLine.Parser.Parse(String[] args)
2018-01-31T21:25:36.5988228Z at Microsoft.DotNet.Cli.ParserExtensions.ParseFrom(Parser parser, String context, String[] args)
2018-01-31T21:25:36.5988228Z at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, ITelemetry telemetryClient)
2018-01-31T21:25:36.6228455Z at Microsoft.DotNet.Cli.CommandLine.StringExtensions.<Lex>d__7.MoveNext()
2018-01-31T21:25:36.6228455Z at Microsoft.DotNet.Cli.Program.Main(String[] args)
2018-01-31T21:25:36.6228455Z [31;1m**ERROR**[0m Unable to run dotnet publish: exit status 1
2018-01-31T21:25:36.6228455Z Failed to compile droplet: Failed to run finalize script: exit status 12
2018-01-31T21:25:36.6228455Z Exit status 223
2018-01-31T21:25:36.6228455Z Staging failed: STG: Exited with status 223
2018-01-31T21:25:36.2968541Z -----> Publish dotnet
2018-01-31T21:25:36.5978540Z System.IndexOutOfRangeException: Index was outside the bounds of the array.
2018-01-31T21:25:36.5988228Z at System.String.get_Chars(Int32 index)
2018-01-31T21:25:36.5988228Z at Microsoft.DotNet.Cli.CommandLine.StringExtensions.HasPrefix(String arg)
2018-01-31T21:25:36.5988228Z at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable`1 source, Int32& length)
2018-01-31T21:25:36.5988228Z at System.Collections.Generic.Queue`1..ctor(IEnumerable`1 collection)
2018-01-31T21:25:36.5988228Z at Microsoft.DotNet.Cli.CommandLine.Parser.Parse(IReadOnlyCollection`1 rawArgs, Boolean isProgressive)
2018-01-31T21:25:36.5988228Z at Microsoft.DotNet.Cli.CommandLine.Parser.Parse(String[] args)
2018-01-31T21:25:36.5988228Z at Microsoft.DotNet.Cli.ParserExtensions.ParseFrom(Parser parser, String context, String[] args)
2018-01-31T21:25:36.5988228Z at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, ITelemetry telemetryClient)
2018-01-31T21:25:36.6228455Z at Microsoft.DotNet.Cli.CommandLine.StringExtensions.<Lex>d__7.MoveNext()
2018-01-31T21:25:36.6228455Z at Microsoft.DotNet.Cli.Program.Main(String[] args)
2018-01-31T21:25:36.6228455Z [31;1m**ERROR**[0m Unable to run dotnet publish: exit status 1
2018-01-31T21:25:36.6228455Z Failed to compile droplet: Failed to run finalize script: exit status 12
2018-01-31T21:25:36.6228455Z Exit status 223
2018-01-31T21:25:36.6228455Z Staging failed: STG: Exited with status 223
If we run a custom powershell script instead the just does a custom CF Push through the CLI it works. Would this be a bug in the plugin or some other issue? Pivotal support referred me here.
Thank you very much for your help.
Use the task Cloud Foundry in a pipeline, and set it to use a service connection that has an incorrect password. When running the pipeline, the following output is generated:
==============================================================================
Task : Cloud Foundry
Description : Push your applications to Cloud Foundry
Version : 1.147.0
Author : Microsoft
Help :
==============================================================================
93342fdf-b570-48ea-9143-798dc8cee68f exists true
[command]/usr/bin/cf login -a https://api.pcf.company.com/ -u *** -p *** -o company -s my-space
API endpoint: https://api.pcf.company.com/
Authenticating...
Credentials were rejected, please try again.
Password> stty: 'standard input': Inappropriate ioctl for device
The task stops running immediately after the login has been rejected, and fails with a clear error message.
cf login
prompts for a password on standard input, and the task waits forever, blocking the pipeline and the agent it uses.
According to this comment, cf login
should not be used, but cf api
and cf auth
instead;
Please use
cf api
andcf auth
for non-interactive mode scripts.cf login
orchestrates those two (andcf target
) for a more (beginning) user friendly experience with prompting.
When pushing an update to an existing app using manual method there is no option to leave the current routes intact. You either have to specify the route, or all the existing routes are unbound.
All the other options such as memory etc are ignored if there is no value. Maybe this could be done for the domain field as well.
e.g. Use Route is set to true, but then Domain can be left blank. This would then not pass either of the -d or --no-route parameters to the push command
The README.md is already one year old. What is the current status of this
(...) We are looking into installing Cloud Foundry CLI on the hosted build machines or packaging it with the extension for the next release. (...)
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.