summaryrefslogtreecommitdiff
path: root/cmd/mkpipeline/main.go
blob: b15e9efd3851e3f42d9149006db38c2b68bf7eaa (plain)
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
// Copyright 2019 Nick White.
// Use of this source code is governed by the GPLv3
// license that can be found in the LICENSE file.

package main

import (
	"log"
	"os"

	"rescribe.xyz/bookpipeline"
)

type MkPipeliner interface {
	MinimalInit() error
	MkPipeline() error
}

func main() {
	if len(os.Args) != 1 {
		log.Fatal("Usage: mkpipeline\n\nSets up necessary buckets and queues for our cloud pipeline\n")
	}

	var conn MkPipeliner
	conn = &bookpipeline.AwsConn{Region: "eu-west-2", Logger: log.New(os.Stdout, "", 0)}
	err := conn.MinimalInit()
	if err != nil {
		log.Fatalln("Failed to set up cloud connection:", err)
	}

	err = conn.MkPipeline()
	if err != nil {
		log.Fatalln("MkPipeline failed:", err)
	}
}