Is there any way, I can retrieve all build variables and loop through it in one of the otterscript I am executing in my pipeline?
I am asking because I am creating a release and build using an API and my build variables varies based on what kind of deployment it is.
I need to grab all the variables dynamically and create a nested json with key = <variable name>, value = <variable value>
Problem is, I don't know variable name ahead of time.
Posts made by andy222
-
Buildmaster - Get all build variables
-
[BM] Getting 500 Error when accessing Global Pipelines
I am getting the following error when accessing global pipeline:
-
[BM] Preventing Build from deploying into further stage based on variable
Hi,
We have a requirement where we want to prevent deploying to stages based on build variables (OR by any other means) if possible.
We have three stages: DEV, UA and PROD.
I am creating a build from TeamCity using Buildmaster API. When creating a build, I am also creating a build variable called "ChannelName". Which contains values of either "alpha", "beta" or "stable".
I want to stop at DEV stage if ChannelName is "alpha". We shouldn't be able to deploy in further stages..
We want to stop at UA stage if channel name is "beta" (So deployment should happen only in DEV and UA only)
channel with "stable" should be able to deploy in all three stages.
Does Buildmaster has something I can achieve it with?OctopusDeploy achieves this with the help of LifeCycles and Channels.
-
RE: [BM] Push Artifact to Buildmaster and start deployment
@apxltd,
Thanks for the response. We tried Git scenario first but Buildmaster couldn't clone our repository as well. Please refer to BM-3921
It couldn't parse Github's auth schemes. There is a problem with LibGitSharp v0.27.2 that you guys have packaged with Buildmaster. You need to update it to 0.29 before even we can clone our github repositories.That was the reason, we decided to push our packages to Proget from TeamCity and then consume that package in Buildmaster and deploy it from there onward.
Since now both scenarios are not working, there is no way we can continue either with CI or CD, unfortunately.
-
RE: [BM] Push Artifact to Buildmaster and start deployment
@atripp,
Sorry for the late response.
I don't know how to configure "directory:Assets"
I know that I successfully connected Proget with Buildmaster as seen below:
When I just use your step, I get the following error:
Here is my package in assets on proget:
And here is my Otter Script as you suggested
ProGet::Download-Asset content/xxxx_temp/TestEnvVariables_Win.zip
(
Source: directory::Assets,
To: C:\temp\TestEnvVariables_Win.zip
);I tried with and without
content/
at front of asset path with no success. Get the same error:EndpointUrl must be specified in either the operation or the referenced secure resource.
We also tried it with your deprecated "Proget Asset Directory" resource type.. and it is also not working.
I really don't know if any of your customers are having so much of a trouble.. but with Buildmaster, I have struggle every step of my evaluation. It is really frustrating.
I am really hopeful that we can continue evaluating buioldmaster further but there are lot of road blocks.
-
RE: [BM] Push Artifact to Buildmaster and start deployment
@atripp,
Thanks for your response.
We have a proget we are using for our nuget and other feeds. I liked an approach to push package from Teamcity to Proget and then Ask Teamcity to create a release in Buildmaster.. Buildmaster then will download an asset from proget and deploy it on target server. Since I wanted to test the Proget/Buioldmaster integration, I created a very simple step to just download a zip file from Proget's Assets and extract it to C:\temp directory on destination server. It is failing on very first step of downloading a package. Here is my setup for a step:
And here is the same otterscript for a step:{ ProGet::Download-Asset temp/TestEnvVariables_Win.zip ( Source: directory::Assets, ApiKey: <API_KEY>, EndpointUrl: <PROGET ENDPOINT>, To: C:\temp ); }
I get following error on this step:
ERROR: Unhandled exception: System.Text.Json.JsonReaderException: '<' is an invalid start of a value. LineNumber: 0 | BytePositionInLine: 0. at System.Text.Json.ThrowHelper.ThrowJsonReaderException(Utf8JsonReader& json, ExceptionResource resource, Byte nextByte, ReadOnlySpan`1 bytes) at System.Text.Json.Utf8JsonReader.ConsumeValue(Byte marker) at System.Text.Json.Utf8JsonReader.ReadFirstToken(Byte first) at System.Text.Json.Utf8JsonReader.ReadSingleSegment() at System.Text.Json.Utf8JsonReader.Read() at System.Text.Json.JsonDocument.Parse(ReadOnlySpan`1 utf8JsonSpan, JsonReaderOptions readerOptions, MetadataDb& database, StackRowStack& stack) at System.Text.Json.JsonDocument.Parse(ReadOnlyMemory`1 utf8Json, JsonReaderOptions readerOptions, Byte[] extraRentedArrayPoolBytes, PooledByteBufferWriter extraPooledByteBufferWriter) at System.Text.Json.JsonDocument.Parse(Stream utf8Json, JsonDocumentOptions options) at Inedo.AssetDirectories.AssetDirectoryItem.ReadFromJson(Stream stream) at Inedo.AssetDirectories.AssetDirectoryClient.GetItemMetadataAsync(String path, Boolean throwIfNotFound, CancellationToken cancellationToken) at Inedo.Extensions.Operations.ProGet.AssetDirectories.RemotableOperations.DownloadAssetAsync(IDownloadAsset input, Func`2 createDirectoryAsync, Func`2 openTargetAsync, Action`2 reportProgress, CancellationToken cancellationToken) in C:\Users\builds\AppData\Local\Temp\InedoAgent\BuildMaster\192.168.44.60\Temp\_E409968\Src\InedoCore\InedoExtension\Operations\ProGet\AssetDirectories\RemotableOperations.cs:line 46 at Inedo.Extensions.Operations.ProGet.AssetDirectories.DownloadAssetJob.ExecuteAsync(CancellationToken cancellationToken) in C:\Users\builds\AppData\Local\Temp\InedoAgent\BuildMaster\192.168.44.60\Temp\_E409968\Src\InedoCore\InedoExtension\Operations\ProGet\AssetDirectories\DownloadAssetJob.cs:line 22 at Inedo.Agents.AgentCommand`1.Inedo.Agents.IAgentCommandWithResponse.ExecuteAsync(Stream responseStream) at Inedo.Agents.AgentCommandDispatcher.ExecuteCommandAsync(AgentCommand command, IClientConnection connection) Cleaning up... Deleting C:\Windows\TEMP\InedoAgent\BuildMaster\10.215.229.216\Temp\_E4295 on SERVER01... C:\Windows\TEMP\InedoAgent\BuildMaster\10.215.229.216\Temp\_E4295 on SERVER01 deleted.
-
[BM] Push Artifact to Buildmaster and start deployment
Hi,
I would like to check and see if I can push the artifact to Buildmaster and trigger a deployment.
The reason, I am asking is because we want to use Buildmaster as only CD and not CI as we have our builds happening in Teamcity and producing artifacts. I just want to push artifact to Buildmaster and trigger a deployment if it exposes an API of some kind.Thanks