diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..17fe4f7c0fb76ec2912795e17d0d69d500063672 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +FROM jenkins/jenkins:lts + +USER root + +RUN apt-get -qq update && apt-get install -y \ + curl \ + libltdl7 \ + moreutils \ + python3 \ + python3-pip \ + jq \ + zip \ + && rm -rf /var/lib/apt/lists/* + +RUN pip3 install -q \ + awscli \ + awsebcli \ + yq + +COPY plugins.txt /usr/share/jenkins/ref/plugins.txt +RUN /usr/local/bin/install-plugins.sh < /usr/share/jenkins/ref/plugins.txt + +USER jenkins diff --git a/Dockerrun.aws.json b/Dockerrun.aws.json deleted file mode 100644 index 2284ac5d831d2f6416dc24c07782a4cd9036dab0..0000000000000000000000000000000000000000 --- a/Dockerrun.aws.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "AWSEBDockerrunVersion": "1", - "Authentication": { - "Bucket": "dockerauth.blocpower.org", - "Key": "jenkins.json" - }, - "Image": { - "Name": "blocp/jenkins" - }, - "Volumes": [ - { - "HostDirectory": "/jenkins", - "ContainerDirectory": "/jenkins" - }, - { - "HostDirectory": "/var/run/docker.sock", - "ContainerDirectory": "/var/run/docker.sock" - } - ], - "Ports": [ - { - "HostPort": "80", - "ContainerPort": "8080" - } - ] -} diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..b0c5409295b5ed676cf32456a1fc5b5af17c4566 --- /dev/null +++ b/README.md @@ -0,0 +1,17 @@ +# Jenkins Docker Image +This is the docker image for the BlocPower jenkins image. + +## Docker build & push +aws ecr get-login --no-include-email --region us-east-1 +docker build -t blocp/jenkins . + +docker tag blocp/jenkins:latest 763311425122.dkr.ecr.us-east-1.amazonaws.com/jenkins:latest +docker tag blocp/jenkins:latest 763311425122.dkr.ecr.us-east-1.amazonaws.com/jenkins:1.0 + +docker push 763311425122.dkr.ecr.us-east-1.amazonaws.com/jenkins + +## AWS ECS +aws ecs register-task-definition --cli-input-json file://jenkins.task.json + +## aws.ini +The AWS configuration is contained in the `aws.ini` file in the top-level directory. This is `.gitignore`d so that the key id and secret are not version controlled. Ask for the key if you need to build this docker image. When Jenkins builds itself, it copies its own `aws.ini` into the repository before building the image. diff --git a/parsedockerauth.py b/deprecated/parsedockerauth.py similarity index 100% rename from parsedockerauth.py rename to deprecated/parsedockerauth.py diff --git a/jenkins.task.json b/jenkins.task.json new file mode 100644 index 0000000000000000000000000000000000000000..d503c2d92a8be5fc7f8f42b686715c386793e827 --- /dev/null +++ b/jenkins.task.json @@ -0,0 +1,66 @@ +{ + "family": "jenkins", + "networkMode": "bridge", + "containerDefinitions": [ + { + "name": "jenkins-task", + "image": "763311425122.dkr.ecr.us-east-1.amazonaws.com/jenkins:1.2", + "cpu": 1024, + "memoryReservation": 2048, + "links": [], + "portMappings": [ + { + "containerPort": 8080, + "hostPort": 80, + "protocol": "tcp" + } + ], + "essential": true, + "entryPoint": [], + "command": [], + "environment": [], + "mountPoints": [ + { + "sourceVolume": "jenkins_data", + "containerPath": "/var/jenkins_home", + "readOnly": false + }, + { + "sourceVolume": "docker_socket", + "containerPath": "/var/run/docker.sock", + "readOnly": false + }, + { + "sourceVolume": "docker_engine", + "containerPath": "/usr/bin/docker", + "readOnly": false + } + ], + "volumesFrom": [], + "privileged": true, + "user": "root" + } + ], + "volumes": [ + { + "name": "jenkins_data", + "host": { + "sourcePath": "/home/jenkins/jenkins_data" + } + }, + { + "name": "docker_socket", + "host": { + "sourcePath": "/var/run/docker.sock" + } + }, + { + "name": "docker_engine", + "host": { + "sourcePath": "/usr/bin/docker" + } + } + ], + "placementConstraints": [], + "requiresCompatibilities": [] +} diff --git a/plugins.txt b/plugins.txt new file mode 100644 index 0000000000000000000000000000000000000000..23505136f7d7f3b09a641fb3ea1aca3e59b2297a --- /dev/null +++ b/plugins.txt @@ -0,0 +1,9 @@ +amazon-ecr:1.6 +aws-credentials:1.23 +credentials:2.1.16 +docker-workflow:1.14 +git:3.7.0 +github:1.28.1 +git-parameter:0.9.0 +pipeline-utility-steps:1.5.1 +slack:2.3 diff --git a/readme.md b/readme.md deleted file mode 100644 index f939205393f4e935ebc8e92b66e24745f6ecd9fa..0000000000000000000000000000000000000000 --- a/readme.md +++ /dev/null @@ -1,8 +0,0 @@ -# Jenkins Docker Image -This is the docker image for the BlocPower jenkins image. - -## Overview -This image installs awscli, awsebcli, and git. It then configures awscli. Lastly, it runs jenkins pointing to an external RDS instance (so that users and scripts persist across jenkins deployments). - -## aws.ini -The AWS configuration is contained in the `aws.ini` file in the top-level directory. This is `.gitignore`d so that the key id and secret are not version controlled. Ask for the key if you need to build this docker image. When Jenkins builds itself, it copies its own `aws.ini` into the repository before building the image.