sanisoclem / iro-iro

0 stars 0 forks source link

Iro-iro Color Palettes

CodeFactor codebeat badge Codacy Badge codecov

A color palette sharing site.

Status

Platform Go Ver Build status
Windows ? ?
Linux 1.12 Build Status
Linux tip ?

Prerequesites

Getting Started

The easiest way to get started is to run make all.

Install dependencies

You can install dependencies using make deps or:

$ go get -u github.com/aws/aws-lambda-go/...
github.com/aws/aws-lambda-go (download)
Fetching https://gopkg.in/urfave/cli.v1?go-get=1
Parsing meta tags from https://gopkg.in/urfave/cli.v1?go-get=1 (status code 200)
get "gopkg.in/urfave/cli.v1": found meta tag get.metaImport{Prefix:"gopkg.in/urfave/cli.v1", VCS:"git", RepoRoot:"https://gopkg.in/urfave/cli.v1"} at https://gopkg.in/urfave/cli.v1?go-get=1
gopkg.in/urfave/cli.v1 (download)
github.com/stretchr/testify (download)
...

Build the app

To build all binaries, just run: make build. If make is not available, you can build each binary by:

# replace $name with the name of the function
$ GOOS=linux GOARCH=amd64 go build -o ./bin/function-$name ./functions/$name/main.go

Run Tests

$ make test # or
$ go test -v ./...
=== RUN   TestHandler
=== RUN   TestHandler/Return_id_when_created
=== RUN   TestHandler/Return_error_if_exists
--- PASS: TestHandler (0.00s)
    --- PASS: TestHandler/Return_id_when_created (0.00s)
    --- PASS: TestHandler/Return_error_if_exists (0.00s)
PASS
ok      _/mnt/d/Mel/Workspace/src/github.com/sanisoclem/iro-iro/functions/new-palette   0.012s

Deployment

This repo uses AWS SAM templates for deployment.

$ # publish code in s3 and package template
$ sam package --s3-bucket $S3_BUCKET_NAME --output-template-file packaged.yml
Uploading to 0e989e5a7ec764a7d03dc4afc96d3246  11738791 / 11738791.0  (100.00%)
Successfully packaged artifacts and wrote output template to file packaged.yml.
Execute the following command to deploy the packaged template
aws cloudformation deploy --template-file D:\Mel\Workspace\src\github.com\sanisoclem\iro-iro\packaged.yml --stack-name $STACK_NAME

$ # deploy using cloud formation. This will create the stack if it doesnt exist
$ aws cloudformation deploy --template-file packaged.yml --stack-name IroIroExperimental8 \
> --parameter-overrides ProjectName=IroIronExperimental CorsOrigin=https://beta.colors.sanisoclem.dev \
> --capabilities CAPABILITY_IAM --tags project=iro-iro8

Waiting for changeset to be created..
Waiting for stack create/update to complete
Successfully created/updated stack - IroIroExperimental8