You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
2.0KB

  1. #!/bin/sh
  2. set -e -x
  3. # Adding new entrypoint
  4. mv /resources/dockerd-entrypoint /usr/local/bin
  5. mv /resources/jenkins-slave /usr/local/bin
  6. # Installing needed Packages
  7. apk add --update --no-cache \
  8. python2=$PYTHON2_VERSION \
  9. openjdk8=$JAVA_VERSION \
  10. bzr=$BZR_VERSION \
  11. git=$GIT_VERSION \
  12. curl=$CURL_VERSION \
  13. mercurial=$MERCURIAL_VERSION \
  14. openssh-client=$OPENSSH_VERSION \
  15. subversion=$SUBVERSION_VERSION \
  16. procps=$PROCPS_VERSION \
  17. bzip2=$BZIP2_VERSION \
  18. unzip=$UNZIP_VERSION \
  19. xz=$XZ_VERSION \
  20. jq=$JQ_VERSION \
  21. iptables=$IPTABLES_VERSION \
  22. e2fsprogs=$E2FSPROGS_VERSION \
  23. wget=$WGET_VERSION \
  24. zip=$ZIP_VERSION \
  25. bash=$BASH_VERSION \
  26. groff=$GROFF_VERSION \
  27. py2-pip=$PY2PIP_VERSION
  28. # Installing jnlp
  29. curl --create-dirs \
  30. -sSLo /usr/share/jenkins/slave.jar \
  31. https://repo.jenkins-ci.org/public/org/jenkins-ci/main/remoting/${JNLP_VERSION}/remoting-${JNLP_VERSION}.jar
  32. chmod 755 /usr/share/jenkins
  33. chmod 644 /usr/share/jenkins/slave.jar
  34. # Installing Google Cloud SDK
  35. cd /resources
  36. wget https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-${GCLOUDSDK_VERSION}-linux-x86_64.tar.gz
  37. tar -xzf /resources/google-cloud-sdk-${GCLOUDSDK_VERSION}-linux-x86_64.tar.gz
  38. mkdir /opt || true
  39. mv google-cloud-sdk /opt/google-cloud-sdk
  40. /opt/google-cloud-sdk/install.sh
  41. # Installing kubectl
  42. curl -LO https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_VERSION}/bin/linux/amd64/kubectl
  43. chmod +x ./kubectl
  44. mv ./kubectl /usr/local/bin/kubectl
  45. # Installing AWS CLI
  46. pip install awscli==${AWSCLI_VERSION}
  47. # Installing Helm
  48. curl -L https://storage.googleapis.com/kubernetes-helm/helm-v${HELM_VERSION}-linux-amd64.tar.gz -o /resources/helm.tar.gz
  49. tar -xzf /resources/helm.tar.gz
  50. chmod +x linux-amd64/helm
  51. mv linux-amd64/helm /usr/local/bin/helm
  52. rm -rf linux-amd64
  53. helm init -c
  54. # Installing helm push plugin
  55. helm plugin install \
  56. https://github.com/chartmuseum/helm-push \
  57. --version "v${HELM_PLUGIN_PUSH_VERSION}"
  58. ### Hardening
  59. touch /etc/login.defs
  60. chmod 0444 /etc/login.defs
  61. chmod 0600 /etc/shadow