Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit

Permalink
update au setup
Browse files Browse the repository at this point in the history
  • Loading branch information
ferventcoder committed Aug 28, 2016
1 parent 3792413 commit 3e03fd0
Show file tree
Hide file tree
Showing 12 changed files with 228 additions and 63 deletions.
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# Chocolatey Packages

~~~
<!-- EDIT ME-->
[![](https://ci.appveyor.com/api/projects/status/9ipva7kgjigug2rn?svg=true)](https://ci.appveyor.com/project/YOUR_GITHUB_USERNAME_HERE/chocolatey-packages)
[Update status](https://gist.github.com/YOUR_GITHUB_USERNAME_HERE/YOUR_GIST_ID)
<!-- REMOVE THE squiggles "~" surrounding this (this should not be a code block) -->
~~~

## Chocolatey Packages Template

This contains Chocolatey packages, both manually and automatically maintained.
Expand Down Expand Up @@ -29,13 +40,17 @@ For setting up your own automatic package repository, please see [Automatic Pack

#### AU

* PowerShell v3+.
* PowerShell v4+. It will be v3+ once [au #17](https://github.com/majkinetor/au/issues/17) is implemented.
* The [AU module](https://chocolatey.org/packages/au).
* Ruby (and the gist gem) for publishing GitHub Gists.

### Getting started

1. Head into the `setup` folder and perform the proper steps for your choice of setup.
1. Fork this repository and rename it to `chocolatey-packages` (on GitHub - go into Settings, Repository name and rename).
1. Clone the repository locally.
1. Head into the `setup` folder and perform the proper steps for your choice of setup (or both if you plan to use both methods).
1. Edit this README. Update the badges at the top.


### Recommendation on Auto Packaging

Expand Down
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ environment:
au_force: false

# Github credentials - used to save result to gist and to commit pushed packages to the git repository
github_user: YOUR_USER_NAME_HERE
github_user: YOUR_GITHUB_USERNAME_HERE
github_pass:
secure: YOUR_PASSWORD_OR_2FA_AUTH_TOKEN_HERE_ENCRYPTED_STRING #https://ci.appveyor.com/tools/encrypt
github_user_repo: 'YOUR_REPO_USERNAME/YOUR_REPO_REPOSITORY_NAME' #https://github.com/chocolatey/chocolatey-packages-template is 'chocolatey/chocolatey-packages-template'
github_user_repo: 'YOUR_GITHUB_USERNAME_HERE/chocolatey-packages' #https://github.com/chocolatey/chocolatey-packages-template is 'chocolatey/chocolatey-packages-template'

# Email credentials - for error notifications
mail_user: YOUR_EMAIL_ACCOUNT
Expand Down
57 changes: 0 additions & 57 deletions au/New-Package.ps1

This file was deleted.

32 changes: 32 additions & 0 deletions automatic/html-tidy/html-tidy.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Do not remove this test for UTF-8: if “Ω” doesn’t appear as greek uppercase omega letter enclosed in quotation marks, you should use an editor that supports UTF-8, not this one. -->
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<!-- Read this before publishing packages to chocolatey.org: https://github.com/chocolatey/chocolatey/wiki/CreatePackages -->
<id>html-tidy</id>
<title>HTML Tidy with HTML5 support</title>
<version>5.2.0.20160708</version>
<authors>HTACG</authors>
<owners>Miodrag Milić</owners>
<summary>Tidy is a console application for Mac OS X, Linux, Windows, UNIX, and more. It corrects and cleans up HTML and XML documents by fixing markup errors and upgrading legacy code to modern standards</summary>
<description>
Tidy is a console application for Mac OS X, Linux, Windows, UNIX, and more. It corrects and cleans up HTML and XML documents by fixing markup errors and upgrading legacy code to modern standards.
</description>
<projectUrl>http://www.html-tidy.org/</projectUrl>
<tags>x-platform xml html tidy html5</tags>
<copyright>HTACG</copyright>
<licenseUrl>https://github.com/htacg/tidy-html5/blob/master/README/LICENSE.md</licenseUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<!--<dependencies>
<dependency id="" version="" />
</dependencies>-->
<releaseNotes></releaseNotes>
<docsUrl>http://www.html-tidy.org/documentation</docsUrl>
<bugTrackerUrl>https://github.com/htacg/tidy-html5/issues</bugTrackerUrl>
<projectSourceUrl>https://github.com/htacg/tidy-html5</projectSourceUrl>
<packageSourceUrl>https://github.com/majkinetor/chocolatey/tree/master/html-tidy</packageSourceUrl>
</metadata>
<files>
<file src="tools\**" target="tools" />
</files>
</package>
19 changes: 19 additions & 0 deletions automatic/html-tidy/tools/chocolateyInstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
$ErrorActionPreference = 'Stop'

$packageName = 'html-tidy'
$url32 = 'https://github.com/htacg/tidy-html5/releases/download/5.2.0/tidy-5.2.0-win32.zip'
$url64 = 'https://github.com/htacg/tidy-html5/releases/download/5.2.0/tidy-5.2.0-win64.zip'
$checksum32 = '94D653498B4F93B14F12A55CA06154E19C540C9B276E5D163F1CF84FA078F97A'
$checksum64 = 'DD9FD814CC44BC2FFA9B9E547B1A6CBB42B6BE7B9358542D3EE7F6E10B676423'

$packageArgs = @{
packageName = $packageName
url = $url32
url64Bit = $url64
checksum = $checksum32
checksum64 = $checksum64
checksumType = 'sha256'
checksumType64 = 'sha256'
unzipLocation = Split-Path $MyInvocation.MyCommand.Definition
}
Install-ChocolateyZipPackage @packageArgs
31 changes: 31 additions & 0 deletions automatic/html-tidy/update.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import-module au

$releases = 'https://github.com/htacg/tidy-html5/releases'

function global:au_SearchReplace {
@{
'tools\chocolateyInstall.ps1' = @{
"(^[$]url64\s*=\s*)('.*')" = "`$1'$($Latest.URL64)'"
"(^[$]url32\s*=\s*)('.*')" = "`$1'$($Latest.URL32)'"
"(^[$]checksum32\s*=\s*)('.*')" = "`$1'$($Latest.Checksum32)'"
"(^[$]checksum64\s*=\s*)('.*')" = "`$1'$($Latest.Checksum64)'"
}
}
}

function global:au_GetLatest {
$download_page = Invoke-WebRequest -Uri $releases

#tidy-5.1.25-win64.zip
$re = "tidy-.+-win(32|64).zip"
$url = $download_page.links | ? href -match $re | select -First 2 -expand href

$version = $url[0] -split '-' | select -Last 1 -Skip 1
$url32 = 'https://github.com' + $url[0]
$url64 = 'https://github.com' + $url[1]

$Latest = @{ URL32 = $url32; URL64 = $url64; Version = $version }
return $Latest
}

update
41 changes: 41 additions & 0 deletions automatic/nexus-oss/nexus-oss.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Do not remove this test for UTF-8: if “Ω” doesn’t appear as greek uppercase omega letter enclosed in quotation marks, you should use an editor that supports UTF-8, not this one. -->
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<!-- Read this before publishing packages to chocolatey.org: https://github.com/chocolatey/chocolatey/wiki/CreatePackages -->
<id>nexus-oss</id>
<title>Nexus Repository Manager OSS</title>
<version>2.12.0</version>
<authors>Sonatype</authors>
<owners>Miodrag Milić</owners>
<summary>Repository to manage software components required for development, deployment, and provisioning</summary>
<description>Nexus Repository Manager OSS manage software components required for development, deployment, and provisioning. If you develop software, the repository manager can help you share those components with other developers and end users. It greatly simplifies the maintenance of your own internal repositories and access to external repositories. With Nexus Repository Manager and Nexus Repository Manager OSS you can completely control access to, and deployment of, every component in your organization from a single location.

### Package

Package installer will install the nexus and start the service. The following parameters are available:

* `/InstallDir`
Installation directory, by default `/InstallDir: c:\nexus`

![screenshot](https://cdn.rawgit.com/majkinetor/chocolatey/master/nexus-oss/screenshot.png)
</description>
<projectUrl>http://www.sonatype.org/nexus/</projectUrl>
<tags>admin repository maven nuget docker package</tags>
<copyright>Sonatype</copyright>
<licenseUrl>https://www.eclipse.org/legal/epl-v10.html</licenseUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<iconUrl>https://cdn.rawgit.com/majkinetor/chocolatey/master/nexus-oss/icon.png</iconUrl>
<dependencies>
<dependency id="javaruntime" version="8.0.40" />
</dependencies>
<releaseNotes>https://support.sonatype.com/hc/en-us/articles/213464368-Sonatype-Nexus-Release-Notes-Index</releaseNotes>
<docsUrl>https://books.sonatype.com/nexus-book/reference/index.html</docsUrl>
<bugTrackerUrl>https://goo.gl/292OFI</bugTrackerUrl>
<projectSourceUrl>https://github.com/sonatype/nexus-public</projectSourceUrl>
<packageSourceUrl>https://github.com/majkinetor/chocolatey/tree/master/nexus-oss</packageSourceUrl>
</metadata>
<files>
<file src="tools\**" target="tools" />
</files>
</package>
Binary file added automatic/nexus-oss/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
55 changes: 55 additions & 0 deletions automatic/nexus-oss/tools/chocolateyInstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
$ErrorActionPreference = 'Stop'

$packageName = 'nexus-oss'
$url = 'https://sonatype-download.global.ssl.fastly.net/nexus/oss/nexus-2.13.0-01-bundle.zip'
$checksum = '76E2A2904FF0341A5FB646F615E3724F6C54E8A71759A7F8F06F702339D0767B'
$installDir = 'c:\nexus'

$packageArgs = @{
packageName = $packageName
url = $url
url64Bit = $url #url includes both 32-bit and 64-bit
checksum = $checksum
checksum64 = $checksum
checksumType = 'sha256'
checksumType64 = 'sha256'
unzipLocation = $installDir
}

if ($Env:ChocolateyPackageParameters -match '/InstallDir:\s*(.+)') {
$installDir = $Matches[1]
if ($installDir.StartsWith("'") -or $installDir.StartsWith('"')){ $installDir = $installDir -replace '^.|.$' }
$parent = Split-Path $installDir
mkdir -force $parent -ea 0 | out-null
}

if (gcm nexus -ea 0) {
Write-Host "Detected existing installation, uninstalling service"
0 | nexus stop
0 | nexus uninstall
}

Write-Host "Installing to '$installDir'"
Install-ChocolateyZipPackage @packageArgs

$nexusDir = ls $installDir\nexus-* | sort -Descending | select -First 1
$nexus = "$nexusDir\bin\nexus.bat"
if (!(Test-Path $nexus)) { throw "Can not find nexus.bat" }
Install-BinFile nexus $nexus

0 | nexus install
0 | nexus start

$s = gsv nexus-webapp -ea 0
if (!$s) { throw "Nexus service 'nexus-webapp' is not installed" }
if ($s.Status -ne 'Running') { Write-Warning "Nexus service 'nexus-webapp' is installed but not running" }

$ok = $false
try {
$request = [System.Net.HttpWebRequest]::Create("http://localhost:8081/nexus")
$response = $request.GetResponse()
$ok = $response.StatusCode -eq 'OK'
} catch {}

if (!$ok) { Write-Warning "Nexus should be available at http://localhost:8081/nexus but can't be reached" }
else { Write-Host "Nexus is available at http://localhost:8081/nexus" }
29 changes: 29 additions & 0 deletions automatic/nexus-oss/update.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import-module au

$url = 'http://www.sonatype.org/downloads/nexus-latest-bundle.zip'

function global:au_SearchReplace {
@{
'tools\chocolateyInstall.ps1' = @{
"(^[$]url\s*=\s*)('.*')" = "`$1'$($Latest.URL)'"
"(^[$]checksum\s*=\s*)('.*')" = "`$1'$($Latest.Checksum32)'"
}
}
}

function global:au_GetLatest {
while($true) {
$request = [System.Net.WebRequest]::Create($url)
$request.AllowAutoRedirect=$false
$response=$request.GetResponse()
$location = $response.GetResponseHeader('Location')
if (!$location -or ($location -eq $url)) { break }
$url = $location
}

$version = ($url -split '-|\.' | select -Last 4 -skip 2) -join '.'
$Latest = @{ URL = $url; Version = $version }
return $Latest
}

update -NoCheckUrl -ChecksumFor 32
Binary file added icons/nexus-oss.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions setup/au_setup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
`$env:au_force = 'false'
# Github credentials - used to save result to gist and to commit pushed packages to the git repository
`$env:github_user = 'YOUR_USER_NAME_HERE'
`$env:github_user = 'YOUR_GITHUB_USERNAME_HERE'
`$env:github_pass = 'YOUR_PASSWORD_OR_2FA_AUTH_TOKEN_HERE'
`$env:github_user_repo= 'username/repository' #https://github.com/chocolatey/chocolatey-packages-template is 'chocolatey/chocolatey-packages-template'
`$env:github_user_repo= 'YOUR_GITHUB_USERNAME_HERE/chocolatey-packages' #https://github.com/chocolatey/chocolatey-packages-template is 'chocolatey/chocolatey-packages-template'
# Email credentials - for error notifications
`$env:mail_user = 'YOUR_EMAIL_ACCOUNT'
Expand Down

0 comments on commit 3e03fd0

Please sign in to comment.