-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add go download script #61
Merged
stuhood
merged 1 commit into
pantsbuild:gh-pages
from
traviscrawford:travis/build-go-script
Mar 29, 2018
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
set -o xtrace | ||
curl https://storage.googleapis.com/golang/go1.10.linux-amd64.tar.gz -o go.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
set -o xtrace | ||
curl https://storage.googleapis.com/golang/go1.9.4.linux-amd64.tar.gz -o go.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
set -o xtrace | ||
curl https://storage.googleapis.com/golang/go1.10.darwin-amd64.tar.gz -o go.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
set -o xtrace | ||
curl https://storage.googleapis.com/golang/go1.9.4.darwin-amd64.tar.gz -o go.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
set -o xtrace | ||
curl https://storage.googleapis.com/golang/go1.10.darwin-amd64.tar.gz -o go.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
set -o xtrace | ||
curl https://storage.googleapis.com/golang/go1.9.4.darwin-amd64.tar.gz -o go.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
set -o xtrace | ||
curl https://storage.googleapis.com/golang/go1.10.darwin-amd64.tar.gz -o go.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
set -o xtrace | ||
curl https://storage.googleapis.com/golang/go1.9.4.darwin-amd64.tar.gz -o go.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
set -o xtrace | ||
curl https://storage.googleapis.com/golang/go1.10.darwin-amd64.tar.gz -o go.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
set -o xtrace | ||
curl https://storage.googleapis.com/golang/go1.9.4.darwin-amd64.tar.gz -o go.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
set -o xtrace | ||
curl https://storage.googleapis.com/golang/go1.10.darwin-amd64.tar.gz -o go.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
set -o xtrace | ||
curl https://storage.googleapis.com/golang/go1.9.4.darwin-amd64.tar.gz -o go.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
set -o xtrace | ||
curl https://storage.googleapis.com/golang/go1.10.darwin-amd64.tar.gz -o go.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
set -o xtrace | ||
curl https://storage.googleapis.com/golang/go1.9.4.darwin-amd64.tar.gz -o go.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/usr/bin/python | ||
|
||
# Helper for creating Go build.sh files. This script will create a default build.sh file | ||
# for Go/macOS/Linux versions listed below, unless the directory already exists. If a custom | ||
# build.sh script is needed, just create it and this helper will ignore it going forward. | ||
|
||
import os | ||
from textwrap import dedent | ||
|
||
go_versions = [ | ||
'1.9.4', | ||
'1.10', | ||
] | ||
|
||
mac_versions = [ | ||
'10.8', | ||
'10.9', | ||
'10.10', | ||
'10.11', | ||
'10.12', | ||
'10.13', | ||
] | ||
|
||
tmpl = dedent("""\ | ||
#!/bin/bash | ||
set -o xtrace | ||
curl https://storage.googleapis.com/golang/go{go_version}.{arch}.tar.gz -o go.tar.gz | ||
""") | ||
|
||
def maybe_gen(dir, go_version, arch): | ||
if not os.path.exists(dir): | ||
os.makedirs(dir) | ||
filename = os.path.join(dir, 'build.sh') | ||
with open(filename, 'w') as fh: | ||
fh.write(tmpl.format(go_version=go_version, arch=arch)) | ||
os.chmod(filename, 0755) | ||
|
||
def mac(): | ||
for mac_version in mac_versions: | ||
for go_version in go_versions: | ||
dir = 'build-support/bin/go/mac/%s/%s' % (mac_version, go_version) | ||
maybe_gen(dir, go_version, 'darwin-amd64') | ||
|
||
def x86_64(): | ||
for go_version in go_versions: | ||
dir = 'build-support/bin/go/linux/x86_64/%s' % go_version | ||
maybe_gen(dir, go_version, 'linux-amd64') | ||
|
||
mac() | ||
x86_64() |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like all of the OSX scripts can be symlinks to one copy, since golang doesn't have multiple builds?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But... maybe we don't care. Still trying to work out a good convention here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My thought process for separate files is it's more straightforward, since the place we link to changes over time, so you have to hunt around. Also this was easy to script, at least for Go, though I could see how more involved scripts would be a little different.
If you have a suggestion I'm happy to follow it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I merged as is, but remembered afterward that one of the reasons for the symlinking is that it avoids actually having to run an identical script a dozen times. So I'm going to leave the recommendation as is, and we should try to use symlinks in the future.