Skip to content

Instantly share code, notes, and snippets.

@burdzwastaken
Created January 29, 2018 23:01
Show Gist options
  • Save burdzwastaken/ea9baf2aa7cc0f47e87cbd469aeaa18d to your computer and use it in GitHub Desktop.
Save burdzwastaken/ea9baf2aa7cc0f47e87cbd469aeaa18d to your computer and use it in GitHub Desktop.
---
schema: "1"
id: bakeAndTagRoot
metadata:
name: Bake And Tag Pipeline
description: |-
Defines a pipeline that bakes and tags an AMI. This template cannot be used directly.
owner: devops@mulesoft.com
scopes: [global]
protect: false
configuration:
concurrentExecutions:
parallel: true
limitConcurrent: true
triggers:
- enabled: true
job: "{{ jenkinsJob }}"
master: jenkins
name: jenkins
runAsUser: "{{ runAsUser }}"
propertyFile: "{{ propertyFile }}"
type: jenkins
parameters: []
notifications: []
variables:
- name: propertyFile
description: property file to use from jenkins
defaultValue: {}
- name: package
description: package to install
defaultValue: ${trigger['buildInfo']['artifacts'][0]['displayPath'].replace('.x86_64.rpm','')}
- name: amiName
description: the name given to the AMI
defaultValue: "{{ application }}"
- name: artifact
description: artifact tag for the AMI
defaultValue: ${trigger['buildInfo']['artifacts'][0]['displayPath']}
- name: jenkinsJob
description: The jenkins job to trigger the bake
- name: regions
description: A list of AWS regions to deploy into.
type: list
defaultValue:
- us-east-1
- name: templateFileName
description: The packer template to use
defaultValue: aws-ebs-buildpack.json
- name: extendedAttributes
description: extendedAttributes to apply to the bake
- name: runAsUser
description: which service account to run runAsUser
defaultValue: spinnaker-dev
stages:
- id: bake
type: bake
dependsOn: []
name: Bake Image
config:
amiName: "{{ amiName }}"
baseLabel: release
baseOs: amazon-linux
cloudProviderType: aws
extendedAttributes: |
{% for attribute in extendedAttributes %}
{{ attribute.key }}: {{ attribute.value }}
{% endfor %}
{% endif %}
package: "{{ package }}"
rebake: false
regions: |
{% for region in regions %}
- {{ region }}
{% endfor %}
storeType: ebs
templateFileName: "{{ templateFileName }}"
varFileName: mesh-${region}.json
vmType: hvm
- id: tagImages
type: upsertImageTags
dependsOn:
- bake
name: Tag Image
config:
cloudProvider: aws
cloudProviderType: aws
tags:
name: "{{ application }}"
artifact: "{{ artifact }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment