From 8dada30c319472fff052a308426da5bea4a06b49 Mon Sep 17 00:00:00 2001 From: dgalbraith Date: Thu, 3 Jun 2021 20:22:22 +0100 Subject: [PATCH] (etcd) Add new package maintainer Add new package maintainer and update to reflect current contribution guidelines and package details. Specific changes made: * Update package details to reflect migration from CoreOS to etcd-io * Refresh README to reflect current product description * Include copyright handling for Nuspec updates * Powershell script formatting and style changes * Ensured correct handling of checksum type updates * Added a version for the nssm dependency --- automatic/etcd/README.md | 31 ++++++----- automatic/etcd/etcd.nuspec | 54 ++++++++++--------- automatic/etcd/legal/VERIFICATION.txt | 4 +- .../etcd/tools/chocolateyBeforeModify.ps1 | 3 +- automatic/etcd/tools/chocolateyInstall.ps1 | 1 - automatic/etcd/update.ps1 | 27 +++++----- 6 files changed, 67 insertions(+), 53 deletions(-) diff --git a/automatic/etcd/README.md b/automatic/etcd/README.md index ad2424eb556..e93adc44707 100644 --- a/automatic/etcd/README.md +++ b/automatic/etcd/README.md @@ -1,22 +1,27 @@ # [etcd](https://chocolatey.org/packages/etcd) -etcd is a distributed reliable key-value store for the most critical data of a distributed system, with a focus on being: - * _Simple_: well-defined, user-facing API (gRPC) - * _Secure_: automatic TLS with optional client cert authentication - * _Fast_: benchmarked 10,000 writes/sec - * _Reliable_: properly distributed using Raft +**etcd** is a strongly consistent, distributed key-value store that provides a reliable way to store data that needs to +be accessed by a distributed system or cluster of machines. It gracefully handles leader elections during network +partitions and can tolerate machine failure, even in the leader node. -etcd is written in Go and uses the Raft consensus algorithm to manage a highly-available replicated log. +## Features -etcd is used in production by many companies, and the development team stands behind it in critical deployment scenarios, where etcd is frequently teamed with applications such as Kubernetes, locksmith, vulcand, Doorman, and many others. Reliability is further ensured by rigorous testing. +* **Simple interface** Read and write values using standard HTTP tools, such as curl +* **Key-value storage** Store data in hierarchically organized directories, as in a standard filesystem +* **Watch for changes** Watch specific keys or directories for changes and react to changes in values +* Optional SSL client certificate authentication +* Benchmarked at 1000s of writes/s per instance +* Optional TTLs for keys expiration +* Properly distributed via Raft protocol -This package installs **etcd** as a service, and makes **etcdctl** (the command line client) available in the path. +## Package Parameters -The package will pass package parameters to the etcd service. +* The package will pass package parameters to the etcd service Example: `choco install etcd -y --params="-discovery https://discovery.etcd.io/tokengoeshere"` -The service is managed with NSSM, you can change the service parameters easily by running `nssm edit etcd` +## Notes -Originally packaged by Robert Labrie (https://github.com/tnwinc/chocolatey-etcd) - -#### Note: Windows support is limited to 64bit systems. +* This package installs **etcd** as a service, and makes **etcdctl** (the command line client) available in the path +* The service is managed with NSSM, you can change the service parameters easily by running `nssm edit etcd` +* Windows support is limited to 64-bit systems +* Originally packaged by Robert Labrie (https://github.com/robertlabrie) diff --git a/automatic/etcd/etcd.nuspec b/automatic/etcd/etcd.nuspec index 1319d72b6e7..be901585634 100644 --- a/automatic/etcd/etcd.nuspec +++ b/automatic/etcd/etcd.nuspec @@ -5,43 +5,49 @@ etcd 3.5.0-beta4 https://github.com/chocolatey-community/chocolatey-coreteampackages/tree/master/automatic/etcd - chocolatey-community,Andrei Bejenaru,Robert Labrie + chocolatey-community,dgalbraith,Andrei Bejenaru,Robert Labrie etcd (Install) - CoreOS - https://github.com/coreos/etcd + etcd Authors + https://etcd.io https://cdn.jsdelivr.net/gh/chocolatey-community/chocolatey-coreteampackages@c681fe2d8274d648911c90a5cfa63b43e4663013/icons/etcd.png - (c) 2017 CoreOS, Inc - https://github.com/coreos/etcd/blob/master/LICENSE + (c) 2013-2021 etcd Authors + https://github.com/etcd-io/etcd/blob/main/LICENSE false - https://github.com/coreos/etcd - https://coreos.com/etcd/docs/latest - https://github.com/coreos/etcd/issues - etcd configuration admin cli foss + https://github.com/etcd-io/etcd + https://etcd.io/docs/latest + https://etcd.io/community + https://github.com/etcd-io/etcd/issues + etcd configuration cli cross-platform foss etcd is a distributed, consistent key-value store for shared configuration and service discovery - - https://github.com/coreos/etcd/releases/tag/v3.5.0-beta.4 + https://github.com/etcd-io/etcd/releases/tag/v3.5.0-beta.4 - + diff --git a/automatic/etcd/legal/VERIFICATION.txt b/automatic/etcd/legal/VERIFICATION.txt index 04fcad6b2c9..b518f045792 100644 --- a/automatic/etcd/legal/VERIFICATION.txt +++ b/automatic/etcd/legal/VERIFICATION.txt @@ -16,7 +16,7 @@ and can be verified by doing the following: 3. The checksums should match the following: - checksum type: + checksum type: sha256 checksum: DC7556283E2C815FFBAE5BF745A6470465C226A9AA33E847DF78920B5DB412D9 -The file 'LICENSE.txt' has been obtained from +The file 'LICENSE.txt' has been obtained from diff --git a/automatic/etcd/tools/chocolateyBeforeModify.ps1 b/automatic/etcd/tools/chocolateyBeforeModify.ps1 index 333c70a3ada..f5845f9a8cf 100644 --- a/automatic/etcd/tools/chocolateyBeforeModify.ps1 +++ b/automatic/etcd/tools/chocolateyBeforeModify.ps1 @@ -1,4 +1,5 @@ - +$ErrorActionPreference = 'Stop' + # remove the service if it exists if ((Get-Service | Where-Object { $_.Name -eq "etcd" }).length) { Get-Service etcd | Stop-Service diff --git a/automatic/etcd/tools/chocolateyInstall.ps1 b/automatic/etcd/tools/chocolateyInstall.ps1 index 0d1a9276147..127df628598 100644 --- a/automatic/etcd/tools/chocolateyInstall.ps1 +++ b/automatic/etcd/tools/chocolateyInstall.ps1 @@ -15,7 +15,6 @@ Get-ChocolateyUnzip @packageArgs Copy-Item "$installLocation\etcd-*-windows-amd64\*" $installLocation -Recurse -Force Remove-Item "$installLocation\etcd-*-windows-amd64" -Recurse -Force -# Install-ChocolateyPath "$installLocation" # older versions of etcd didn't put .exe on the binary if (Test-Path "$installLocation\etcd") { diff --git a/automatic/etcd/update.ps1 b/automatic/etcd/update.ps1 index b0e2ec79f6f..d4e4fcb6815 100644 --- a/automatic/etcd/update.ps1 +++ b/automatic/etcd/update.ps1 @@ -4,7 +4,7 @@ param($IncludeStream, [switch] $Force) Import-Module AU $domain = 'https://github.com' -$releases = "$domain/coreos/etcd/releases" +$releases = "$domain/etcd-io/etcd/releases" function global:au_BeforeUpdate { Get-RemoteFiles -Purge -NoSuffix } @@ -13,12 +13,13 @@ function global:au_SearchReplace { ".\legal\VERIFICATION.txt" = @{ "(?i)(^\s*location on\:?\s*)\<.*\>" = "`${1}<$($Latest.ReleaseURL)>" "(?i)(^\s*software.*)\<.*\>" = "`${1}<$($Latest.URL64)>" - "(?i)(^\s*checksum\s*type\:).*" = "`${1} $($Latest.ChecksumType32)" + "(?i)(^\s*checksum\s*type\:).*" = "`${1} $($Latest.ChecksumType64)" "(?i)(^\s*checksum\:).*" = "`${1} $($Latest.Checksum64)" } "$($Latest.PackageName).nuspec" = @{ - "(\).*?(\)" = "`${1}$($Latest.ReleaseURL)`${2}" + "(\.*?-)\d{4}(.*?\)" = "`${1}$($Latest.ReleaseYear)`${2}" + "(\).*?(\)" = "`${1}$($Latest.ReleaseURL)`${2}" } } } @@ -26,25 +27,27 @@ function global:au_SearchReplace { function global:au_GetLatest { $download_page = Invoke-WebRequest -Uri $releases -UseBasicParsing - $re = '-windows-amd64\.zip$' - $urls = $download_page.links | ? href -match $re | % href + $re = '-windows-amd64\.zip$' + $urls = $download_page.links | where-object href -match $re | foreach-object href $streams = @{} - $urls | % { - $version = $_ -split '\/v?' | select -last 1 -skip 1 + $urls | foreach-object { + $version = $_ -split '\/v?' | select-object -last 1 -skip 1 $majorVersion = $version -replace '^(\d+\.\d+).*', "`$1" if (!$streams.ContainsKey($majorVersion)) { $streams.Add($majorVersion, @{ - Version = Get-Version $version - URL64 = $domain + $_ - ReleaseURL = "$domain/coreos/etcd/releases/tag/v${version}" - }) + Version = Get-Version $version + URL64 = $domain + $_ + ReleaseURL = "$domain/etcd-io/etcd/releases/tag/v${version}" + ReleaseYear = (Get-Date).ToString('yyyy') + } + ) } } return @{ Streams = $streams } } -update -ChecksumFor none -IncludeStream $IncludeStream -Force:$Force +update -ChecksumFor none -IncludeStream $IncludeStream -Force:$Force -NoCheckChocoVersion -NoCheckUrl