Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
keycloak-proxy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Janne Mareike Koschinski
keycloak-proxy
Commits
6e112718
Commit
6e112718
authored
Jan 15, 2016
by
Rohith
Browse files
Options
Downloads
Plain Diff
Merge pull request #10 from gambol99/build
Build
parents
bae1f773
a776ef8c
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
Makefile
+22
-3
22 additions, 3 deletions
Makefile
build.go
+3
-0
3 additions, 0 deletions
build.go
main.go
+2
-2
2 additions, 2 deletions
main.go
with
27 additions
and
5 deletions
Makefile
+
22
−
3
View file @
6e112718
...
@@ -2,7 +2,10 @@
...
@@ -2,7 +2,10 @@
NAME
=
keycloak-proxy
NAME
=
keycloak-proxy
AUTHOR
=
gambol99
AUTHOR
=
gambol99
HARDWARE
=
$(
shell
uname
-m
)
HARDWARE
=
$(
shell
uname
-m
)
VERSION
=
$(
shell
awk
'/version =/ { print $$3
}
'
doc.go |
sed
's/"//g'
)
GOVERSION
=
1.5.3
GIT_COMMIT
=
$(
shell git log
--pretty
=
format:
'%h'
-n
1
)
ROOT_DIR
=
${
PWD
}
VERSION
=
$(
shell
awk
'/version.*=/ { print $$3
}
'
doc.go |
sed
's/"//g'
)
DEPS
=
$(
shell go list
-f
'{{range .TestImports
}
}{{.}} {{end}}'
./...
)
DEPS
=
$(
shell go list
-f
'{{range .TestImports
}
}{{.}} {{end}}'
./...
)
PACKAGES
=
$(
shell go list ./...
)
PACKAGES
=
$(
shell go list ./...
)
VETARGS
?=
-asmdecl
-atomic
-bool
-buildtags
-copylocks
-methods
-nilfunc
-printf
-rangeloops
-shift
-structtags
-unsafeptr
VETARGS
?=
-asmdecl
-atomic
-bool
-buildtags
-copylocks
-methods
-nilfunc
-printf
-rangeloops
-shift
-structtags
-unsafeptr
...
@@ -11,16 +14,31 @@ VETARGS?=-asmdecl -atomic -bool -buildtags -copylocks -methods -nilfunc -printf
...
@@ -11,16 +14,31 @@ VETARGS?=-asmdecl -atomic -bool -buildtags -copylocks -methods -nilfunc -printf
default
:
build
default
:
build
build
:
golang
:
@
echo
"--> Go Version"
@
go version
buildtags
:
golang
@
echo
"--> Adding the build tags"
@
echo
"package main"
>
build.go
@
echo
""
>>
build.go
@
echo
"const buildID =
\"
$(
VERSION
)
, git+sha:
${
GIT_COMMIT
}
\"
"
>>
build.go
build
:
buildtags
@
echo
"--> Compiling the project"
@
echo
"--> Compiling the project"
mkdir
-p
bin
mkdir
-p
bin
godep go build
-o
bin/
${
NAME
}
godep go build
-o
bin/
${
NAME
}
static
:
static
:
buildtags deps
@
echo
"--> Compiling the static binary"
@
echo
"--> Compiling the static binary"
mkdir
-p
bin
mkdir
-p
bin
CGO_ENABLED
=
0
GOOS
=
linux godep go build
-a
-tags
netgo
-ldflags
'-w'
-o
bin/
${
NAME
}
CGO_ENABLED
=
0
GOOS
=
linux godep go build
-a
-tags
netgo
-ldflags
'-w'
-o
bin/
${
NAME
}
docker-build
:
@
echo
"--> Compiling the project"
sudo
docker run
--rm
-v
${
ROOT_DIR
}
:/go/src/github.com/gambol99/keycloak-proxy
\
-w
/go/src/github.com/gambol99/keycloak-proxy
-e
GOOS
=
linux golang:
${
GOVERSION
}
make static
docker
:
static
docker
:
static
@
echo
"--> Building the docker image"
@
echo
"--> Building the docker image"
sudo
docker build
-t
docker.io/
${
AUTHOR
}
/
${
NAME
}
:
${
VERSION
}
.
sudo
docker build
-t
docker.io/
${
AUTHOR
}
/
${
NAME
}
:
${
VERSION
}
.
...
@@ -40,6 +58,7 @@ authors:
...
@@ -40,6 +58,7 @@ authors:
deps
:
deps
:
@
echo
"--> Installing build dependencies"
@
echo
"--> Installing build dependencies"
@
go get github.com/tools/godep
@
go get
-d
-v
./...
$(
DEPS
)
@
go get
-d
-v
./...
$(
DEPS
)
vet
:
vet
:
...
...
This diff is collapsed.
Click to expand it.
build.go
0 → 100644
+
3
−
0
View file @
6e112718
package
main
const
buildID
=
"v0.0.5, git+sha: da94978"
This diff is collapsed.
Click to expand it.
main.go
+
2
−
2
View file @
6e112718
...
@@ -32,7 +32,7 @@ func main() {
...
@@ -32,7 +32,7 @@ func main() {
kc
:=
cli
.
NewApp
()
kc
:=
cli
.
NewApp
()
kc
.
Name
=
prog
kc
.
Name
=
prog
kc
.
Usage
=
description
kc
.
Usage
=
description
kc
.
Version
=
version
kc
.
Version
=
buildID
kc
.
Author
=
author
kc
.
Author
=
author
kc
.
Email
=
email
kc
.
Email
=
email
kc
.
Flags
=
getOptions
()
kc
.
Flags
=
getOptions
()
...
@@ -75,6 +75,6 @@ func main() {
...
@@ -75,6 +75,6 @@ func main() {
// printUsage display the command line usage and error
// printUsage display the command line usage and error
func
printUsage
(
message
string
)
{
func
printUsage
(
message
string
)
{
fmt
.
Fprintf
(
os
.
Stderr
,
"[error] %s"
,
message
)
fmt
.
Fprintf
(
os
.
Stderr
,
"[error] %s
\n
"
,
message
)
os
.
Exit
(
1
)
os
.
Exit
(
1
)
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment