GithubHelp home page GithubHelp logo

alexanderb1290 / bamboo-agent Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 1.0 75 KB

Bamboo agent with Docker, Maven, Sonar Scanner and Cron capabilities

License: GNU General Public License v3.0

Dockerfile 19.70% Shell 31.08% Mustache 49.22%
atlassian atlassian-bamboo bamboo-agent cron docker maven sonar-scanner

bamboo-agent's Introduction

Bamboo agent - Ready to run!

A Bamboo Agent is a service that can run job builds. Each agent has a defined set of capabilities and can run builds only for jobs whose requirements match the agent's capabilities. To learn more about Bamboo, see: https://www.atlassian.com/software/bamboo

The following Bamboo docker image agents is extension of Atlassian's Bamboo base image.

Table of Content

Overview

This Docker container makes it easy to get a Bamboo Remote Agent up and running. It is intended to be used as a ready to run Bamboo agent in K8S cluster and have the following capabilities:

  • JDK 11
  • Git & Git LFS
  • Maven 3.8.6
  • Python 3
  • Sonar Scanner 4.7
  • Docker in Docker (DinD) 20.10

Prerequisites

The following prerequisites are required in addition to run this docker image:

  • Installed helm
  • Installed and configured K8S cluster. Note that the configuration describe the process using microk8s.
  • Persistent volume and claim for caching Bamboo jobs and docker images

Configuration

Before you can start using the docker image as full fledge agent, there are some additional configurations that need to be performed.

  1. Make sure your Bamboo server is running and has remote agents support enabled. To enable it, go to Administration > Agents console.
  2. Update Docker Hub credentials to avoid docker pull rate limit.
    • Navigate to the file secrets/dockerpwd.txt and provide your password or Docker Hub authentication token (recommended).
    • Update the authentication username for Docker Hub in the file scripts/config/docker.sh
  3. Create K8S secret containing Bamboo security token
    kubectl create secret generic bamboo-agent-security-token --from-literal=security-token=<Bamboo_Server_Token>
  4. Create K8S local persistent volume and claim for caching Bamboo builds and docker images.
    • Update the provided volume definitions from the k8s folder - change the capacity, host path or type.
    • Create the persistent volumes and their corresponding claims.
    kubectl create -f k8s/build-dir-caching.yaml
    kubectl create -f k8s/mvn-docker-caching.yaml
  5. Build and push your docker image to Docker Hub private repository.
    docker build -t <docker hub repo>/<image name>:<image version> .
    docker push <docker hub repo>/<image name>:<image version>
  6. Update the helm-chart/values/values.yaml for the updated Helm charts or create a new values to use.
    • Provide your docker image from Docker Hub
    • Provide your credentials for Docker Hub
  7. Deploy the Bamboo agents using the updated Helm Charts
    helm install bamboo-agent helm-chart/bamboo-agent/ --values helm-chart/bamboo-agent/values.yaml --wait

Extending the capabilities of the image

This Docker image contains most used capabilities for building docker images and Maven project. If you need additional capabilities you can extend the image to suit your needs. Using the scripts from their corresponding the folder, new capabilities can be installed, configured, started and stopped.

scripts/
├─ install/
├─ config/
├─ start/
├─ install.all.sh
├─ config.all.sh
├─ start.all.sh

Installation scripts

To install a new capability create a shell script under the folder scripts/install with an appropriate name and add the required commands to install the capability.

After that add the path to the script to scripts/install.all.sh, so the capability can be installed during building of the docker image. This installation script is ran first. If you require additional packages, you can add them to the scripts/install/preqreuisites.sh which is taking care of installing any additional packages.

Configuration scripts

To configure an installed capability create a shell script under the folder scripts/config with an appropriate name and add the required commands to configure the installed capability.

After that add the path to the script to scripts/config.all.sh, so the installed capability can be configured after its installation during building of the docker image. Note that first the script for installing all capabilities is run before running the script for configuring the capabilities.

Start-Up scripts

To start any services or run specific commands during starting of the container, create a script under the folder scripts/start with an appropriate name and add the required commands for starting or running commands during start up of the container.

After that add the path to script to scripts/start.all.sh, which is run when the container is starting, but before starting the Bamboo agent executable.

Note the following:

  • The start-up script need to complete under 120 seconds (2 minute), otherwise you will need to edit the values for startupProbe and readinessProbe to increase the timeout limit.
  • Running start-up scripts after starting the Bamboo agent, need to be run without elevated permissions, as non-root user.

bamboo-agent's People

Contributors

alexanderb1290 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

voarsh2

bamboo-agent's Issues

Crontab

Add configuration and start scripts for Cron. Cron will be used to clean up docker images and redundant artifacts.

K8S descriptors for volume

Add example K8S descriptor for persistent volumes used for caching docker images and maven repository data

Helm charts

Download official Atlassian helm charts for bamboo agent and update them to include persistent storage for docker images and maven repository data.

Documentation

Provide detailed documentation for updating, configuring and using the docker image.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.