Skip to content

Commit

Permalink
Added automatic update to release version for chocolatey scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
martinpinto committed Mar 30, 2017
1 parent 61d0706 commit 6aade2f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion fn/chocolatey/functions.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>functions</id>
<version>0.2.36</version>
<version>0.2.57</version>
<packageSourceUrl>https://github.com/iron-io/functions</packageSourceUrl>

<title>Iron.io Functions (Install)</title>
Expand Down
2 changes: 1 addition & 1 deletion fn/chocolatey/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

$packageName= 'functions'
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$url = 'https://github.com/iron-io/functions/releases/download/0.2.25/fn.exe'
$url = 'https://github.com/iron-io/functions/releases/download/0.2.57/fn.exe'
#$fileLocation = Join-Path $toolsDir 'NAME_OF_EMBEDDED_INSTALLER_FILE'
#$fileLocation = '\\SHARE_LOCATION\to\INSTALLER_FILE'

Expand Down
10 changes: 10 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ set -ex
user="iron"
service="functions"
version_file="api/version/version.go"
# Chocolatey specific files
chocolatey_spec_file="fn/chocolatey/functions.nuspec"
chocolatey_install_file="fn/chocolatey/tools/chocolateyinstall.ps1"

tag="latest"

if [ -z $(grep -m1 -Eo "[0-9]+\.[0-9]+\.[0-9]+" $version_file) ]; then
Expand All @@ -15,6 +19,12 @@ perl -i -pe 's/\d+\.\d+\.\K(\d+)/$1+1/e' $version_file
version=$(grep -m1 -Eo "[0-9]+\.[0-9]+\.[0-9]+" $version_file)
echo "Version: $version"

# Update chocolatey version
sed 's|<version>.*</version>|<version>'$version'</version>|' $chocolatey_spec_file > "$chocolatey_spec_file.tmp"
mv "$chocolatey_spec_file.tmp" $chocolatey_spec_file
sed 's|https://github.com/iron-io/functions/releases/download/.*/fn.exe|https://github.com/iron-io/functions/releases/download/'$version'/fn.exe|' $chocolatey_install_file > "$chocolatey_install_file.tmp"
mv "$chocolatey_install_file.tmp" $chocolatey_install_file

make docker-build

sed "s/release=.*/release=\"$version\"/g" fn/install.sh > fn/install.sh.tmp
Expand Down

0 comments on commit 6aade2f

Please sign in to comment.