Skip to content

Commit

Permalink
Merge pull request #210 from dream11/development
Browse files Browse the repository at this point in the history
Multi account support for env creation
  • Loading branch information
dhavalmehta07 authored Dec 21, 2023
2 parents bfa32a0 + 807f699 commit 7192c40
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 3 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,39 @@ jobs:
- SHA Checksum: `${{ steps.sha256.outputs.linux_amd64 }}`
token: ${{ secrets.GITHUB_TOKEN }}

- name: Checkout create-homebrew-release action
uses: actions/checkout@v3
with:
repository: dream11/create-homebrew-release
path: homebrew-release
token: ${{ secrets.COMMIT_ACCESS_TOKEN }}
ref: "v1.0.0"

- name: Create homebrew release
id: homebrew_release
uses: ./homebrew-release/
with:
homebrew-tap: dream11/homebrew-tools
formula_directory: formula
description: "Interface for service definitions & deployments into self-managed environments"
formula: odin
version: ${{ steps.commit.outputs.version }}
homepage: https://github.com/dream11/odin
github-token: ${{ secrets.COMMIT_ACCESS_TOKEN }}
github-username: dream11bot
github-email: [email protected]
darwin-amd64-url: https://github.com/dream11/odin/releases/download/${{ steps.commit.outputs.version }}/odin_darwin_amd64.tar.gz
darwin-amd64-sha: ${{ steps.sha256.outputs.darwin_amd64 }}
darwin-arm64-url: https://github.com/dream11/odin/releases/download/${{ steps.commit.outputs.version }}/odin_darwin_arm64.tar.gz
darwin-arm64-sha: ${{ steps.sha256.outputs.darwin_arm64 }}
linux-amd64-url: https://github.com/dream11/odin/releases/download/${{ steps.commit.outputs.version }}/odin_linux_amd64.tar.gz
linux-amd64-url: ${{ steps.sha256.outputs.linux_amd64 }}
merge-pr: false

- name: Comment homebrew-tools generated PR
uses: mshick/add-pr-comment@v2
with:
message: |
## Yay! Homebrew tools PR created. URL: ${{ steps.homebrew_release.outputs.pr }} :smile:
repo-token: ${{ secrets.COMMIT_ACCESS_TOKEN }}
2 changes: 1 addition & 1 deletion api/environment/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ type Env struct {
EnvType string `yaml:"envType,omitempty" json:"envType,omitempty"`
State string `yaml:"state,omitempty" json:"state,omitempty"`
DeletionTime string `yaml:"autoDeletionTime,omitempty" json:"autoDeletionTime,omitempty"`
Account string `yaml:"cloudProviderAccount,omitempty" json:"cloudProviderAccount,omitempty"`
Account []string `yaml:"cloudProviderAccounts,omitempty" json:"cloudProviderAccounts,omitempty"`
CreatedBy string `yaml:"createdBy,omitempty" json:"createdBy,omitempty"`
UpdatedBy string `yaml:"updatedBy,omitempty" json:"updatedBy,omitempty"`
CreatedAt string `yaml:"createdAt,omitempty" json:"createdAt,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ type application struct {
// App (Application) interface
var App application = application{
Name: "odin",
Version: "1.3.1",
Version: "1.3.2",
}
9 changes: 8 additions & 1 deletion internal/command/commands/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ type Env command

const ENV_NAME_KEY = "EnvName"

func splitProviderAccount(providerAccount string) []string {
if providerAccount == "" {
return nil
}
return strings.Split(providerAccount, ",")
}

// Run : implements the actual functionality of the command
func (e *Env) Run(args []string) int {
// Define flag set
Expand Down Expand Up @@ -62,7 +69,7 @@ func (e *Env) Run(args []string) int {
}
envConfig := environment.Env{
EnvType: *env,
Account: *providerAccount,
Account: splitProviderAccount(*providerAccount),
Name: *name,
}

Expand Down

0 comments on commit 7192c40

Please sign in to comment.