atomist-attic / sample-sdm

Sample Software Delivery Machine
Apache License 2.0
0 stars 2 forks source link
docker node

sample-sdm

Instance of an Atomist Software Delivery Machine that can be used as a sample or run for real on your Java and TypeScript projects.

What is a Software Delivery Machine?

A software delivery machine is a development process in a box.

It automates all steps in the flow from commit to production (potentially via staging environments), and many other actions, using the consistent model provided by the Atomist API for software.

Many teams have a blueprint in their mind for how they'd like to deliver software and ease their day to day work, but find it hard to realize. A Software Delivery Machine makes it possible.

The concept is explained in detail in Rod Johnson's blog Why you need a Software Delivery Machine. This video shows it in action.

Please see the Atomist SDM library for explanation on what an SDM can do. The present document describes how to get yours running.

Get Started

This delivery machine feeds on the Atomist API. You'll need to be a member of an Atomist workspace to run it. Create your own by enrolling at atomist.com.

Things work best if you install an org webhook, so that Atomist receives events for all your GitHub repos.

Get your Software Delivery Machine

If the Atomist bot is in your Slack team, type @atomist create sdm to have Atomist create a personalized version of this repository for you.

You can fork and clone this repository.

Run Locally

This is an Atomist automation client. See run an automation client for instructions on how to set up your environment and run it under Node.js.

See integrations for additional prerequisites according to the projects you're building.

The client logs to the console so you can see it go. Once it runs, here are some things to do:

Start a new project

In Slack, @atomist create spring. This will create a Spring Boot repository. The SDM will build it!

To enable deployment beyond the local one, @atomist enable deploy.

Push to an existing repository

If you have any Java or Node projects in your GitHub org, try linking one to a Slack channel (@atomist link repo), and then push to it. You'll see Atomist react to the push, and the SDM might have some Goals it can complete.

Customize

Every organization has a different environment and different needs. Your software delivery machine is yours: change the code and do what helps you.

In atomist.config.ts, you can choose the machine to start with. cloudFoundryMachine and k8sMachine take care of the whole delivery process from project creation through deployment, while other machines focus only on one aspect, such as project creation, static analysis or autofixing problems in repositories.

Atomist is about developing your development experience by using your coding skills. Change the code, restart, and see your new automations and changed behavior across all your projects, within seconds.

The rest of this README describes some changes you might make.

About this Software Delivery Machine

Implementations of Atomist

Atomist is a flexible system, enabling you to build your own automations or use those provided by Atomist or third parties.

This repository is a reference implementation of Atomist, which focuses on the goals of a typical delivery flow. You can fork it and modify it as the starting point for your own Atomist implementation, or use it purely as a reference.

Concepts

This repository shows how Atomist can automate important tasks and improve your delivery flow. Specifically:

It demonstrates Atomist as the API for software, exposing

Atomist is not tied to GitHub, but this repository focuses on using Atomist with GitHub.com or GitHub Enterprise.

Key Functionality

The following key functionality of this project will be available when you run this automation client in your team:

Plugging in Third Party Tools

This repo shows the use of Atomist to perform many steps itself. However, each of the goals used by Atomist here is pluggable.

It's also easy to integrate third party tools like Checkstyle.

Integrating CI tools

One of the tools you are most likely to integrate is CI. For example, you can integrate Jenkins, Travis or Circle CI with Atomist so that these tools are responsible for build. This has potential advantages in terms of scheduling and repeatability of environments.

Integrating a CI tool with Atomist is simple. Simply invoke Atomist hooks to send events around build and artifact creation.

If integrating CI tools, we recommend the following:

Example: Integrating Travis

tbc

Integrating APM tools

Integrating with Static Analysis Tools

Any tool that runs on code, such as Checkstyle, can easily be integrated.

Use shell. node is good for this

Integrations

Choose a machine

You must set environment variables to choose a machine, if you override the default.

export MACHINE_PATH="./software-delivery-machine/machines"
export MACHINE_NAME="cloudFoundrySoftwareDeliveryMachine"

Local HTTP server

To run a local HTTP server to invoke via curl or for smoke testing, please set the following environment variable:

export LOCAL_ATOMIST_ADMIN_PASSWORD="<value>"

Java

To build Java projects on the automation client node, you'll need:

Node

To build Node projects on the automation client node, you'll need:

Configuration

The following configuration should be in your ~/.atomist/client.config.json in order to successfully connect your SDM:

{
  "token": "<your github token>",
  "teamIds": [
    "<your team id>"
  ],
  "sdm": {
    "rolar": {
      "url": "https://rolar.cfapps.io"
    },
    "graphviz": {
        "url": "<optional url to graphviz service>"
    },
    "cloudfoundry": {
      "api": "https://api.run.pivotal.io",
      "user": "<your Pivotal Cloud Foundry user name>",
      "password": "<your Pivotal Cloud Foundry password>",
      "org": "<your Pivotal Cloud Foundry organization name>",
      "spaces": {
        "production": "<your Pivotal Cloud Foundry production space name within your org>",
        "staging": "<your Pivotal Cloud Foundry staging space name within your org>"
      }
    },
    "checkstyle": {
      "enabled": false,
      "reviewOnlyChangedFiles": true,
      "path": "/Users/cdupuis/Development/atomist/sample-sdm/test/checkstyle-8.8-all.jar"
    }
  }
}
Checkstyle

Checkstyle is a style-checker for Java. For the optional Checkstyle integration to work, set up two Checkstyle configuration as shown above.

Get checkstyle-8.8-all.jar from Checkstyle's download page.

Cloud Foundry

This SDM allows deployment to Pivotal Cloud Foundry. For deployment to work you need to set your user, password and org of your Cloud Foundry account. Additionally please configure two spaces to be used for staging and production deployments.

Kubernetes

The kubernetesSoftwareDevelopmentMachine included here deploys to an Atomist sandbox kubernetes environment, using k8-automation which we run inside our cluster. You can deploy the Spring Boot projects created with @atomist create spring here, in order to try out the Kubernetes integration with the SDM.