Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dex
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
dex
Commits
aa6c0c6e
Commit
aa6c0c6e
authored
Dec 13, 2016
by
Eric Chiang
Committed by
GitHub
Dec 13, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #739 from ericchiang/check-go-version
*: check go version before building
parents
71a1d8d4
18bbd94f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
2 deletions
+39
-2
Makefile
Makefile
+6
-2
check-go-version
scripts/check-go-version
+33
-0
No files found.
Makefile
View file @
aa6c0c6e
...
@@ -25,10 +25,10 @@ LD_FLAGS="-w -X $(REPO_PATH)/version.Version=$(VERSION)"
...
@@ -25,10 +25,10 @@ LD_FLAGS="-w -X $(REPO_PATH)/version.Version=$(VERSION)"
build
:
bin/dex bin/example-app
build
:
bin/dex bin/example-app
bin/dex
:
FORCE
bin/dex
:
check-go-version
@
go
install
-v
-ldflags
$(LD_FLAGS)
$(REPO_PATH)
/cmd/dex
@
go
install
-v
-ldflags
$(LD_FLAGS)
$(REPO_PATH)
/cmd/dex
bin/example-app
:
FORCE
bin/example-app
:
check-go-version
@
go
install
-v
-ldflags
$(LD_FLAGS)
$(REPO_PATH)
/cmd/example-app
@
go
install
-v
-ldflags
$(LD_FLAGS)
$(REPO_PATH)
/cmd/example-app
.PHONY
:
release-binary
.PHONY
:
release-binary
...
@@ -88,6 +88,10 @@ bin/protoc: scripts/get-protoc
...
@@ -88,6 +88,10 @@ bin/protoc: scripts/get-protoc
bin/protoc-gen-go
:
bin/protoc-gen-go
:
@
go
install
-v
$(REPO_PATH)
/vendor/github.com/golang/protobuf/protoc-gen-go
@
go
install
-v
$(REPO_PATH)
/vendor/github.com/golang/protobuf/protoc-gen-go
.PHONY
:
check-go-version
check-go-version
:
@
./scripts/check-go-version
clean
:
clean-release
clean
:
clean-release
@
rm
-rf
bin/
@
rm
-rf
bin/
...
...
scripts/check-go-version
0 → 100755
View file @
aa6c0c6e
#!/bin/sh
set
-e
VERSION
=
$(
go version
)
# For development versions of Go, these will be empty.
MAJOR_GOVERSION
=
$(
echo
-n
"
$VERSION
"
|
grep
-o
'go1\.[0-9]'
||
true
)
FULL_GOVERSION
=
$(
echo
-n
"
$VERSION
"
|
grep
-o
'go1\.[0-9|\.]*'
||
true
)
# The list of unsupported major go versions.
UNSUPPORTED
=(
"go1.0"
"go1.1"
"go1.2"
"go1.3"
"go1.4"
"go1.5"
"go1.6"
)
# Minor go verisons which have known security vulnerabilities. Refuse to build with these.
#
# There aren't any security issues that impact dex in 1.7 but minor versions should be
# added here later if they do have issues.
KNOWN_INSECURE
=(
)
for
V
in
"
${
UNSUPPORTED
[@]
}
"
;
do
if
[
"
$V
"
=
"
$MAJOR_GOVERSION
"
]
;
then
>
&2
echo
"ERROR: dex requires Go version 1.7+. Please update your Go installation: https://golang.org/dl/"
exit
2
fi
done
for
V
in
"
${
KNOWN_INSECURE
[@]
}
"
;
do
if
[
"
$V
"
=
"
$FULL_GOVERSION
"
]
;
then
>
&2
echo
"Go version
${
V
}
has known security vulnerabilities which impact dex. Please update your Go verison."
exit
2
fi
done
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment