-
Notifications
You must be signed in to change notification settings - Fork 234
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move chocolatey scripts to main repository (#550)
- Loading branch information
Gabriel Simmer
authored
Feb 5, 2021
1 parent
350505f
commit cb18d15
Showing
6 changed files
with
100 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# CircleCI CLI Chocolatey Package | ||
|
||
Automatically builds and deploys the Chocolatey package when the CLI is | ||
released. | ||
|
||
Chocolatey page: https://chocolatey.org/packages/circleci-cli | ||
|
||
## Installing | ||
|
||
```powershell | ||
choco install circleci-cli -y | ||
``` | ||
|
||
_thanks to @ericjaystevens for the initial work on this!_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd"> | ||
<metadata> | ||
<!-- == PACKAGE SPECIFIC SECTION == --> | ||
<id>circleci-cli</id> | ||
<version>$VER</version> | ||
<packageSourceUrl>https://github.com/CircleCI-Public/circleci-cli</packageSourceUrl> | ||
<!-- owners is a poor name for maintainers of the package. It sticks around by this name for compatibility reasons. It basically means you. --> | ||
<owners>CircleCI</owners> | ||
<!-- ============================== --> | ||
|
||
<!-- == SOFTWARE SPECIFIC SECTION == --> | ||
<!-- This section is about the software itself --> | ||
<title>circleci-cli (Install)</title> | ||
<authors>CircleCI</authors> | ||
<projectUrl>https://circleci.com/docs/2.0/local-cli/</projectUrl> | ||
<iconUrl>https://github.com/CircleCI-Public/circleci-cli/raw/master/chocolatey/icons/circleci-128x.png</iconUrl> | ||
<licenseUrl>https://raw.githubusercontent.com/CircleCI-Public/circleci-cli/master/LICENSE</licenseUrl> | ||
<requireLicenseAcceptance>true</requireLicenseAcceptance> | ||
<projectSourceUrl>https://github.com/CircleCI-Public/circleci-cli</projectSourceUrl> | ||
<docsUrl>https://circleci-public.github.io/circleci-cli/</docsUrl> | ||
<tags>ci</tags> | ||
<releaseNotes>https://github.com/CircleCI-Public/circleci-cli/releases</releaseNotes> | ||
<summary>CircleCI command line tool</summary> | ||
<description> | ||
Command line tool for performing tasks related to a CircleCI project. Enables you to run local builds, debug your continuous integration config files, and manage Orbs. | ||
</description> | ||
</metadata> | ||
<files> | ||
<file src="tools\**" target="tools" /> | ||
</files> | ||
</package> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# This file is generated by `update-version.ps1`, and commited to the repository | ||
# under a version tag. | ||
$ErrorActionPreference = 'Stop'; | ||
$toolsDir = Split-Path -parent $MyInvocation.MyCommand.Definition | ||
$url64 = '$DOWNLOAD_URL' | ||
|
||
$packageParams = @{ | ||
packageName = $env:ChocolateyPackageName | ||
unzipLocation = $toolsDir | ||
url64 = $url64 | ||
checksum64 = '$HASH' | ||
checksumType64 = 'sha256' | ||
} | ||
Install-ChocolateyZipPackage @packageParams |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
$url = "https://github.com/CircleCI-Public/circleci-cli/releases/latest" | ||
|
||
$request = [System.Net.WebRequest]::Create($url) | ||
$request.AllowAutoRedirect=$false | ||
$response=$request.GetResponse() | ||
$versionURL = $response.GetResponseHeader("Location") | ||
|
||
$curVersion = ($versionURL | Split-Path -Leaf).Substring(1) | ||
|
||
$tmpFile = ".\out.txt" | ||
$checksumURL = "https://github.com/CircleCI-Public/circleci-cli/releases/download/v$curVersion/circleci-cli_$($curVersion)_checksums.txt" | ||
Write-Verbose "getting checksum from $checksumURL to $tmpFile" | ||
|
||
(New-Object System.Net.WebClient).DownloadString($checksumURL) >> $tmpFile | ||
|
||
### replace hash | ||
$hash = (Get-Content $tmpFile | where {$_ -like "*windows_amd64.zip"}).split(" ")[0] | ||
$installerPath = ".\circleci-cli\tools\chocolateyinstall.ps1" | ||
(Get-Content $installerPath).Replace('$HASH',$hash) | Out-File $installerPath -Force | ||
|
||
$downloadURL = "https://github.com/CircleCI-Public/circleci-cli/releases/download/v$curVersion/circleci-cli_$($curVersion)_windows_amd64.zip" | ||
(Get-Content $installerPath).Replace('$DOWNLOAD_URL',$downloadURL) | Out-File $installerPath -Force | ||
|
||
$nuspecPath = "./circleci-cli/circleci-cli.nuspec" | ||
(Get-Content $nuspecPath).Replace('$VER',$curVersion) | Out-File $nuspecPath -Force |