|
1 |
| -|logo| |
| 1 | +.. raw:: html |
| 2 | + |
| 3 | + <img src="https://cdn.rawgit.com/michelvocks/ef3894f63c3bb004bca1a2fd5f7eb644/raw/c36d614db8afe229b466b38de1636a82ad809f64/gaia-logo-text.png" width="650px"> |
2 | 4 |
|
3 | 5 | |build-status| |go-report| |go-doc| |apache2| |chat|
|
4 | 6 |
|
@@ -88,35 +90,35 @@ Here is an example:
|
88 | 90 | package main
|
89 | 91 |
|
90 | 92 | import (
|
91 |
| - "log" |
| 93 | + "log" |
92 | 94 |
|
93 |
| - sdk "github.com/gaia-pipeline/gosdk" |
| 95 | + sdk "github.com/gaia-pipeline/gosdk" |
94 | 96 | )
|
95 | 97 |
|
96 | 98 | // This is one job. Add more if you want.
|
97 | 99 | func DoSomethingAwesome() error {
|
98 |
| - log.Println("This output will be streamed back to gaia and will be displayed in the pipeline logs.") |
| 100 | + log.Println("This output will be streamed back to gaia and will be displayed in the pipeline logs.") |
99 | 101 |
|
100 |
| - // An error occured? Return it back so gaia knows that this job failed. |
101 |
| - return nil |
| 102 | + // An error occured? Return it back so gaia knows that this job failed. |
| 103 | + return nil |
102 | 104 | }
|
103 | 105 |
|
104 | 106 | func main() {
|
105 |
| - jobs := sdk.Jobs{ |
106 |
| - sdk.Job{ |
107 |
| - Handler: DoSomethingAwesome, |
108 |
| - Title: "DoSomethingAwesome", |
109 |
| - Description: "This job does something awesome.", |
110 |
| -
|
111 |
| - // Increase the priority if this job should be executed later than other jobs. |
112 |
| - Priority: 0, |
113 |
| - }, |
114 |
| - } |
115 |
| -
|
116 |
| - // Serve |
117 |
| - if err := sdk.Serve(jobs); err != nil { |
118 |
| - panic(err) |
119 |
| - } |
| 107 | + jobs := sdk.Jobs{ |
| 108 | + sdk.Job{ |
| 109 | + Handler: DoSomethingAwesome, |
| 110 | + Title: "DoSomethingAwesome", |
| 111 | + Description: "This job does something awesome.", |
| 112 | +
|
| 113 | + // Increase the priority if this job should be executed later than other jobs. |
| 114 | + Priority: 0, |
| 115 | + }, |
| 116 | + } |
| 117 | +
|
| 118 | + // Serve |
| 119 | + if err := sdk.Serve(jobs); err != nil { |
| 120 | + panic(err) |
| 121 | + } |
120 | 122 | }
|
121 | 123 |
|
122 | 124 | Like you can see, pipelines are defined by jobs. Usually, a function represents a job. You can define as many jobs in your pipeline as you want.
|
@@ -173,10 +175,6 @@ If you have any questions feel free to contact us on `gitter`_.
|
173 | 175 | .. _`go-example repo`: https://github.com/gaia-pipeline/go-example
|
174 | 176 | .. _`gitter`: https://gitter.im/gaia-pipeline
|
175 | 177 |
|
176 |
| -.. |logo| image:: https://cdn.rawgit.com/michelvocks/ef3894f63c3bb004bca1a2fd5f7eb644/raw/c36d614db8afe229b466b38de1636a82ad809f64/gaia-logo-text.png |
177 |
| - :alt: gaia Logo |
178 |
| - :width: 650px |
179 |
| - |
180 | 178 | .. |build-status| image:: https://img.shields.io/circleci/project/github/gaia-pipeline/gaia/master.svg?label=circle&maxAge=43200
|
181 | 179 | :alt: Build Status
|
182 | 180 | :scale: 100%
|
|
0 commit comments