Browse Source

Package for right_st

Douglas Thrift 6 years ago
parent
commit
c779e24ffd

+ 36 - 0
automatic/right_st/right_st.nuspec

@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
+  <metadata>
+    <id>right_st</id>
+    <version>1.6.1</version>
+    <packageSourceUrl>https://github.com/douglaswth/chocolatey-packages/tree/master/automatic/right_st</packageSourceUrl>
+    <owners>Douglas Thrift</owners>
+    <title>right_st - RightScale ServerTemplate and RightScript tool</title>
+    <authors>RightScale</authors>
+    <projectUrl>https://github.com/rightscale/right_st</projectUrl>
+    <licenseUrl>https://github.com/rightscale/right_st/blob/master/LICENSE</licenseUrl>
+    <requireLicenseAcceptance>false</requireLicenseAcceptance>
+    <projectSourceUrl>https://github.com/rightscale/right_st</projectSourceUrl>
+    <bugTrackerUrl>https://github.com/rightscale/right_st/issues</bugTrackerUrl>
+    <tags>right_st rightscale API rest cli go golang</tags>
+    <summary>RightScale ServerTemplate and RightScript tool</summary>
+    <description>
+`right_st` is a tool for managing RightScale ServerTemplate and RightScripts. The tool is able to download, upload, and show ServerTemplate and RightScripts using RightScale's API. This tool can easily be hooked into Travis CI or other build systems to manage these design objects if stored in Github. See below for usage examples.
+
+# Configuration
+
+Right ST interfaces with the [RightScale API](http://reference.rightscale.com/api1.5). Credentials for the API can be provided in two ways:
+
+1. YAML-based configuration file -  Run `right_st config account &lt;name&gt;`, where name is a nickname for the account, to interactively write the configuration file into `$HOME/.right_st.yml` for the first time. You will be prompted for the following fields:
+    * Account ID - Numeric account number, such as `60073`
+    * API endpoint host - Hostname, typically `my.rightscale.com`
+    * Refresh Token - Your personal OAuth token available from **Settings &gt; Account Settings &gt; API Credentials** in the RightScale Cloud Management dashboard
+2. Environment variables - These are meant to be used by build systems such as Travis CI. The following vars must be set: `RIGHT_ST_LOGIN_ACCOUNT_ID`, `RIGHT_ST_LOGIN_ACCOUNT_HOST`, `RIGHT_ST_LOGIN_ACCOUNT_REFRESH_TOKEN`. These variables are equivalent to the ones described in the YAML section above.
+    </description>
+    <releaseNotes>See the [ChangeLog](https://github.com/rightscale/right_st/blob/master/ChangeLog.md).</releaseNotes>
+  </metadata>
+  <files>
+    <file src="tools\**" target="tools" />
+  </files>
+</package>

+ 14 - 0
automatic/right_st/tools/chocolateyinstall.ps1

@@ -0,0 +1,14 @@
+$ErrorActionPreference = 'Stop';
+
+$packageName = $env:ChocolateyPackageName
+$toolsDir    = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
+
+$packageArgs = @{
+  packageName    = $packageName
+  unzipLocation  = $toolsDir
+  url64bit       = 'https://binaries.rightscale.com/rsbin/right_st/v1.6.1/right_st-windows-amd64.zip'
+  checksum64     = 'e9757a64203634e8eeb887c08ab50672837f73b1d83dd6af0d5d94ed6dff11e7'
+  checksumType64 = 'sha256'
+}
+
+Install-ChocolateyZipPackage @packageArgs

+ 23 - 0
automatic/right_st/update.ps1

@@ -0,0 +1,23 @@
+Import-Module au
+
+$latest_release = 'https://github.com/rightscale/right_st/releases/latest'
+
+function global:au_GetLatest {
+  $download_page = Invoke-WebRequest -Uri $latest_release
+  $regex         = '^.+/v(\d+\.\d+\.\d+)/right_st-windows-amd64\.zip$'
+  $url64         = $download_page.Links | ? href -Match $regex | select -First 1 -ExpandProperty href
+  $version       = $url64 -replace $regex, '$1'
+  return @{ Version = $version; URL64 = $url64 }
+}
+
+function global:au_SearchReplace {
+  @{
+    'tools\chocolateyInstall.ps1' = @{
+      "(^\s+url64bit\s+=\s+)('.*')"       = "`$1'$($Latest.URL64)'"
+      "(^\s+checksum64\s+=\s+)('.*')"     = "`$1'$($Latest.Checksum64)'"
+      "(^\s+checksumType64\s+=\s+)('.*')" = "`$1'$($Latest.ChecksumType64)'"
+    }
+  }
+}
+
+update -ChecksumFor 64