-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/goreleaser
- Loading branch information
Showing
12 changed files
with
106 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,31 @@ | ||
# Jerm | ||
|
||
Jerm deploys serverless apps to the cloud | ||
Jerm is an open source tool that helps you deploy serverless apps seamlessly across all clouds. | ||
|
||
Note: Still under early development. | ||
## Quickstart | ||
|
||
This guide will get you up and running in a few minutes. | ||
|
||
### Install | ||
|
||
To install Jerm run | ||
|
||
``` | ||
$ go install github.com/spatocode/jerm/cmd/jerm@latest | ||
``` | ||
|
||
### Usage | ||
|
||
Deploy your app | ||
|
||
``` | ||
$ jerm deploy | ||
``` | ||
|
||
## Contributing | ||
|
||
Jerm is still under early development and all contributions are welcomed. | ||
|
||
## License | ||
|
||
Jerm is licensed under the [BSD-3-Clause license](https://github.com/spatocode/jerm/blob/main/LICENSE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ package aws | |
|
||
const ( | ||
awsLambdaHandler = ` | ||
import sys | ||
import json | ||
import io | ||
import logging | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,9 +4,6 @@ Copyright © 2023 Ekene Izukanne <[email protected]> | |
package cmd | ||
|
||
import ( | ||
"errors" | ||
"os" | ||
|
||
"github.com/spf13/cobra" | ||
|
||
"github.com/spatocode/jerm" | ||
|
@@ -22,21 +19,19 @@ var statusCmd = &cobra.Command{ | |
Run: func(cmd *cobra.Command, args []string) { | ||
jerm.Verbose(cmd) | ||
|
||
config, err := jerm.ReadConfig(jerm.DefaultConfigFile) | ||
cfg, err := jerm.Configure(jerm.DefaultConfigFile) | ||
if err != nil { | ||
var pErr *os.PathError | ||
if !errors.As(err, &pErr) { | ||
log.PrintError(err.Error()) | ||
} | ||
log.PrintError(err.Error()) | ||
return | ||
} | ||
|
||
p, err := jerm.New(config) | ||
p, err := jerm.New(cfg) | ||
if err != nil { | ||
log.PrintError(err.Error()) | ||
return | ||
} | ||
|
||
platform, err := aws.NewLambda(config) | ||
platform, err := aws.NewLambda(cfg) | ||
if err != nil { | ||
log.PrintError(err.Error()) | ||
return | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,6 @@ Copyright © 2023 Ekene Izukanne <[email protected]> | |
package cmd | ||
|
||
import ( | ||
"errors" | ||
"os" | ||
"strings" | ||
|
||
"github.com/spf13/cobra" | ||
|
@@ -27,12 +25,10 @@ var manageCmd = &cobra.Command{ | |
return | ||
} | ||
|
||
cfg, err := jerm.ReadConfig(jerm.DefaultConfigFile) | ||
cfg, err := jerm.Configure(jerm.DefaultConfigFile) | ||
if err != nil { | ||
var pErr *os.PathError | ||
if !errors.As(err, &pErr) { | ||
log.PrintError(err.Error()) | ||
} | ||
log.PrintError(err.Error()) | ||
return | ||
} | ||
|
||
platform, err := aws.NewLambda(cfg) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,9 +4,6 @@ Copyright © 2023 Ekene Izukanne <[email protected]> | |
package cmd | ||
|
||
import ( | ||
"errors" | ||
"os" | ||
|
||
"github.com/spf13/cobra" | ||
|
||
"github.com/spatocode/jerm" | ||
|
@@ -23,21 +20,19 @@ var rollbackCmd = &cobra.Command{ | |
steps, _ := cmd.Flags().GetInt("steps") | ||
jerm.Verbose(cmd) | ||
|
||
config, err := jerm.ReadConfig(jerm.DefaultConfigFile) | ||
cfg, err := jerm.Configure(jerm.DefaultConfigFile) | ||
if err != nil { | ||
var pErr *os.PathError | ||
if !errors.As(err, &pErr) { | ||
log.PrintError(err.Error()) | ||
} | ||
log.PrintError(err.Error()) | ||
return | ||
} | ||
|
||
p, err := jerm.New(config) | ||
p, err := jerm.New(cfg) | ||
if err != nil { | ||
log.PrintError(err.Error()) | ||
return | ||
} | ||
|
||
platform, err := aws.NewLambda(config) | ||
platform, err := aws.NewLambda(cfg) | ||
if err != nil { | ||
log.PrintError(err.Error()) | ||
return | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ Copyright © 2023 Ekene Izukanne <[email protected]> | |
package cmd | ||
|
||
import ( | ||
"errors" | ||
"os" | ||
|
||
"github.com/spf13/cobra" | ||
|
@@ -23,21 +22,19 @@ var undeployCmd = &cobra.Command{ | |
Run: func(cmd *cobra.Command, args []string) { | ||
jerm.Verbose(cmd) | ||
|
||
config, err := jerm.ReadConfig(jerm.DefaultConfigFile) | ||
cfg, err := jerm.Configure(jerm.DefaultConfigFile) | ||
if err != nil { | ||
var pErr *os.PathError | ||
if !errors.As(err, &pErr) { | ||
log.PrintError(err.Error()) | ||
} | ||
log.PrintError(err.Error()) | ||
return | ||
} | ||
|
||
p, err := jerm.New(config) | ||
p, err := jerm.New(cfg) | ||
if err != nil { | ||
log.PrintError(err.Error()) | ||
return | ||
} | ||
|
||
platform, err := aws.NewLambda(config) | ||
platform, err := aws.NewLambda(cfg) | ||
if err != nil { | ||
log.PrintError(err.Error()) | ||
return | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package jerm | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestJermConfigure(t *testing.T) { | ||
assert := assert.New(t) | ||
role := "arn:aws:iam::269360183919:role/bodystats-dev-JermTestLambdaServiceExecutionRole" | ||
c, err := Configure("assets/tests/jerm.json") | ||
assert.Nil(err) | ||
assert.Equal("bodystats", c.Name) | ||
assert.Equal("dev", c.Stage) | ||
assert.Equal(512, c.Lambda.Memory) | ||
assert.Equal("jerm-1699348021", c.Bucket) | ||
assert.Equal("us-west-2", c.Region) | ||
assert.Equal(role, c.Lambda.Role) | ||
assert.Equal("python3.11", c.Lambda.Runtime) | ||
assert.Equal(false, c.Lambda.KeepWarm) | ||
assert.Equal("/home/ubuntu/bodystats", c.Dir) | ||
assert.Equal(30, c.Lambda.Timeout) | ||
assert.Equal("bodyie", c.Entry) | ||
} |