Skip to content

Commit

Permalink
Merge pull request #36 from noelmcloughlin/version
Browse files Browse the repository at this point in the history
chore(version): increase default version
  • Loading branch information
noelmcloughlin authored May 21, 2020
2 parents 67a9476 + 97e3f3a commit 02ca2b5
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 40 deletions.
2 changes: 1 addition & 1 deletion golang/config/alternatives/clean.sls
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ golang-package-archive-remove-home-alternative-remove:
- require:
- sls: {{ sls_archive_clean if golang.pkg.use_upstream_archive else sls_package_clean }}
{% for i in ['go', 'godoc', 'gofmt'] %}
{% for i in ('go', 'gofmt') %}
golang-package-archive-remove-{{ i }}-alternative-remove:
alternatives.remove:
Expand Down
2 changes: 1 addition & 1 deletion golang/config/alternatives/install.sls
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ golang-package-archive-install-home-alternative-set:
- alternatives: golang-package-archive-install-home-alternative-install
- unless: {{ grains.os_family in ('Suse',) }}
{% for i in ['go', 'godoc', 'gofmt'] %}
{% for i in ('go', 'gofmt') %}
golang-package-archive-install-{{ i }}-alternative-install:
cmd.run:
Expand Down
2 changes: 1 addition & 1 deletion golang/config/environ.sls
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ golang-config-file-managed-environ_file:
- sls: {{ sls_archive_install if golang.pkg.use_upstream_archive else sls_package_install }}
{% for i in ('go', 'godoc', 'gofmt') %}
{% for i in ('go', 'gofmt') %}
# create symlink under certain conditions
# archlinux, freebsd, macos for now
Expand Down
12 changes: 6 additions & 6 deletions golang/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# vim: ft=yaml
---
golang:
version: '1.10.1'
version: 1.14.2
go_path: /usr/local/golang/packages # non-default GOPATH
rootuser: root
rootgroup: root
Expand All @@ -13,16 +13,16 @@ golang:
archive:
name: /usr/local
uri: https://storage.googleapis.com/golang
source: None
source_hash: None
trim_output: true # works in 2018.3.2. onwards
source: null
source_hash: null
trim_output: true
archive_suffix: tar.gz
archive_format: tar
enforce_toplevel: true
repo: {}

# Provided in `map.jinja` via. `grains.kernel`
kernel: ''
kernel: null
config: '/etc/golang'
environ_file: /etc/default/golang.sh
environ: []
Expand All @@ -37,7 +37,7 @@ golang:
altpriority: 0
# for linux alternatives only
base_dir: ''
dir: /usr/local/go # go_root
dir: /usr/local/go # go_root, depreciated

cmd:
goget: []
Expand Down
6 changes: 3 additions & 3 deletions golang/osfamilymap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ FreeBSD:
rootgroup: wheel
pkg:
archive:
source: https://storage.googleapis.com/golang/go1.10.2.freebsd-386.tar.gz
source: https://storage.googleapis.com/golang/go1.14.2.freebsd-386.tar.gz

OpenBSD:
rootgroup: wheel
Expand All @@ -42,9 +42,9 @@ Windows:
pkg:
archive:
name: 'C:\\Program Files\\'
source: https://storage.googleapis.com/golang/go1.10.1.linux-amd64.tar.gz
source: https://storage.googleapis.com/golang/go1.14.2.linux-amd64.tar.gz

MacOS:
pkg:
archive:
source: https://storage.googleapis.com/golang/go1.10.2.darwin-amd64.tar.gz
source: https://storage.googleapis.com/golang/go1.14.2.darwin-amd64.tar.gz
27 changes: 1 addition & 26 deletions test/integration/default/controls/archives_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,10 @@
title 'should be installed'
desc 'Ensure golang tarball archive was extracted correctly'

describe file('/usr/local/go1.10.1.linux-amd64/go') do
describe file('/usr/local/go1.14.2.linux-amd64/go') do
it { should be_directory }
it { should be_owned_by 'root' }
it { should be_grouped_into 'root' }
its('mode') { should cmp '0755' }
end

require 'digest'
binary = file('/usr/local/go1.10.1.linux-amd64/go/bin/go').content
Digest::SHA256.hexdigest(binary)
describe file('/usr/local/go1.10.1.linux-amd64/go/bin/go') do
# rubocop:disable LineLength
its('sha256sum') { should eq '11438a2d41e257519e8c0ad098c287f9f73f1b8382a012a0c10e1dee5fb1e8ae' }
# rubocop:enable LineLength
end

binary = file('/usr/local/go1.10.1.linux-amd64/go/bin/godoc').content
Digest::SHA256.hexdigest(binary)
describe file('/usr/local/go1.10.1.linux-amd64/go/bin/godoc') do
# rubocop:disable LineLength
its('sha256sum') { should eq '4076bb73349f253c04e5ef214934938760eefb26529f22d2e6fdbd61b99bb4b5' }
# rubocop:enable LineLength
end

binary = file('/usr/local/go1.10.1.linux-amd64/go/bin/gofmt').content
Digest::SHA256.hexdigest(binary)
describe file('/usr/local/go1.10.1.linux-amd64/go/bin/gofmt') do
# rubocop:disable LineLength
its('sha256sum') { should eq '5673f5914f195331322b20aee026f1882dac7c92b61c41bae23a04fb803b3e2c' }
# rubocop:enable LineLength
end
end
4 changes: 2 additions & 2 deletions test/integration/default/controls/environ_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
its('mode') { should cmp '0644' }
its('content') { should include 'Your changes may be overwritten' }
# rubocop:disable LineLength
its('content') { should include 'export GOROOT=/usr/local/go1.10.1.linux-amd64' }
its('content') { should include 'export GOROOT=/usr/local/go1.14.2.linux-amd64' }
its('content') { should include 'export GOPATH=/usr/local/golang/packages' }
its('content') { should include 'export PATH=${PATH}:/usr/local/go1.10.1.linux-amd64/go/bin' }
its('content') { should include 'export PATH=${PATH}:/usr/local/go1.14.2.linux-amd64/go/bin' }
# rubocop:enable LineLength
end
end

0 comments on commit 02ca2b5

Please sign in to comment.