diff options
-rwxr-xr-x | jenkins-scripts/create_jenkins_user.sh | 4 | ||||
-rw-r--r-- | packer/provision/agl_dependencies.sh | 30 | ||||
-rw-r--r-- | packer/provision/agl_hwtest_dependencies.sh | 43 |
3 files changed, 71 insertions, 6 deletions
diff --git a/jenkins-scripts/create_jenkins_user.sh b/jenkins-scripts/create_jenkins_user.sh index 86a5c92d..a8646d8b 100755 --- a/jenkins-scripts/create_jenkins_user.sh +++ b/jenkins-scripts/create_jenkins_user.sh @@ -36,6 +36,10 @@ fi mkdir /home/jenkins/.ssh mkdir /w cp -r /home/${OS}/.ssh/authorized_keys /home/jenkins/.ssh/authorized_keys + +echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQD0EqO61Im8/zCKj4Hg/H26Q3Z4UAjlIePVVu54LfbCIJ7wPLNTBBXBz74cTuiUMF8CbeBwOyWR83NELbSllKnr+wK6pv3h6f7Zn54sQBXjIy11K38CdrMdXxaCIIPBGqJvOy2JukdKuuwfTuXjUk57evoXKJH1aw3Vu3+81gvqCdKlzbWlOP1p0MdvsWVRpOMn27IH2Gz4/nDdwWtIF8YFHAIbWmlCZGiv8/i/nyuLfsC7p6p00qHfxO5KFTsstQe+/f8WkGNaY/Vz124PBic51GsJ+2SfEnDvYSaQvjsf+xPsfQ4Bo6xkz75sN3PYuNOGZX2TQom139b2x18XXzgwSzeZwYhPKN511xBFll5/0/SugWWU+7pNtXUrK+1PZ7zshlch/vaIJzeZCYYRim0yUDM6rLiJ/zqMRO5jvPqpnFjZ9Rz+bqPpLC3mMiEWBdbs9Hxtx3+NhrFVBGlDVoi7sBzDKyrSnuljAZHLaT9rxQquhWLKRUjPZviSb8s544WaQmWDyOTWkPXdN63pVM23EAfi1wVRIyPcLZMdoHQohbh+ePclG2pGfV8hro+aDNyvLcXj1wL8p43elV4d/jPjsePqso7IhyPSghhLCO7lLnrlNVBaI5A+/iUILRHU3LlmKJlErwDmkl1XAJbO0DHDpSwsIDrK1q9Eb7e+C6M8Ww==" >> /home/jenkins/.ssh/authorized_keys +chmod 0600 /home/jenkins/.ssh/authorized_keys + # Generate ssh key for use by Robot jobs echo -e 'y\n' | ssh-keygen -N "" -f /home/jenkins/.ssh/id_rsa -t rsa chown -R jenkins:jenkins /home/jenkins/.ssh /w diff --git a/packer/provision/agl_dependencies.sh b/packer/provision/agl_dependencies.sh index b554ab5e..67b0f9b9 100644 --- a/packer/provision/agl_dependencies.sh +++ b/packer/provision/agl_dependencies.sh @@ -154,4 +154,34 @@ sudo apt-get install golang-go sudo GOOS=darwin GOARCH=amd64 go install -v -a std sudo GOOS=windows GOARCH=amd64 go install -v -a std +useradd -m -s /bin/bash jenkins + +# Check if docker group exists +grep -q docker /etc/group +if [ "$?" == '0' ] +then + # Add jenkins user to docker group + usermod -a -G docker jenkins +fi + +# Check if mock group exists +grep -q mock /etc/group +if [ "$?" == '0' ] +then + # Add jenkins user to mock group so they can build Int/Pack's RPMs + usermod -a -G mock jenkins +fi + +mkdir -p /home/jenkins/.ssh +mkdir /w +cp -r /home/ubuntu/.ssh/authorized_keys /home/jenkins/.ssh/authorized_keys + +echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQD0EqO61Im8/zCKj4Hg/H26Q3Z4UAjlIePVVu54LfbCIJ7wPLNTBBXBz74cTuiUMF8CbeBwOyWR83NELbSllKnr+wK6pv3h6f7Zn54sQBXjIy11K38CdrMdXxaCIIPBGqJvOy2JukdKuuwfTuXjUk57evoXKJH1aw3Vu3+81gvqCdKlzbWlOP1p0MdvsWVRpOMn27IH2Gz4/nDdwWtIF8YFHAIbWmlCZGiv8/i/nyuLfsC7p6p00qHfxO5KFTsstQe+/f8WkGNaY/Vz124PBic51GsJ+2SfEnDvYSaQvjsf+xPsfQ4Bo6xkz75sN3PYuNOGZX2TQom139b2x18XXzgwSzeZwYhPKN511xBFll5/0/SugWWU+7pNtXUrK+1PZ7zshlch/vaIJzeZCYYRim0yUDM6rLiJ/zqMRO5jvPqpnFjZ9Rz+bqPpLC3mMiEWBdbs9Hxtx3+NhrFVBGlDVoi7sBzDKyrSnuljAZHLaT9rxQquhWLKRUjPZviSb8s544WaQmWDyOTWkPXdN63pVM23EAfi1wVRIyPcLZMdoHQohbh+ePclG2pGfV8hro+aDNyvLcXj1wL8p43elV4d/jPjsePqso7IhyPSghhLCO7lLnrlNVBaI5A+/iUILRHU3LlmKJlErwDmkl1XAJbO0DHDpSwsIDrK1q9Eb7e+C6M8Ww==" >> /home/jenkins/.ssh/authorized_keys +chmod 0600 /home/jenkins/.ssh/authorized_keys + +# Generate ssh key for use by Robot jobs +echo -e 'y\n' | ssh-keygen -N "" -f /home/jenkins/.ssh/id_rsa -t rsa +chown -R jenkins:jenkins /home/jenkins/.ssh /w + + exit 0 diff --git a/packer/provision/agl_hwtest_dependencies.sh b/packer/provision/agl_hwtest_dependencies.sh index fd1e1fcc..b8bddf52 100644 --- a/packer/provision/agl_hwtest_dependencies.sh +++ b/packer/provision/agl_hwtest_dependencies.sh @@ -85,12 +85,12 @@ sudo pip3 install --force-reinstall --ignore-installed jinja2 sudo pip3 install --upgrade jinja2 # updates for cloud-init -pip3 install --upgrade oauthlib -pip3 install --upgrade configobj>=5.0.2 -pip3 install --upgrade pyyaml -pip3 install --upgrade requests -pip3 install --upgrade jsonschema -pip3 install --upgrade jsonpatch +sudo pip3 install --upgrade oauthlib +sudo pip3 install --upgrade configobj>=5.0.2 +sudo pip3 install --upgrade pyyaml +sudo pip3 install --upgrade requests +sudo pip3 install --upgrade jsonschema +sudo pip3 install --upgrade jsonpatch python -c "import sys; print sys.path" @@ -100,4 +100,35 @@ sudo pip3 show jinja2 # install go for xds build + +useradd -m -s /bin/bash jenkins + +# Check if docker group exists +grep -q docker /etc/group +if [ "$?" == '0' ] +then + # Add jenkins user to docker group + usermod -a -G docker jenkins +fi + +# Check if mock group exists +grep -q mock /etc/group +if [ "$?" == '0' ] +then + # Add jenkins user to mock group so they can build Int/Pack's RPMs + usermod -a -G mock jenkins +fi + +mkdir -p /home/jenkins/.ssh +mkdir /w +cp -r /home/ubuntu/.ssh/authorized_keys /home/jenkins/.ssh/authorized_keys + +echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQD0EqO61Im8/zCKj4Hg/H26Q3Z4UAjlIePVVu54LfbCIJ7wPLNTBBXBz74cTuiUMF8CbeBwOyWR83NELbSllKnr+wK6pv3h6f7Zn54sQBXjIy11K38CdrMdXxaCIIPBGqJvOy2JukdKuuwfTuXjUk57evoXKJH1aw3Vu3+81gvqCdKlzbWlOP1p0MdvsWVRpOMn27IH2Gz4/nDdwWtIF8YFHAIbWmlCZGiv8/i/nyuLfsC7p6p00qHfxO5KFTsstQe+/f8WkGNaY/Vz124PBic51GsJ+2SfEnDvYSaQvjsf+xPsfQ4Bo6xkz75sN3PYuNOGZX2TQom139b2x18XXzgwSzeZwYhPKN511xBFll5/0/SugWWU+7pNtXUrK+1PZ7zshlch/vaIJzeZCYYRim0yUDM6rLiJ/zqMRO5jvPqpnFjZ9Rz+bqPpLC3mMiEWBdbs9Hxtx3+NhrFVBGlDVoi7sBzDKyrSnuljAZHLaT9rxQquhWLKRUjPZviSb8s544WaQmWDyOTWkPXdN63pVM23EAfi1wVRIyPcLZMdoHQohbh+ePclG2pGfV8hro+aDNyvLcXj1wL8p43elV4d/jPjsePqso7IhyPSghhLCO7lLnrlNVBaI5A+/iUILRHU3LlmKJlErwDmkl1XAJbO0DHDpSwsIDrK1q9Eb7e+C6M8Ww==" >> /home/jenkins/.ssh/authorized_keys +chmod 0600 /home/jenkins/.ssh/authorized_keys + +# Generate ssh key for use by Robot jobs +echo -e 'y\n' | ssh-keygen -N "" -f /home/jenkins/.ssh/id_rsa -t rsa +chown -R jenkins:jenkins /home/jenkins/.ssh /w + + exit 0 |