Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

Commit

Permalink
docker scripts: Provide git configuration inside docker container
Browse files Browse the repository at this point in the history
While kernel patching 'git am/apply' is failing with below error:
*** Please tell me who you are.

Run

  git config --global user.email "[email protected]"
    git config --global user.name "Your Name"

    to set your account's default identity.
    Omit --global to set the identity only in this repository.

Though we provide GIT_COMMITTER_{NAME/EMAL} environment, bitbake does not pass
this to do_patch tasks. This patch configures the docker container with proper
git configuration.

Signed-off-by: Amarnath Valluri <[email protected]>
  • Loading branch information
avalluri authored and amarnath committed Sep 23, 2016
1 parent 52a21a3 commit 455e192
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 6 additions & 0 deletions docker/build-project.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ cd $WORKSPACE
# get git commit ID of the project for using in buildhistory tagging
CI_GIT_COMMIT=$(git rev-parse HEAD)

# prepare git config
#NOTE: bitbake does not pass git enviornment to tasks(do_patch),
# hence we need to setup the git configuration
git config --global user.name "$GIT_COMMITTER_NAME"
git config --global user.email "$GIT_COMMITTER_EMAIL"

# FIXME: undbound variables used without checking:
set +u
source ostro-init-build-env
Expand Down
5 changes: 4 additions & 1 deletion docker/local-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ BUILD_CACHE_DIR=$WORKSPACE/bb-cache
BUILDOS="opensuse-42.1"
GIT_PROXY_COMMAND=oe-git-proxy
TARGET_MACHINE="intel-corei7-64"
GIT_COMMITTER_EMAIL=${GIT_COMMITTER_EMAIL:-$(git config --get user.email)}
GIT_COMMITTER_NAME=${GIT_COMMITTER_NAME:-$(git config --get user.name)}
GIT_COMMITTER_NAME=${GIT_COMMITTER_NAME:-${USER}}

BUILD_ARGS="--build-arg uid=`id -u`"
RUN_ARGS=(-u "`id -u`")
Expand Down Expand Up @@ -39,7 +42,7 @@ echo "$BUILD_NUMBER" > $WORKSPACE/.build_number
CI_BUILD_ID="${BUILD_TIMESTAMP}-build-${BUILD_NUMBER}"

# export other vars
for var in WORKSPACE BASE_DISTRO CURRENT_PROJECT BUILD_CACHE_DIR GIT_PROXY_COMMAND CI_BUILD_ID TARGET_MACHINE; do
for var in WORKSPACE BASE_DISTRO CURRENT_PROJECT BUILD_CACHE_DIR GIT_PROXY_COMMAND CI_BUILD_ID TARGET_MACHINE GIT_COMMITTER_NAME GIT_COMMITTER_EMAIL; do
RUN_ARGS+=(-e "$var=${!var}")
done
# Point HOME to WORKSPACE, don't polute real home.
Expand Down

0 comments on commit 455e192

Please sign in to comment.