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

// mkpipeline sets up the necessary buckets and queues for the book
// pipeline.
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)
	}
}