Skip to content

Instantly share code, notes, and snippets.

@ptantiku
Last active May 18, 2018 04:20
Show Gist options
  • Save ptantiku/829ea12aa957b0772280a19c6846b253 to your computer and use it in GitHub Desktop.
Save ptantiku/829ea12aa957b0772280a19c6846b253 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Install Java Runtime + Compiler (optional),
# other options: package "default-jdk" will get openjdk-11
sudo apt install openjdk-8-jdk
# install Jenkins
wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -
echo "deb https://pkg.jenkins.io/debian-stable binary/" > /etc/apt/sources.list.d/jenkins.list
sudo apt update
sudo apt install jenkins
# populate Java's certificate store (solution from https://stackoverflow.com/questions/6784463/error-trustanchors-parameter-must-be-non-empty/25188331#25188331)
## 1. Save an empty JKS file with the default 'changeit' password for Java cacerts.
## Use 'printf' instead of 'echo' for Dockerfile RUN compatibility.
/usr/bin/printf '\xfe\xed\xfe\xed\x00\x00\x00\x02\x00\x00\x00\x00\xe2\x68\x6e\x45\xfb\x43\xdf\xa4\xd9\x92\xdd\x41\xce\xb6\xb2\x1c\x63\x30\xd7\x92' > /etc/ssl/certs/java/cacerts
## 2. Re-add all the CA certs into the previously empty file.
/var/lib/dpkg/info/ca-certificates-java.postinst configure
# (Above solution fix this) need to do this to fix broken certificate problem ("This Jenkins instance appears to be offline.")
# sudo sed -i 's/https/http/' /var/lib/jenkins/hudson.model.UpdateCenter.xml
# install Docker
sudo apt remove docker docker-engine docker.io
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo apt update
sudo apt install docker-ce
@ptantiku
Copy link
Author

Plugins:

  • Blue Ocean (for better GUI)
  • S3 publisher
  • Environment File
  • GitHub Integration
  • Node and Label parameter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment