-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for glide and go 1.7 from docker
- Loading branch information
1 parent
5fa56fa
commit 95330d6
Showing
11 changed files
with
200 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ tasks.json | |
/cli/debug_cli/main.go | ||
/*/*.iml | ||
/vendor | ||
.glide |
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,25 @@ | ||
FROM golang:1.7.1 | ||
|
||
ENV http_proxy="http://web-proxy.gre.hpecorp.net:8080" \ | ||
https_proxy="http://web-proxy.gre.hpecorp.net:8080" | ||
|
||
ENV APP_NAME forjj | ||
ENV GLIDE_VERSION 0.12.1 | ||
ENV GLIDE_DOWNLOAD_URL https://github.com/Masterminds/glide/releases/download/v${GLIDE_VERSION}/glide-v${GLIDE_VERSION}-linux-amd64.tar.gz | ||
|
||
RUN curl -fsSL "$GLIDE_DOWNLOAD_URL" -o glide.tar.gz \ | ||
&& tar -xzf glide.tar.gz \ | ||
&& mv linux-amd64/glide /usr/bin/ \ | ||
&& rm -r linux-amd64 \ | ||
&& rm glide.tar.gz | ||
# Create a directory inside the container to store all our application and then | ||
# make it the working directory. | ||
RUN mkdir -p /go/src/${APP_NAME} | ||
WORKDIR /go/src/${APP_NAME} | ||
|
||
COPY . /go/src/${APP_NAME} | ||
|
||
RUN glide up \ | ||
&& go build | ||
|
||
|
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 |
---|---|---|
@@ -1,6 +1,19 @@ | ||
#/bin/bash | ||
#/bin/bash -e | ||
|
||
#CGO_ENABLED=0 go install | ||
|
||
BUILD_ENV=forjj-golang-env | ||
|
||
if [ "$http_proxy" != "" ] | ||
then | ||
PROXY="--build-arg http_proxy=$http_proxy --build-arg https_proxy=$http_proxy --build-arg no_proxy=$no_proxy" | ||
fi | ||
|
||
USER="--build-arg UID=$(id -u) --build-arg GID=$(id -g)" | ||
|
||
set -x | ||
sudo docker build -t $BUILD_ENV $PROXY $USER glide | ||
|
||
go install | ||
|
||
scp -P5001 $GOPATH/bin/forjj lacws.emea.hpqcorp.net:/storage/install/published/larsonsh/forjj |
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,22 @@ | ||
#!/bin/bash | ||
# | ||
|
||
if [ "$http_proxy" != "" ] | ||
then | ||
PROXY="-e http_proxy=$http_proxy -e https_proxy=$http_proxy -e no_proxy=$no_proxy" | ||
fi | ||
|
||
USER="-u $(id -u)" | ||
PROJECT="$(basename $(pwd))" | ||
echo "PROJECT = $PROJECT" | ||
|
||
if [ "$GOPATH" = "" ] | ||
then | ||
echo "GOPATH not set. Please set it." | ||
exit 1 | ||
fi | ||
|
||
MOUNT="-v $GOPATH:/go -v $(pwd):/go/src/$PROJECT -w /go/src/$PROJECT" | ||
|
||
sudo docker run --rm -it $MOUNT -t $BUILD_ENV $PROXY $USER forjj-golang-env /usr/bin/glide "$@" | ||
|
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,22 @@ | ||
#!/bin/bash | ||
# | ||
|
||
if [ "$http_proxy" != "" ] | ||
then | ||
PROXY="-e http_proxy=$http_proxy -e https_proxy=$http_proxy -e no_proxy=$no_proxy" | ||
fi | ||
|
||
USER="-u $(id -u)" | ||
PROJECT="$(basename $(pwd))" | ||
echo "PROJECT = $PROJECT" | ||
|
||
if [ "$GOPATH" = "" ] | ||
then | ||
echo "GOPATH not set. Please set it." | ||
exit 1 | ||
fi | ||
|
||
MOUNT="-v $GOPATH:/go -v $(pwd):/go/src/$PROJECT -w /go/src/$PROJECT" | ||
|
||
sudo docker run --rm -it $MOUNT -t $BUILD_ENV $PROXY $USER forjj-golang-env /usr/local/go/bin/go "$@" | ||
|
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,22 @@ | ||
#!/bin/bash | ||
# | ||
|
||
if [ "$http_proxy" != "" ] | ||
then | ||
PROXY="-e http_proxy=$http_proxy -e https_proxy=$http_proxy -e no_proxy=$no_proxy" | ||
fi | ||
|
||
USER="-u $(id -u)" | ||
PROJECT="$(basename $(pwd))" | ||
echo "PROJECT = $PROJECT" | ||
|
||
if [ "$GOPATH" = "" ] | ||
then | ||
echo "GOPATH not set. Please set it." | ||
exit 1 | ||
fi | ||
|
||
MOUNT="-v $GOPATH:/go -v $(pwd):/go/src/$PROJECT -w /go/src/$PROJECT" | ||
|
||
sudo docker run --rm -it $MOUNT -t $BUILD_ENV $PROXY $USER forjj-golang-env bash | ||
|
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,6 @@ | ||
if [ "$FORJJ_PATH" = "" ] | ||
then | ||
FORJJ_PATH=$PATH | ||
export PATH=$(pwd)/bin:$PATH | ||
echo "Build env loaded. To unload it, use 'source build-unset.sh" | ||
fi |
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,5 @@ | ||
if [ "$FORJJ_PATH" != "" ] | ||
then | ||
export PATH=$FORJJ_PATH | ||
unset FORJJ_PATH | ||
fi |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,18 @@ | ||
package: github.hpe.com/christophe-larsonneur/forjj | ||
import: | ||
- package: github.com/alecthomas/kingpin | ||
repo: https://github.com/clarsonneur/kingpin | ||
version: get-commands-from-context | ||
- package: github.com/kr/text | ||
- package: github.com/kvz/logstreamer | ||
- package: github.com/forj-oss/goforjj | ||
- package: github.com/forj-oss/forjj-modules | ||
repo: https://github.com/clarsonneur/forjj-modules | ||
version: new-actions | ||
subpackages: | ||
- trace | ||
- cli | ||
- package: golang.org/x/net | ||
subpackages: | ||
- proxy | ||
- package: gopkg.in/yaml.v2 |
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,17 @@ | ||
FROM golang:1.7.1 | ||
|
||
ARG UID | ||
ARG GID | ||
|
||
ENV GLIDE_VERSION 0.12.1 | ||
ENV GLIDE_DOWNLOAD_URL https://github.com/Masterminds/glide/releases/download/v${GLIDE_VERSION}/glide-v${GLIDE_VERSION}-linux-amd64.tar.gz | ||
|
||
RUN curl -fsSL "$GLIDE_DOWNLOAD_URL" -o glide.tar.gz \ | ||
&& tar -xzf glide.tar.gz \ | ||
&& mv linux-amd64/glide /usr/bin/ \ | ||
&& rm -r linux-amd64 \ | ||
&& rm glide.tar.gz | ||
# Create a directory inside the container to store all our application and then | ||
# make it the working directory. | ||
RUN mkdir -p /go/src && groupadd -g $GID developer && useradd -u $UID -g $GID developer | ||
WORKDIR /go/src |