Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure that Windows 2019 images have CURL when publishing incrementals #140

Merged
merged 1 commit into from
Apr 9, 2020
Merged

Conversation

jetersen
Copy link
Contributor

@jetersen jetersen commented Apr 8, 2020

This will allow windows to also run deploy

This will allow windows to also run deploy
@jetersen jetersen requested a review from a team April 8, 2020 23:32
@jetersen jetersen mentioned this pull request Apr 8, 2020
@@ -259,11 +259,17 @@ void prepareToPublishIncrementals() {
void maybePublishIncrementals() {
if (isRunningOnJenkinsInfra() && currentBuild.currentResult == 'SUCCESS') {
stage('Deploy') {
node('maven || linux') {
node('maven || linux || windows') {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could potentially drop the label spec if all windows nodes are using 2019 base.

@olblak olblak merged commit 9a5274b into jenkins-infra:master Apr 9, 2020
@olblak
Copy link
Member

olblak commented Apr 9, 2020

If curl.exe is not already available on windows machine, feel free to add on the packer images. Link

@jetersen
Copy link
Contributor Author

jetersen commented Apr 9, 2020

Nah it should already be there, Microsoft put it in :)

https://devblogs.microsoft.com/commandline/tar-and-curl-come-to-windows/

This includes server and even docker images for both server core and nanoserver.

@jetersen jetersen deleted the patch-1 branch April 9, 2020 07:41
Copy link
Contributor

@jglick jglick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great if it works, though pending INFRA-2544 it hardly matters anyway.

'''
} else {
bat '''
curl.exe -i -H 'Content-Type: application/json' -d '{"build_url":"'%BUILD_URL%'"}' "https://jenkins-community-functions.azurewebsites.net/api/incrementals-publisher?clientId=default&code=%FUNCTION_TOKEN%" || echo 'Problem calling Incrementals deployment function'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does ' work in batch scripts? Did you try this command with a -v and a phony token environment variable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested locally that the current string should work

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://ci.jenkins.io/job/Plugins/job/azure-credentials-plugin/job/master/35/execution/node/102/log/ suggests this is broken:


 FailRequestError: The incrementals-publisher invocation was missing the build_url attribute
     at IncrementalsPlugin.main (D:\home\site\wwwroot\incrementals-publisher\index.js:133:13)
     at module.exports (D:\home\site\wwwroot\incrementals-publisher\index.js:266:29)
     at WorkerChannel.invocationRequest (D:\Program Files (x86)\SiteExtensions\Functions\3.0.13139\64bit\workers\node\worker-bundle.js:17928:26)
     at ClientDuplexStream.WorkerChannel.eventStream.on (D:\Program Files (x86)\SiteExtensions\Functions\3.0.13139\64bit\workers\node\worker-bundle.js:17738:30)
     at ClientDuplexStream.emit (events.js:198:13)
     at addChunk (_stream_readable.js:288:12)
     at readableAddChunk (_stream_readable.js:269:11)
     at ClientDuplexStream.Readable.push (_stream_readable.js:224:10)
     at Object.onReceiveMessage (D:\Program Files (x86)\SiteExtensions\Functions\3.0.13139\64bit\workers\node\worker-bundle.js:21909:19)
     at InterceptingListener.module.exports.InterceptingListener.recvMessageWithContext (D:\Program Files (x86)\SiteExtensions\Functions\3.0.13139\64bit\workers\node\worker-bundle.js:21224:19)
     at D:\Program Files (x86)\SiteExtensions\Functions\3.0.13139\64bit\workers\node\worker-bundle.js:21323:14

CC @jetersen @olblak

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect this was a copy paste error on my part.

Suggested change
curl.exe -i -H 'Content-Type: application/json' -d '{"build_url":"'%BUILD_URL%'"}' "https://jenkins-community-functions.azurewebsites.net/api/incrementals-publisher?clientId=default&code=%FUNCTION_TOKEN%" || echo 'Problem calling Incrementals deployment function'
curl.exe -i -H 'Content-Type: application/json' -d '{"build_url":"%BUILD_URL%"}' "https://jenkins-community-functions.azurewebsites.net/api/incrementals-publisher?clientId=default&code=%FUNCTION_TOKEN%" || echo 'Problem calling Incrementals deployment function'

Copy link
Contributor Author

@jetersen jetersen Apr 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After actually testing it against site. I noticed a few things such as encoding being URL encoded...

Suggested change
curl.exe -i -H 'Content-Type: application/json' -d '{"build_url":"'%BUILD_URL%'"}' "https://jenkins-community-functions.azurewebsites.net/api/incrementals-publisher?clientId=default&code=%FUNCTION_TOKEN%" || echo 'Problem calling Incrementals deployment function'
curl.exe -i -H "Content-Type: application/json" -d "{""build_url"":""%BUILD_URL%""}" "https://jenkins-community-functions.azurewebsites.net/api/incrementals-publisher?clientId=default&code=%FUNCTION_TOKEN%" || echo Problem calling Incrementals deployment function

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oleg-nenashev oleg-nenashev changed the title windows 2019 images should have curl.exe by default Ensure that Windows 2019 images have CURL by default Jun 23, 2020
@oleg-nenashev oleg-nenashev changed the title Ensure that Windows 2019 images have CURL by default Ensure that Windows 2019 images have CURL when publishing incrementals Jun 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants