-
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.
- Loading branch information
1 parent
4fe3cb7
commit ced6607
Showing
15 changed files
with
454 additions
and
177 deletions.
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 |
---|---|---|
|
@@ -10,7 +10,7 @@ fi | |
|
||
cd $BUILD_ENV_PROJECT | ||
|
||
create-build-env.sh | ||
create-go-build-env.sh | ||
|
||
glide i | ||
|
||
|
This file was deleted.
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,45 @@ | ||
#!/bin/bash | ||
# This file is generated by BuildEnv. Avoid updating it manually. | ||
# Instead, contribute to BuildEnv and use 'be-update' | ||
# | ||
|
||
MOD=go | ||
|
||
# From BuildEnv bin/pre-wrapper.sh | ||
|
||
BUILD_SCRIPT_PATH=$(dirname $0) | ||
BUILD_SCRIPT_LIB_PATH=$(dirname $BUILD_SCRIPT_PATH)/lib | ||
|
||
if [[ ! -f $BUILD_SCRIPT_LIB_PATH/run-build-env.sh ]] | ||
then | ||
echo "Unable to load build-env.sh. '$BUILD_SCRIPT_LIB_PATH/run-build-env.sh' not found" | ||
exit 1 | ||
fi | ||
|
||
source $BUILD_SCRIPT_LIB_PATH/run-build-env.sh | ||
|
||
set -e | ||
|
||
if [ "$BUILD_ENV_LOADED" != "true" ] | ||
then | ||
echo "Please go to your project and load your build environment. 'source build-env.sh'" | ||
exit 1 | ||
fi | ||
|
||
cd $BUILD_ENV_PROJECT | ||
|
||
BUILD_ENV=${BE_PROJECT}-$MOD-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 | ||
$BUILD_ENV_DOCKER build -t $BUILD_ENV $PROXY $USER build-env-docker/glide | ||
set +x | ||
|
||
echo "'$BUILD_ENV' image built." | ||
|
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,16 +1,22 @@ | ||
#!/bin/bash | ||
# This file is generated by BuildEnv. Avoid updating it manually. | ||
# Instead, contribute to BuildEnv and use 'be-update' | ||
# | ||
|
||
MOD=go | ||
|
||
# From BuildEnv bin/pre-wrapper.sh | ||
|
||
BUILD_SCRIPT_PATH=$(dirname $0) | ||
BUILD_SCRIPT_LIB=$(dirname $BUILD_SCRIPT_PATH)/lib/run-build-env.sh | ||
BUILD_SCRIPT_LIB_PATH=$(dirname $BUILD_SCRIPT_PATH)/lib | ||
|
||
if [[ ! -f $BUILD_SCRIPT_LIB ]] | ||
if [[ ! -f $BUILD_SCRIPT_LIB_PATH/run-build-env.sh ]] | ||
then | ||
echo "Unable to load build-env.sh. '$BUILD_SCRIPT_LIB' not found" | ||
echo "Unable to load build-env.sh. '$BUILD_SCRIPT_LIB_PATH/run-build-env.sh' not found" | ||
exit 1 | ||
fi | ||
|
||
source $BUILD_SCRIPT_LIB | ||
|
||
do_docker_run forjj-golang-env /usr/bin/glide "$@" | ||
source $BUILD_SCRIPT_LIB_PATH/run-build-env.sh | ||
# From BuildEnv:modules/go/bin/glide.sh | ||
|
||
docker_run ${BE_PROJECT}-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
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,24 @@ | ||
FROM golang:1.7.4 | ||
|
||
MAINTAINER [email protected] | ||
|
||
ARG UID | ||
ARG GID | ||
|
||
ENV GLIDE_VERSION 0.12.3 | ||
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 groupadd -g $GID developer \ | ||
&& useradd -u $UID -g $GID developer \ | ||
&& install -d -o developer -g developer -m 755 /go/src | ||
|
||
COPY go-static /usr/local/go/bin | ||
|
||
WORKDIR /go/src |
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 @@ | ||
#!/bin/sh -e | ||
|
||
export CGO_ENABLED=0 | ||
|
||
DEFAULT_BIN_NAME=$(basename $(pwd)) | ||
|
||
if [ "$1" = "install" ] | ||
then | ||
shift | ||
/usr/local/go/bin/go build "$@" | ||
if [ -x $DEFAULT_BIN_NAME ] | ||
then | ||
mv -v $DEFAULT_BIN_NAME $GOPATH/bin | ||
fi | ||
else | ||
/usr/local/go/bin/go "$@" | ||
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 @@ | ||
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
BE_PROJECT=forjj | ||
export CGO_ENABLED=0 | ||
|
||
source lib/source-be-go.sh # Functions to support GoLang | ||
source lib/source-build-env.sh # Common Build feature and functions | ||
# Build Environment created by buildEnv | ||
BE_PROJECT=forjj | ||
|
||
# Add any module parameters here | ||
|
||
source lib/source-build-env.sh |
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,5 +1,9 @@ | ||
# Function loaded by build-env | ||
unset_build_env | ||
|
||
unset CGO_ENABLED | ||
# Build Environment created by buildEnv | ||
|
||
# unset any module parameters here | ||
|
||
unset_build_env | ||
fcts="`compgen -A function unset`" | ||
unset -f $fcts | ||
unset fcts |
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,21 +1,10 @@ | ||
# Common Build env functions | ||
# Introduction | ||
|
||
This directory contains common functions called at source time in | ||
bin/shell scripts. | ||
This directory is maintained by BuildEnv (https://github.com/forj-oss/build-env) | ||
|
||
# TODO | ||
When you need to update it (bugs/features), refresh it as follow: | ||
|
||
In order to share the same code and stabilize it, we will need to | ||
centralize this file with a procedure to update the source code | ||
from the central build-env repo. | ||
1. load your build env with `build-env` or `source build-env.sh` | ||
2. refresh it with `be-update` | ||
|
||
In that way, the build-env can get fixes easily, reproducible. | ||
|
||
I imagine to define which kind of project to may be generate such files | ||
in bin/ like glide/go or inenv. | ||
|
||
If the project type Golang, to maintain this Golang build env. | ||
|
||
|
||
C Larsonneur | ||
Forj team | ||
This will update BuildEnv wrappers (bin/) and BuildEnv libs (lib/) |
Oops, something went wrong.