This repository has been archived by the owner on Oct 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cnquery-generate.sh
executable file
·66 lines (53 loc) · 2.49 KB
/
cnquery-generate.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
if [[ $VERSION = "" ]]; then
echo "ERROR: You must supply a version number"
exit 1
fi
rm -rf cnquery/
mkdir cnquery && cd cnquery
echo "Generating NuSpec"
cat >cnquery.nuspec <<NUSPEC
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>cnquery</id>
<version>${VERSION}</version>
<packageSourceUrl>https://github.com/mondoohq/cnquery</packageSourceUrl>
<owners>Mondoo</owners>
<title>Mondoo cnquery</title>
<authors>Mondoo</authors>
<projectUrl>https://github.com/mondoohq/cnquery</projectUrl>
<iconUrl>https://mondoo.com/mondoo_choco_logo.jpg</iconUrl>
<copyright>2022 Mondoo, Inc.</copyright>
<licenseUrl>https://raw.githubusercontent.com/mondoohq/cnquery/617d62a9117f10c52872cad85ddf689d09140434/LICENSE.txt</licenseUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<docsUrl>https://mondoo.com/docs/cnquery/</docsUrl>
<bugTrackerUrl>https://github.com/mondoohq/cnquery/issues</bugTrackerUrl>
<releaseNotes>[Release Notes](https://mondoo.com/releases/)</releaseNotes>
<tags>cnquery mondoo inventory cloud kubernetes server</tags>
<summary>cnquery is an open source, cloud-native tool that answers every question about your infrastructure. It provides quick insights into every major technology platform used by developers, security engineers, and DevOps teams today.</summary>
<description>cnquery is an open source, cloud-native tool that answers every question about your infrastructure. It provides quick insights into every major technology platform used by developers, security engineers, and DevOps teams today.</description>
</metadata>
<files>
<file src="tools\**" target="tools" />
</files>
</package>
NUSPEC
CHECKSUM=`curl -s https://install.mondoo.com/package/cnquery/windows/amd64/zip/${VERSION}/sha256`
echo "Generating Install Script"
mkdir tools
cat >tools/chocolateyInstall.ps1 <<CHOCOSTALL
\$ErrorActionPreference = 'Stop'; # stop on all errors
\$toolsDir = "\$(Split-Path -parent \$MyInvocation.MyCommand.Definition)"
\$version = '${VERSION}'
\$url = "https://releases.mondoo.com/cnquery/${VERSION}/cnquery_${VERSION}_windows_amd64.zip"
\$checksum = '${CHECKSUM}'
\$packageArgs = @{
packageName = \$env:ChocolateyPackageName
unzipLocation = \$toolsDir
url64bit = \$url
checksum64 = \$checksum
checksumType64= 'sha256' #default is checksumType
}
Install-ChocolateyZipPackage @packageArgs
CHOCOSTALL