Spinnaker Pipeline as code
Asked Answered
M

1

12

I really like the idea what armory has done for pipeline as code for spinnaker. I want to implement something of similar sort. Can someone explain how they might be doing this ?

https://docs.armory.io/user-guides/dinghy/

{
  "application": "yourspinnakerapplicationname",
  "pipelines": [
    {
      "application": "yourspinnakerapplicationname",
      "keepWaitingPipelines": false,
      "limitConcurrent": true,
      "name": "Made By Armory Pipeline Templates",
      "stages": [
        {{ module "wait.stage.module" }} // Module created in dinghy-templates repo
      ],
      "triggers": []
    }
  ]
}

Have they created custom jinja extensions for module ? If someone could breakdown on how they are able to achieve this as a starting point for me, that would be really helpful

Mongoose answered 9/8, 2018 at 14:50 Comment(1)
Linked doc page seems to have moved to: docs.armory.io/docs/spinnaker/install-dinghyQuincy
S
11

We were previously using MPT (Managed Pipeline Templates) with the official Spinnaker tool roer. We had multi level partial inheritance and breaking a single template would irreversibly break all templates.

There is a new approach using JSONNET called sponnet available here. This has the advantages that come with jsonnet. The JSON pipelines it creates can be loaded via UI, roer or via the new official Spinnaker tool spin.

There is currently a design document under way for V2 of managed pipeline templates.

It's early days for spin and the Spinnaker jsonnet library but we can use something like below to define our Spinnaker pipeline within an app.jsonnet file.

local deployment = import 'deployment.json';
local kubeutils = import 'kubeutils.libsonnet';
local sponnet = import 'pipeline.libsonnet';

local canaryDeployment = kubeutils.canary(deployment);
local account = 'staging-demo';
local app = 'myapp';

<snip>

local wait = sponnet.stages
             .wait('Wait')
             .withSkipWaitText('Custom wait message')
             .withWaitTime(30);

<snip>

sponnet.pipeline()
.withApplication(app)
.withExpectedArtifacts([expectedDocker, expectedManifest])
.withName('Demo pipeline')
.withNotifications(slack)
.withTriggers([dockerTrigger, gitTrigger])
.withStages([wait, deployManifestTextBaseline, deployManifestTextCanary, 
deployManifestArtifact, findArtifactsFromResource, jenkinsJob])
Sciurine answered 24/10, 2018 at 2:12 Comment(1)
Eagerly waiting for the v2 documents as I have a similar requirementErring

© 2022 - 2024 — McMap. All rights reserved.