This repository was archived by the owner on Apr 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgohci.go
62 lines (57 loc) · 2.06 KB
/
gohci.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// Copyright 2018 Marc-Antoine Ruel. All rights reserved.
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.
// Package gohci defines the configuration schemas for 'gohci.yml' and
// '.gohci.yml'.
//
// '.gohci.yml' is found in the repository and defines the checks to run.
//
// 'gohci.yml' is found on the worker itself and defines the http port, webhook
// secret and OAuth2 access token.
package gohci
// WorkerConfig is a worker configuration.
//
// It is found as `gohci.yml` in the gohci-worker working directory.
type WorkerConfig struct {
// TCP port number for the HTTP server.
Port int
// WebHookSecret is the shared secret that keeps people on the internet from
// running tasks on your worker.
//
// gohci-worker generates a good secret by default.
//
// See https://developer.github.com/webhooks/ for more information.
WebHookSecret string
// Oauth2AccessToken is the OAuth2 Access Token to be able to create gist and
// update commit status.
//
// https://github.com/settings/tokens, check "repo:status" and "gist"
Oauth2AccessToken string
// Display name to use in the status report on Github.
//
// Defaults to the machine hostname.
Name string
}
// Check is a single command to run.
type Check struct {
Cmd []string // Command to run.
Env []string // Optional environment variables to use.
Dir string // Directory to run from. Defaults to the root of the checkout.
}
// ProjectWorkerConfig is the project configuration via ".gohci.yml" for a
// specific worker.
type ProjectWorkerConfig struct {
// Name is the worker which this config belongs to.
//
// If empty, this is the default configuration to use.
Name string
// Checks are the commands to run to test the repository. They are run one
// after the other from the repository's root.
Checks []Check
}
// ProjectConfig is a configuration file found in a project as ".gohci.yml" in
// the root directory of the repository.
type ProjectConfig struct {
Version int // Current 1
Workers []ProjectWorkerConfig //
}