Skip to content

Commit

Permalink
chore: cds as-code workflow (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
richardlt authored Apr 30, 2019
1 parent 2613b91 commit 3a3c210
Show file tree
Hide file tree
Showing 5 changed files with 186 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .cds/build.pip.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
version: v1.0
name: build
jobs:
- job: all-binary
steps:
- checkout: '{{.cds.workspace}}/go/src/github.com/richardlt/matrix'
- script:
- export GO111MODULE=on
- export GOPROXY=https://gocenter.io
- export EXT_GOPATH={{.cds.workspace}}/go
- export OUT=matrix
- export FLAG_V='false'
- export TARGETS='linux/arm-7 linux/amd64 darwin/amd64 windows/amd64'
- cd {{.cds.workspace}}/go/src/github.com/richardlt/matrix
- /build.sh .
- artifactUpload:
path: /build/matrix-*
tag: '{{.cds.version}}'
requirements:
- binary: git
- model: xgo-1.12
- job: all-binary-test
steps:
- checkout: '{{.cds.workspace}}'
- script:
- go get -u github.com/jstemmer/go-junit-report
- export GO111MODULE=on
- export GOPROXY=https://gocenter.io
- make test-with-report
- jUnitReport: report.xml
requirements:
- binary: git
- model: go-1.12
- job: emulator-ui
steps:
- checkout: '{{.cds.workspace}}'
- script:
- (cd emulator && make install)
- (cd emulator && make build)
- apt-get update && apt-get install -y zip
- zip -r emulator-ui.zip emulator/client/public
- artifactUpload:
path: '{{.cds.workspace}}/emulator-ui.zip'
tag: '{{.cds.version}}'
requirements:
- binary: git
- model: node-10.15
- job: gamepad-ui
steps:
- checkout: '{{.cds.workspace}}'
- script:
- (cd gamepad && make install)
- (cd gamepad && make build)
- apt-get update && apt-get install -y zip
- zip -r gamepad-ui.zip gamepad/build/default
- artifactUpload:
path: '{{.cds.workspace}}/gamepad-ui.zip'
tag: '{{.cds.version}}'
requirements:
- binary: git
- model: node-10.15
10 changes: 10 additions & 0 deletions .cds/matrix.app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: v1.0
name: matrix
vcs_server: github
repo: richardlt/matrix
keys:
app-matrix-git:
type: ssh
value: b8bf25fa2e854c0e94873162c5d418b5
vcs_connection_type: ssh
vcs_ssh_key: app-matrix-git
40 changes: 40 additions & 0 deletions .cds/matrix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: matrix
version: v1.0
workflow:
build:
pipeline: build
application: matrix
deploy:
depends_on:
- package
when:
- success
- manual
pipeline: deploy
application: matrix
package:
depends_on:
- build
when:
- success
pipeline: package
application: matrix
release:
depends_on:
- package
conditions:
check:
- variable: git.branch
operator: eq
value: master
- variable: git.repository
operator: eq
value: richardlt/matrix
when:
- success
- manual
pipeline: release
application: matrix
metadata:
default_tags: git.branch,git.author,git.hash
history_length: 5
46 changes: 46 additions & 0 deletions .cds/package.pip.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
version: v1.0
name: package
stages:
- zip
- deb
jobs:
- job: zip
stage: zip
steps:
- checkout: '{{.cds.workspace}}'
- artifactDownload:
path: '{{.cds.workspace}}'
tag: '{{.cds.version}}'
- script:
- unzip emulator-ui.zip
- unzip gamepad-ui.zip
- mkdir -p build
- cp matrix-linux* build/
- cp matrix-darwin* build/
- cp matrix-windows* build/
- make package
- artifactUpload:
path: '{{.cds.workspace}}/matrix.zip'
tag: '{{.cds.version}}'
requirements:
- binary: git
- binary: make
- binary: unzip
- binary: zip
- job: deb
stage: deb
steps:
- checkout: '{{.cds.workspace}}'
- artifactDownload:
path: '{{.cds.workspace}}'
pattern: matrix.zip
tag: '{{.cds.version}}'
- script:
- unzip matrix.zip
- debpacker make
- artifactUpload:
path: '{{.cds.workspace}}/target/matrix.deb'
tag: '{{.cds.version}}'
requirements:
- model: debpacker-0.0.1
- binary: git
29 changes: 29 additions & 0 deletions .cds/release.pip.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: v1.0
name: release
parameters:
tagLevel:
type: list
default: major;minor;patch
jobs:
- job: release
steps:
- checkout: '{{.cds.workspace}}'
- gitTag:
path: '{{.cds.workspace}}'
tagLevel: '{{.cds.pip.tagLevel}}'
tagMessage: Matrix release
- artifactDownload:
path: '{{.cds.workspace}}'
pattern: matrix.deb|matrix.zip
tag: '{{.cds.version}}'
- script:
- TAG=`git describe --abbrev=0 --tags`
- worker export tag $TAG
- release:
artifacts: matrix.deb,matrix.zip
releaseNote: Matrix release {{.cds.build.tag}}
tag: '{{.cds.build.tag}}'
title: '{{.cds.build.tag}}'
requirements:
- binary: git
- binary: gpg

0 comments on commit 3a3c210

Please sign in to comment.