2 # Copyright (c) 2019 AT&T Intellectual Property.
3 # Copyright (c) 2019 Nokia.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
22 if [ -n "${SSH_PRIVATE_KEY}" ] && [ -n "${PACKAGEREPO}" ] ; then
24 # ssh configs (no private key)
26 test -n "${PACKAGEREPO}" && ssh-keyscan -H ${PACKAGEREPO} >> ${HOME}/.ssh/known_hosts
27 echo -e "IdentityFile ~/.ssh/id_rsa\n" > ${HOME}/.ssh/config
28 echo -e "Host *\n\tStrictHostKeyChecking no\n\n" >> ${HOME}/.ssh/config
29 chmod -R go= ${HOME}/.ssh/
30 chmod -R u+rw ${HOME}/.ssh/
33 test -n "${PACKAGEREPO}" && echo -e "[url \"ssh://git@${PACKAGEREPO}/\"]\n\tinsteadOf = https://${PACKAGEREPO}/" > ${HOME}/.gitconfig
36 TEMPFILE=/dev/shm/deployment.key
37 echo "$SSH_PRIVATE_KEY" > $TEMPFILE
44 if [ -n "${NETRC_CONFIG}" ] ; then
45 echo "${NETRC_CONFIG}" > /root/.netrc