Skip to content

Commit

Permalink
Assign value to PRIV_KEY env variable
Browse files Browse the repository at this point in the history
The content of Private key stored in ~/.ssh/gerrit is stored in an environment variable PRIV_KEY which is then passed to the container.
  • Loading branch information
Athmika-HS committed Mar 28, 2022
1 parent b42915f commit 0a2d096
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions bin/docker-execute
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ REPO_NAME=$1
PACKAGE_NAME=$2
HELP=false
REBUILD=false
PRIVKEY==$(cat $HOME/.ssh/gerrit)

echo "package: $2"
echo "Image: $IMAGE_NAME"
echo "UID: $(id -u)"
echo "GID: $(id -g)"
echo "PRIV KEY : $PRIVKEY"
# Enable docker buildkit with inline cache builds
export DOCKER_BUILDKIT=1

Expand Down Expand Up @@ -229,6 +231,7 @@ docker run --privileged=true -dit \
-e PACKAGE_NAME=$PACKAGE_NAME \
-e REPO_NAME=$REPO_NAME \
-e SSH_KEY=$SSH_KEY \
-e PRIVKEY=$PRIVKEY \
--env "LOCAL_GITHUB_ACCESS_TOKEN=$LOCAL_GITHUB_ACCESS_TOKEN" \
"${DOCKER_OPTS[@]}" \
--cap-add=SYS_PTRACE \
Expand Down

0 comments on commit 0a2d096

Please sign in to comment.