Various fixes to the deb_dpkg build script
[ci-management.git] / jenkins-scripts / basic_settings.sh
1 #!/bin/bash
2 # @License EPL-1.0 <http://spdx.org/licenses/EPL-1.0>
3 ##############################################################################
4 # Copyright (c) 2016 The Linux Foundation and others.
5 #
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Eclipse Public License v1.0
8 # which accompanies this distribution, and is available at
9 # http://www.eclipse.org/legal/epl-v10.html
10 ##############################################################################
11
12 case "$(facter operatingsystem)" in
13   Ubuntu)
14     apt-get update
15     # make sure that the ca-certs are properly updated
16     /usr/sbin/update-ca-certificates
17
18     # attach to the fd.io.dev apt repo
19     echo 'deb http://nexus.fd.io/content/repositories/fd.io.dev/ ./' >> /etc/apt/sources.list
20     ;;
21   *)
22     # Do nothing on other distros for now
23     ;;
24 esac
25
26 IPADDR=$(facter ipaddress)
27 HOSTNAME=$(facter hostname)
28 FQDN=$(facter fqdn)
29
30 echo "${IPADDR} ${HOSTNAME} ${FQDN}" >> /etc/hosts
31
32 #Increase limits
33 cat <<EOF > /etc/security/limits.d/jenkins.conf
34 jenkins         soft    nofile          16000
35 jenkins         hard    nofile          16000
36 EOF
37
38 cat <<EOSSH >> /etc/ssh/ssh_config
39 Host *
40   ServerAliveInterval 60
41
42 # we don't want to do SSH host key checking on spin-up systems
43 # Don't use CIDR since SSH won't parse it
44 # 10.30.48.0/23
45 Host 10.30.48.* 10.30.49.*
46   StrictHostKeyChecking no
47   UserKnownHostsFile /dev/null
48 EOSSH
49
50 cat <<EOKNOWN >  /etc/ssh/ssh_known_hosts
51 [gerrit.fd.io]:29418,[162.253.54.31]:29418 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC76FxV43JIk/HpI5JUZfizmak9znK/QzsjPoNHt/Eo2Vp68kvJIRZ+PzI7RJR0NsdsXlyqzRsGuH+Cj99ZuLVjNMqz1Y1A5y6itYAgT42KDcnV/JoPx6WV+THdQ+oMSp2dINtvD1kc6Om8iAA2CwYOfIZ/FQS5A9OX2xzFopo4qAN3nRk9kpcHyC698R5SDNZBbk6eqlsBz0827KJrSpOSEEMBhtroBM4JV8vImcSWeJuQ5QFdZgQdQaI8R5YFBRbWu3mDSgJfjJk89xT2CkUiqIynNJeiQMM4IZxcdQB3zJ1RUEJepxv77yV09NZ8jwhaN6X659UJZjsCZ5ffvc77
52 EOKNOWN
53
54 # vim: sw=2 ts=2 sts=2 et :