It generates JSON file in the end with the upload results: ``` {"aws":{"regions":{"eu-central-1":{"arch":{"amd64":{"ami_id":"ami-0f559e06baf488ee1"},"arm64":{"ami_id":"ami-01edd1830a3c5d95c"}}},"eu-west-3":{"arch":{"amd64":{"ami_id":"ami-020f95a280c4c1c55"},"arm64":{"ami_id":"ami-0edcc7d694931a52c"}}}}}} ``` Regions, architectures can be modified as well. Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
31 lines
728 B
Go
31 lines
728 B
Go
// This Source Code Form is subject to the terms of the Mozilla Public
|
|
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"path/filepath"
|
|
)
|
|
|
|
// Options for the cli.
|
|
type Options struct {
|
|
Tag string
|
|
ArtifactsPath string
|
|
Architectures []string
|
|
|
|
AWSRegions []string
|
|
}
|
|
|
|
// DefaultOptions used throughout the cli.
|
|
var DefaultOptions = Options{
|
|
ArtifactsPath: "_out/",
|
|
Architectures: []string{"amd64", "arm64"},
|
|
}
|
|
|
|
// AWSImage returns path to AWS pre-built image.
|
|
func (o *Options) AWSImage(architecture string) string {
|
|
return filepath.Join(o.ArtifactsPath, fmt.Sprintf("aws-%s.tar.gz", architecture))
|
|
}
|