-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathagent-entrypoint
executable file
·39 lines (34 loc) · 1.32 KB
/
agent-entrypoint
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
# create .ssh directory
mkdir -p "${JENKINS_AGENT_HOME}/.ssh"
#readonly JENKINS_PUBKEY="$(cat /var/jenkins_home/.ssh/id_rsa.pub)"
#
#export JENKINS_SLAVE_SSH_PUBKEY=$JENKINS_PUBKEY
#
#docker ps
#
#echo "$JENKINS_SLAVE_SSH_PUBKEY"
#
#echo "JENKINS_SLAVE_SSH_PUBKEY=${JENKINS_SLAVE_SSH_PUBKEY}" >> .env
echo "${JENKINS_AGENT_HOME}"
echo "${HOME}"
whoami
mkdir -p /home/jenkins
mkdir -p /home/jenkins/.ssh
## We cp the ssh keys for jenkins user to its home.
# We copy ssh dir to /home/jenkins to be available for blt.
cp -a /var/jenkins_home/.ssh /home/jenkins/
## We remove and add the Acquia (Dev) host key to the known hosts.
ssh-keygen -R svn-2398.enterprise-g1.hosting.acquia.com
ssh-keyscan -H svn-2398.enterprise-g1.hosting.acquia.com >> /home/jenkins/.ssh/known_hosts
## We Remove and then add the host key.
ssh-keygen -R jenkins.mobomo.net
ssh-keyscan -H jenkins.mobomo.net >> /home/jenkins/.ssh/known_hosts
## We Remove and then re-add the github.com keys.
ssh-keygen -R github.com
ssh-keyscan -H github.com >> /home/jenkins/.ssh/known_hosts
# Git username and email are required by Acquia to be able to push to their repo.
su jenkins -c "git config --global user.name "jenkins""
# We call the entrypoint for the base image
/usr/local/bin/setup-sshd "$@"