kopia lustrzana https://github.com/c9/core
make sure to use the right ssh key for github
rodzic
737d03271f
commit
2533e3b0d3
|
@ -40,6 +40,7 @@ RUN apt-get install -y haproxy
|
||||||
RUN apt-get install -y git
|
RUN apt-get install -y git
|
||||||
|
|
||||||
ADD files/ssh_config /home/ubuntu/.ssh/config
|
ADD files/ssh_config /home/ubuntu/.ssh/config
|
||||||
|
RUN chown -R ubuntu:ubuntu /home/ubuntu/.ssh
|
||||||
|
|
||||||
USER ubuntu
|
USER ubuntu
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,32 @@
|
||||||
|
|
||||||
|
|
||||||
_b9_npm() {
|
_b9_npm() {
|
||||||
local WORKDIR=$1
|
local WORKDIR=$1
|
||||||
shift
|
shift
|
||||||
docker run --rm -w /home/ubuntu/newclient -v $WORKDIR:/home/ubuntu/newclient -v $HOME/.ssh:/home/ubuntu/.ssh:ro --sig-proxy -a STDIN -a STDOUT -a STDERR $(_b9_get_newclient_image) npm "$@"
|
docker run \
|
||||||
|
--rm \
|
||||||
|
-w /home/ubuntu/newclient \
|
||||||
|
-v $WORKDIR:/home/ubuntu/newclient \
|
||||||
|
--sig-proxy -a STDIN -a STDOUT -a STDERR \
|
||||||
|
$(_b9_get_newclient_image) bash -c "
|
||||||
|
echo \"$(_b9_npm_get_github_ssh)\" >> /home/ubuntu/.ssh/id_rsa_deploy
|
||||||
|
chmod 600 /home/ubuntu/.ssh/id_rsa_deploy
|
||||||
|
npm "$@"
|
||||||
|
"
|
||||||
# pushd $WORKDIR
|
# pushd $WORKDIR
|
||||||
# npm "$@"
|
# npm "$@"
|
||||||
# popd
|
# popd
|
||||||
|
}
|
||||||
|
|
||||||
|
_b9_npm_get_github_ssh() {
|
||||||
|
local FILE
|
||||||
|
for FILE in "$B9_GITHUB_SSH_FILE" ~/.ssh/id_rsa_c9robot ~/.ssh/id_rsa_deploy ~/.ssh/id_rsa; do
|
||||||
|
if [ -e "$FILE" ]; then
|
||||||
|
cat $FILE
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "Can't find SSH key for Github" 1>&2
|
||||||
|
exit 1
|
||||||
}
|
}
|
Ładowanie…
Reference in New Issue