github.com/mweagle/Sparta@v1.15.0/docs_source/content/reference/operations/magefile.md (about) 1 --- 2 date: 2018-11-28 16:17:43 3 title: Magefiles 4 weight: 5 5 --- 6 7 # Magefile 8 9 To support cross platform development and usage, Sparta uses [magefiles](https://magefile.org) rather 10 than _Makefiles_. Most projects can start with the _magefile.go_ sample below. The Magefiles 11 provide a discoverable CLI, but are entirely optional. `go run main.go XXXX` style invocation remains 12 available as well. 13 14 ## Default Sparta _magefile.go_ 15 16 This _magefile.go_ can be used, unchanged, for most standard Sparta projects. 17 18 ```go 19 // +build mage 20 21 // File: magefile.go 22 23 package main 24 25 import ( 26 spartaMage "github.com/mweagle/Sparta/magefile" 27 ) 28 29 // Provision the service 30 func Provision() error { 31 return spartaMage.Provision() 32 } 33 34 // Describe the stack by producing an HTML representation of the CloudFormation 35 // template 36 func Describe() error { 37 return spartaMage.Describe() 38 } 39 40 // Delete the service, iff it exists 41 func Delete() error { 42 return spartaMage.Delete() 43 } 44 45 // Status report if the stack has been provisioned 46 func Status() error { 47 return spartaMage.Status() 48 } 49 50 // Version information 51 func Version() error { 52 return spartaMage.Version() 53 } 54 ``` 55 56 ```shell 57 $ mage -l 58 Targets: 59 delete the service, iff it exists 60 describe the stack by producing an HTML representation of the CloudFormation template 61 provision the service 62 status report if the stack has been provisioned 63 version information 64 ``` 65 66 ## Sparta Magefile Helpers 67 68 There are several [magefile helpers](https://godoc.org/github.com/mweagle/Sparta/magefile) available 69 in the Sparta package. These are in addition to and often delegate to, the core 70 [mage libraries](https://magefile.org/libraries/).