All Projects → schottsfired → cjp-demo-environment

schottsfired / cjp-demo-environment

Licence: other
CloudBees CI Demo based on Docker Compose

Programming Languages

Makefile
30231 projects
shell
77523 projects

Projects that are alternatives of or similar to cjp-demo-environment

pipeline-as-yaml-plugin
Jenkins Pipeline As Yaml Plugin
Stars: ✭ 111 (+382.61%)
Mutual labels:  jenkins
audit-log-plugin
Audit logging plugin for Jenkins based on Apache Log4j Audit
Stars: ✭ 19 (-17.39%)
Mutual labels:  jenkins
mailer-plugin
This plugin allows you to configure email notifications for build results
Stars: ✭ 35 (+52.17%)
Mutual labels:  jenkins
MasterSeleniumFramework
Automation Testing | Web | Java | OOPS | Selenium WebDriver | TestNG | Maven | ExtentReport | Allure Reports | Java mail API | Design Patterns (Page Object Model, Singleton) | Jenkins | Data-Driven Testing using JSON file
Stars: ✭ 52 (+126.09%)
Mutual labels:  jenkins
artifact-promotion-plugin
A simple Jenkins plugin to promote artifacts.
Stars: ✭ 29 (+26.09%)
Mutual labels:  jenkins
jenkins-pipeline
Jenkins Pipeline Shared Library
Stars: ✭ 16 (-30.43%)
Mutual labels:  jenkins
configuration-as-code-secret-ssm-plugin
AWS SSM Plugin for Jenkins Configuration as Code
Stars: ✭ 22 (-4.35%)
Mutual labels:  jenkins
black-postoffice
[무신사 신입] 익명으로 편하게 고민, 일상을 공유하는 소셜 네트워크 서비스입니다.
Stars: ✭ 31 (+34.78%)
Mutual labels:  jenkins
jenni
👩‍💻 Jenkins Personal Assistant - CLI to interact with Jenkins server
Stars: ✭ 40 (+73.91%)
Mutual labels:  jenkins
aliyun-oss-uploader-plugin
Aliyun/AliCloud OSS uploader
Stars: ✭ 26 (+13.04%)
Mutual labels:  jenkins
ebook-continuous-delivery-with-kubernetes-and-jenkins
Continuous Delivery for Java Apps: Build a CD Pipeline Step by Step Using Kubernetes, Docker, Vagrant, Jenkins, Spring, Maven and Artifactory
Stars: ✭ 39 (+69.57%)
Mutual labels:  jenkins
aqua-microscanner-plugin
Enables scanning of docker builds in Jenkins for OS package vulnerabilities.
Stars: ✭ 37 (+60.87%)
Mutual labels:  jenkins
docker-jenkins-dsl-ready
Docker image providing Jenkins ready to go with the DSL and JCasC plugins
Stars: ✭ 36 (+56.52%)
Mutual labels:  jenkins
build-user-vars-plugin
Set of environment variables that describe the user who started the build
Stars: ✭ 40 (+73.91%)
Mutual labels:  jenkins
Real Time Social Media Mining
DevOps pipeline for Real Time Social/Web Mining
Stars: ✭ 22 (-4.35%)
Mutual labels:  jenkins
mp-ci
微信小程序、小游戏发布助手(CI)
Stars: ✭ 76 (+230.43%)
Mutual labels:  jenkins
ecutest-plugin
This plugin integrates Jenkins with ECU-TEST and generates reports on automated test execution.
Stars: ✭ 23 (+0%)
Mutual labels:  jenkins
intelirest-cli
A cli interpreter for intelliJ .http files
Stars: ✭ 23 (+0%)
Mutual labels:  jenkins
cloud-s4-sdk-pipeline
The Cloud SDK pipeline uses the Cloud SDK continuous delivery server for building, checking, and deploying extension applications. Projects based on the SAP Cloud SDK archetype will automatically use this pipeline.
Stars: ✭ 65 (+182.61%)
Mutual labels:  jenkins
kubetools
Kubetools - Curated List of Kubernetes Tools
Stars: ✭ 674 (+2830.43%)
Mutual labels:  jenkins

Docker Compose Demo Environment for CloudBees CI Traditional

A great way to run CloudBees CI on your laptop, with support for "Docker stuff"!

Feel free to clone/fork/extend this repo to meet your specific needs, and shoot me a PR if I missed anything!

My goal for this repo is to help people learn about CloudBees CI and Docker while journeying through the README below.

What does this include?

NOTE: All services are intended to run on the same host in this example, but similar practices can be applied to e.g. Docker Swarm (multi host) setups.

Prerequisites

Go get Docker for Mac.

NOTE: Docker on Docker support has not been tested on other platforms.

  1. Increase CPU/Memory limits in Docker preferences to as much as you can spare (e.g. CPU: 4, Memory: 6GB).

  2. Open terminal and type:

     sudo vi /etc/hosts
    

    then add (or append) this entry:

     127.0.0.1 cjp.local
    

    so that your host file will look like the following example:

     ##
     # Host Database
     #
     # localhost is used to configure the loopback interface
     # when the system is booting.  Do not change this entry.
     ##
     127.0.0.1       localhost
     127.0.0.1       cjp.local
     255.255.255.255 broadcasthost
     ::1             localhost	
    
  3. Create a file called .env in the project directory (alongside docker-compose.yml) and copy everything into it from the provided .env.sample. Update the MAVEN_CACHE so that it's specific to your environment. If you don't have a Maven cache, or want to use additional/other caches, then update (or remove) the ssh-agent: volumes: in docker-compose.yml accordingly. For now this is the only change needed in .env.

  4. Create a Docker network by running this from the project directory:

     make network
    

How to run (and restart after shutting down)

Simply type the following command

docker-compose up -d

..from the project directory, and wait a while :)

You can view logs (and safely ctrl+c out of them) via:

docker-compose logs -t -f

To stop all runnning containers, run the following command:

docker-compose down

Important directories like JENKINS_HOME(s), Nginx logs, etc. are volume mapped (persisted) to the working project directory. Treat JENKINS_HOME directories (under ./data/...) with care, and consider regular backups.

Post-Startup Checklist

Connect Client Controllers (one time)

  1. Navigate to CJOC at http://cjp.local/cjoc and retrieve the initial admin password using docker exec -it cjoc cat /var/jenkins_home/secrets/initialAdminPassword

  2. Activate CJOC using the recommended settings

  3. Follow the same process for http://cjp.local/cje-prod and http://cjp.local/cje-test, again with recommended settings

  4. In CJOC, create Client Controller items for cje-prod and cje-test, and use the URLs from step 2 to make the connection

Connect ssh-agent as a Shared Agent (one time)

  1. exec into the CJOC container and generate a key pair:

     docker exec -it cjoc bash
    
     ssh-keygen
    
  2. Stick with the defaults and choose a password (or leave blank).

  3. Copy your private key to a text editor:

     cat /var/jenkins_home/.ssh/id_rsa
    
  4. In CJOC, click "Credentials", "System", "Global credentials (unrestricted)", "Add Credentials", select SSH Username with private key. Enter jenkins as the username and select Enter Directly for the Private key option.

  5. In .env, replace SSH_AGENT_COMMAND with the public key that was just generated, save, and refresh the environment with docker-compose up

  6. Create a Shared Agent item in CJOC (named e.g. shared-ssh-agent), using the credentials above, host: ssh-agent, and a Remote FS root of /home/jenkins. Give it some labels, like shared, ssh, docker, docker-cloud.

Add JNLP Agent(s) to a Shared Cloud (config once, then repeat step 4)

  1. Add a Shared Cloud item in CJOC (named e.g. shared-cloud). Remote FS root is /home/jenkins. Give it some labels, like shared, jnlp, java-build-tools, docker, docker-cloud and click Save. You should now be taken to a screen that displays the agent command to run.

  2. In .env, replace SHARED_CLOUD_NAME if needed, and replace JNLP_SLAVE_COMMAND with the -secret you find the Jenkins UI, then save your changes.

  3. Build the JNLP agent:

     make build-jnlp-agent
    
  4. Launch a JNLP agent into the Shared Cloud, repeatedly if desired:

     make jnlp-agent
    
  5. Finally, destroy all JNLP agents:

     make destroy-jnlp
    

What Next?

Automate all the things!

Consider the following plugins

Miscellaneous

Upgrades

Please refer to the Releases Page for upgrade instructions.

Docker on Docker (a.k.a "Docker inception")

Is supported by the following services:

  • cje-test
  • ssh-agent
  • jnlp-agent
  • docker-service (tcp://docker-service:2375)

When executing a docker command from within these containers, the Docker client installed inside the container communicates with the Docker server outside the container. This magic is provided by Docker socket volume mapping; see -v /var/run/docker.sock:/var/run/docker.sock in docker-compose.yml. For more information, read this famous blog post.

Pro tips

  • See what's running:

      docker ps
    
  • Shutdown command(s):

      docker-compose down
    
      make destroy-jnlp
    
  • Clean Docker after shutting down:

      make clean
    
  • Tail the logs for a running container:

      docker logs -f $CONTAINER_NAME_OR_ID
    
  • Open an interactive terminal on a running container:

      docker exec -it $CONTAINER_NAME_OR_ID sh
    
  • Run a command within a container immediately, e.g. to test networking

      docker exec -it $CONTAINER_NAME_OR_ID ping cjp.proxy
    
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].