-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This will use a new bootstrapping method more in line with CD-exclusive usecases. It works basically as follows: * set up a git submodule of our bootstrap repo w/ some base charts and terraform * template some of the variable settings from there into the installation repo * run terraform off those templates This will set up a management cluster and fully install console onto it. We can further extend this to do the full OSS app installation process on top of CD. The main benefits here are separating cluster provisioning concerns out of our purview (users will manually manage their own terraform after running up), and reduce our scope to just maintaining the helm chart updates for the console and our runtime via CD. It also makes reconfiguration more natural since the users can delink the submodule and take full ownership whenever needed.
- Loading branch information
1 parent
3233f98
commit 51eb792
Showing
20 changed files
with
516 additions
and
167 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
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
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,67 @@ | ||
package plural | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/urfave/cli" | ||
|
||
"github.com/pluralsh/plural-cli/pkg/up" | ||
"github.com/pluralsh/plural-cli/pkg/utils" | ||
"github.com/pluralsh/plural-cli/pkg/utils/git" | ||
) | ||
|
||
const ( | ||
affirmUp = "Are you ready to set up your initial management cluster? You can check the generated terraform/helm to confirm everything looks good first" | ||
affirmDown = "Are you ready to destroy your plural infrastructure? This will destroy all k8s clusters and any data stored within" | ||
) | ||
|
||
func (p *Plural) handleUp(c *cli.Context) error { | ||
if err := p.handleInit(c); err != nil { | ||
return err | ||
} | ||
p.InitPluralClient() | ||
|
||
repoRoot, err := git.Root() | ||
if err != nil { | ||
return err | ||
} | ||
|
||
ctx, err := up.Build() | ||
if err != nil { | ||
return err | ||
} | ||
|
||
if err := ctx.Generate(); err != nil { | ||
return err | ||
} | ||
|
||
if !affirm(affirmUp, "PLURAL_UP_AFFIRM_DEPLOY") { | ||
return fmt.Errorf("cancelled deploy") | ||
} | ||
|
||
if err := ctx.Deploy(); err != nil { | ||
return err | ||
} | ||
|
||
utils.Highlight("\n==> Commit and push your configuration\n\n") | ||
|
||
if commit := commitMsg(c); commit != "" { | ||
utils.Highlight("Pushing upstream...\n") | ||
return git.Sync(repoRoot, commit, c.Bool("force")) | ||
} | ||
|
||
return nil | ||
} | ||
|
||
func (p *Plural) handleDown(c *cli.Context) error { | ||
if !affirm(affirmDown, "PLURAL_DOWN_AFFIRM_DESTROY") { | ||
return fmt.Errorf("cancelled destroy") | ||
} | ||
|
||
ctx, err := up.Build() | ||
if err != nil { | ||
return err | ||
} | ||
|
||
return ctx.Destroy() | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.