forked from gane5hvarma/panther
-
Notifications
You must be signed in to change notification settings - Fork 0
/
magefile.go
136 lines (109 loc) · 3.22 KB
/
magefile.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
// +build mage
package main
/**
* Panther is a Cloud-Native SIEM for the Modern Security Team.
* Copyright (C) 2020 Panther Labs Inc
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import (
"github.com/magefile/mage/mg"
"github.com/panther-labs/panther/tools/mage/build"
"github.com/panther-labs/panther/tools/mage/clean"
"github.com/panther-labs/panther/tools/mage/deploy"
"github.com/panther-labs/panther/tools/mage/doc"
"github.com/panther-labs/panther/tools/mage/gen"
"github.com/panther-labs/panther/tools/mage/master"
"github.com/panther-labs/panther/tools/mage/setup"
"github.com/panther-labs/panther/tools/mage/srcfmt"
"github.com/panther-labs/panther/tools/mage/teardown"
"github.com/panther-labs/panther/tools/mage/test"
)
// Each exported function and its comment becomes a mage target
type Build mg.Namespace
// Compile Go Lambda function source
func (Build) Lambda() error {
return build.Lambda()
}
// Compile devtools and opstools
func (Build) Tools() error {
return build.Tools()
}
// Export native schemas as YAML
func (Build) Schemas() error {
return build.Schemas()
}
// Remove dev libraries and build/test artifacts
func Clean() error {
return clean.Clean()
}
// NOTE: Mage ignores the first word of the comment if it matches the function name
// Deploy Deploy Panther to your AWS account
func Deploy() error {
return deploy.Deploy()
}
// Preview auto-generated documentation in out/doc
func Doc() error {
return doc.Doc()
}
// Format source files
func Fmt() error {
return srcfmt.Fmt()
}
// Autogenerate API-related source files and CloudWatch dashboards
func Gen() error {
return gen.Gen()
}
type Master mg.Namespace
// Deploy Deploy single master template nesting all other stacks
func (Master) Deploy() error {
return master.Deploy()
}
// Publish Publish a new Panther release (Panther team only)
func (Master) Publish() error {
return master.Publish()
}
// Install development dependencies (not required to deploy)
func Setup() error {
return setup.Setup()
}
// Destroy Panther infrastructure
func Teardown() error {
return teardown.Teardown()
}
type Test mg.Namespace
// Lint CloudFormation and Terraform templates
func (Test) Cfn() error {
return test.Cfn()
}
// Run all required checks for a pull request
func (Test) CI() error {
return test.CI()
}
// Test and lint Go source
func (Test) Go() error {
return test.Go()
}
// Run integration tests against a live deployment
func (Test) Integration() error {
return test.Integration()
}
// Test and lint Python source
func (Test) Python() error {
return test.Python()
}
// Test and lint web source
func (Test) Web() error {
return test.Web()
}