Skip to content

Instantly share code, notes, and snippets.

@andreasneuber
Last active July 19, 2020 18:13
Show Gist options
  • Select an option

  • Save andreasneuber/cbc54c2269695e5c91963b45a934d8c5 to your computer and use it in GitHub Desktop.

Select an option

Save andreasneuber/cbc54c2269695e5c91963b45a934d8c5 to your computer and use it in GitHub Desktop.

Revisions

  1. andreasneuber revised this gist Jul 19, 2020. No changes.
  2. andreasneuber renamed this gist Jul 19, 2020. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. andreasneuber created this gist Jul 19, 2020.
    30 changes: 30 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,30 @@
    # Create a Ubuntu Server 18.04 LTS instance
    # Associate an Elastic IP to instance - https://docs.bitnami.com/aws/faq/configuration/configure-static-address/
    # Add inbound security group rule..
    # Custom TCP TCP 8080 0.0.0.0/0

    # Install Java and Docker
    sudo apt update
    sudo apt install -y openjdk-8-jdk
    sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
    sudo apt update
    sudo apt install -y docker-ce
    sudo usermod -aG docker ${USER}
    #Logout-Login
    # Confirm with $ id -nG
    sudo usermod -aG docker jenkins
    sudo service jenkins restart
    docker
    java -version

    wget -q -O - https://pkg.jenkins.io/debian/jenkins-ci.org.key | sudo apt-key add -
    sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
    sudo apt update
    sudo apt install -y jenkins
    systemctl status jenkins

    # Call Elastic IP in browser like: http://<IP>:8080
    sudo cat /var/lib/jenkins/secrets/initialAdminPassword

    # Continue with usual setup in browser