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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate choco_push into new finish-release process #7142

Merged
merged 3 commits into from Nov 4, 2019

Conversation

@smacfarlane
Copy link
Contributor

smacfarlane commented Nov 1, 2019

This migrates our publishing of choco packages from 馃崠 馃 automation to our post-release pipeline.

closes #6008

Signed-off-by: Scott Macfarlane smacfarlane@chef.io

@smacfarlane smacfarlane force-pushed the sm/finish-release-publish-choco branch from 0690ca7 to 2bc44de Nov 1, 2019
@@ -1,5 +1,5 @@
$version = '$version$'
$url = "https://bintray.com/habitat/stable/download_file?file_path=windows%2Fx86_64%2Fhab-$version-x86_64-windows.zip"
$url = "https://packages.chef.io/files/stable/habitat/latest/hab-x86_64-windows.zip"

This comment has been minimized.

Copy link
@mwrock

mwrock Nov 1, 2019

Contributor

won't this always get the latest? We want to make sure it is pinned to the version of the package so if someone runs choco install habitat -version 0.88.0 they are guaranteed to get that version.

This comment has been minimized.

Copy link
@smacfarlane

smacfarlane Nov 1, 2019

Author Contributor

That's a good question. Maybe my understanding of choco was off but I thought choco re-published our artifact. If it's just a wrapper that tells the install how to fetch from upstream then yes, this will need to change.

This comment has been minimized.

Copy link
@mwrock

mwrock Nov 1, 2019

Contributor

you can do either. We have been wrapping the upstream in order to keep the stats with bintray (likely with no value) however we may want to do the same with our own packages endpoint if that will help us to better track the stats. If not, then we could just embed the entire zip in the package.

This comment has been minimized.

Copy link
@smacfarlane

smacfarlane Nov 1, 2019

Author Contributor

馃憤 I'll rework this to align with what we've been doing in the past. We can re-evaluate later if we want to change how we bundle things, but I suspect we'll want the stats from package.chef.io

This comment has been minimized.

Copy link
@smacfarlane

smacfarlane Nov 1, 2019

Author Contributor

@mwrock With the latest changes NOTE I have to use the dev channel in testing since we haven't made a stable release:

.expeditor/scripts/finish_release/publish_to_chocolatey.ps1
--- Fetching manifest
Fetching https://packages.chef.io/files/dev/habitat/latest/manifest.json
--- :thinking_face: Determining version and release to publish                                                                                             0.89.53                                                                                                                                                    --- Fetching checksum                                                                                                                                      https://packages.chef.io/files/dev/habitat/latest/hab-x86_64-windows.zip.sha256sum
5d1980a90f2153dd2133025efb19efea1120b76164083d81bbbe6916b4929c28
--- Patching nuspec
--- :bug: DEBUG PRINT PATCHED NUSPEC
$version = '0.89.53'
$url = "https://packages.chef.io/files/habitat/$version/hab-x86_64-windows.zip"
$unzipLocation = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$checksum = '5d1980a90f2153dd2133025efb19efea1120b76164083d81bbbe6916b4929c28'

Install-ChocolateyZipPackage "habitat" $url $unzipLocation -checksum $checksum -checksumType sha256
--- Publishing package
--- NOT PUBLISHING: Build triggered by  and not Chef Expeditor
choco pack /tmp/4ktjdqng.drb/habitat.nuspec --version 0.89.53
choco push habitat.0.89.53.nupkg -k <elided ChocoApiKey> --timeout 600
PS /home/smacfarlane/src/habitat-sh/habitat> Invoke-RestMethod https://packages.chef.io/files/habitat/0.89.53/hab-x86_64-windows.zip.sha256sum
5d1980a90f2153dd2133025efb19efea1120b76164083d81bbbe6916b4929c28  hab-x86_64-windows.zip

This comment has been minimized.

Copy link
@mwrock

mwrock Nov 1, 2019

Contributor

thats cool. I wonder if you should comment out the choco push for now to make sure those don't get accidentally pushed to choco.

This comment has been minimized.

Copy link
@smacfarlane

smacfarlane Nov 1, 2019

Author Contributor

Yup, the guard I have in place will only push if it's expeditor starting the job, so manual runs for verification are safe. When we do have a real release, we'll want it to attempt to go all the way through, there's no good way to exercise that bit of code until the time comes though

@mwrock
mwrock approved these changes Nov 1, 2019
Write-Host "--- NOT PUBLISHING: Build triggered by $env:BUILDKITE_BUILD_CREATOR and not $valid_build_creator"
Write-Host "choco pack $tempDir/habitat.nuspec --version $Version"
Write-Host "choco push habitat.$Version.nupkg -k <elided ChocoApiKey> --timeout 600"
}

This comment has been minimized.

Copy link
@christophermaier

christophermaier Nov 1, 2019

Contributor

I'm not sure if there's a Powershell version of the suggestion in #7143 (comment)... that could be useful here if we find ourselves repeating this logic in Powershell.

... though the <elided ChocoApiKey> bit means we'd want to find an alternative formulation of this particular command before doing that 馃

smacfarlane added 3 commits Oct 18, 2019
Signed-off-by: Scott Macfarlane <smacfarlane@chef.io>
Signed-off-by: Scott Macfarlane <smacfarlane@chef.io>
Signed-off-by: Scott Macfarlane <smacfarlane@chef.io>
@smacfarlane smacfarlane force-pushed the sm/finish-release-publish-choco branch from af51b5a to 68b9602 Nov 4, 2019
@smacfarlane smacfarlane merged commit 3ed58da into master Nov 4, 2019
5 checks passed
5 checks passed
DCO This commit has a DCO Signed-off-by
Details
buildkite/habitat-sh-habitat-master-verify Build #4088 passed (37 minutes, 40 seconds)
Details
buildkite/habitat-sh-habitat-master-website Build #1167 passed (1 minute)
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
expeditor/config-validation Validated your Expeditor config file
Details
@chef-expeditor chef-expeditor bot deleted the sm/finish-release-publish-choco branch Nov 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can鈥檛 perform that action at this time.