Skip to content

Commit

Permalink
use new plural dkr host
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljguarino committed Apr 14, 2021
1 parent f8182e1 commit 960b284
Show file tree
Hide file tree
Showing 16 changed files with 29 additions and 26 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/**/helm/**/values.yaml filter=forge-crypt diff=forge-crypt
/**/manifest.yaml filter=forge-crypt diff=forge-crypt
7 changes: 4 additions & 3 deletions .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version: v1.0
name: Forge
name: plural-cli
agent:
machine:
type: e1-standard-2
Expand All @@ -13,16 +13,17 @@ blocks:
- name: GCP
- name: gcp-test
- name: forge
- name: plural
prologue:
commands:
# Authenticate using the file injected from the secret
- gcloud auth activate-service-account --key-file=.secrets/gcp-piazzaapp.json
# Don't forget -q to silence confirmation prompts
- gcloud auth configure-docker -q
- docker login -u mguarino46@gmail.com -p $FORGE_ACCESS_TOKEN dkr.piazza.app
- docker login -u mjg@plural.sh -p $PLURAL_ACCESS_TOKEN dkr.plural.sh
- checkout
jobs:
- name: "Build forge"
- name: "Build plural"
commands:
- make build
- make push
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM golang:alpine AS cmd

RUN apk update && apk add --no-cache git

WORKDIR $GOPATH/src/forge/
WORKDIR $GOPATH/src/plural/
COPY . .
RUN go build -o /go/bin/forge -ldflags '-s -w' ./cmd/forge/
RUN /go/bin/forge --help
RUN go build -o /go/bin/plural -ldflags '-s -w' ./cmd/plural/
RUN /go/bin/plural --help
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ GCP_PROJECT ?= piazzaapp
APP_NAME ?= plural-cli
APP_VSN ?= `cat VERSION`
BUILD ?= `git rev-parse --short HEAD`
DKR_HOST ?= dkr.piazza.app
DKR_HOST ?= dkr.plural.sh
GOOS ?= darwin
GOARCH ?= amd64

Expand Down
2 changes: 1 addition & 1 deletion cmd/plural/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func handleHelmUpload(c *cli.Context) error {
return err
}

if err := utils.Cmd(&conf, "helm", "repo", "add", repo, fmt.Sprintf("cm://forge.piazza.app/cm/%s", repo)); err != nil {
if err := utils.Cmd(&conf, "helm", "repo", "add", repo, fmt.Sprintf("cm://app.plural.sh/cm/%s", repo)); err != nil {
return err
}
return utils.Cmd(&conf, "helm", "push", "--context-path=/cm", pth, repo)
Expand Down
16 changes: 8 additions & 8 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ func Read() Config {
return Import(configFile())
}

func Import(file string) Config {
func Import(file string) (conf Config) {
contents, err := ioutil.ReadFile(file)
if err != nil {
return conf
return
}

versioned := &VersionedConfig{}
versioned := &VersionedConfig{Spec: &conf}
yaml.Unmarshal(contents, versioned)
return *versioned.Spec
return
}

func Amend(key string, value string) error {
Expand All @@ -51,10 +51,10 @@ func Amend(key string, value string) error {
}

func (conf *Config) Marshal() ([]byte, error) {
versioned = &VersionedConfig{
versioned := &VersionedConfig{
ApiVersion: "platform.plural.sh/v1alpha1",
Kind: "Config"
Spec: conf
Kind: "Config",
Spec: conf,
}
return yaml.Marshal(&versioned)
}
Expand All @@ -68,7 +68,7 @@ func (c *Config) Namespace(ns string) string {
}

func (c *Config) Url() string {
host := "https://forge.piazza.app"
host := "https://app.plural.sh"
if (c.Endpoint != "") {
host = c.Endpoint
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/crypto/cipher.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func Materialize() (*AESKey, error) {

func getKeyPath() string {
folder, _ := os.UserHomeDir()
return path.Join(folder, ".forge", "key")
return path.Join(folder, ".plural", "key")
}

func gen() *AESKey {
Expand Down
2 changes: 1 addition & 1 deletion pkg/executor/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func DefaultExecution(path string, prev *Execution) (e *Execution) {
}

for i := 0; i < len(prev.Steps)-1; i++ {
graph.AddEdge(steps[i].Name, steps[i+1].Name)
graph.AddEdge(prev.Steps[i].Name, prev.Steps[i+1].Name)
}

finalizedSteps := []*Step{}
Expand Down
2 changes: 1 addition & 1 deletion pkg/forgefile/artifact.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (a *Artifact) Push(repo string, sha string) (string, error) {
}

utils.Highlight("pushing artifact %s\n [plat=%s,arch=%s]", a.File, a.Platform, a.Arch)
cmd := exec.Command("forge", "push", "artifact", a.File, repo, "--platform", a.Platform, "--arch", a.Arch)
cmd := exec.Command("plural", "push", "artifact", a.File, repo, "--platform", a.Platform, "--arch", a.Arch)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
err = cmd.Run()
Expand Down
2 changes: 1 addition & 1 deletion pkg/forgefile/crd.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func (a *Crd) Push(repo string, sha string) (string, error) {
}

utils.Highlight("pushing crd %s for %s\n", a.File, a.Chart)
cmd := exec.Command("forge", "push", "crd", a.File, repo, a.Chart)
cmd := exec.Command("plural", "push", "crd", a.File, repo, a.Chart)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
return newsha, cmd.Run()
Expand Down
2 changes: 1 addition & 1 deletion pkg/forgefile/helm.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func (a *Helm) Push(repo string, sha string) (string, error) {
}

utils.Highlight("pushing helm %s", a.File)
cmd, output := executor.SuppressedCommand("forge", "push", "helm", a.File, repo)
cmd, output := executor.SuppressedCommand("plural", "push", "helm", a.File, repo)

err = executor.RunCommand(cmd, output)
return newsha, err
Expand Down
2 changes: 1 addition & 1 deletion pkg/forgefile/integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func (a *Integration) Push(repo string, sha string) (string, error) {
}

utils.Highlight("pushing integration %s", a.File)
cmd, output := executor.SuppressedCommand("forge", "push", "integration", a.File, repo)
cmd, output := executor.SuppressedCommand("plural", "push", "integration", a.File, repo)

err = executor.RunCommand(cmd, output)
return newsha, err
Expand Down
2 changes: 1 addition & 1 deletion pkg/forgefile/recipe.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func (a *Recipe) Push(repo string, sha string) (string, error) {
}

utils.Highlight("pushing recipe %s", a.File)
cmd, output := executor.SuppressedCommand("forge", "push", "recipe", a.File, repo)
cmd, output := executor.SuppressedCommand("plural", "push", "recipe", a.File, repo)

err = executor.RunCommand(cmd, output)
return newsha, err
Expand Down
2 changes: 1 addition & 1 deletion pkg/forgefile/resourcedefinition.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func (a *ResourceDefinition) Push(repo string, sha string) (string, error) {
}

utils.Highlight("pushing integration definition %s", a.File)
cmd, output := executor.SuppressedCommand("forge", "push", "resourcedefinition", a.File, repo)
cmd, output := executor.SuppressedCommand("plural", "push", "resourcedefinition", a.File, repo)

err = executor.RunCommand(cmd, output)
return newsha, err
Expand Down
2 changes: 1 addition & 1 deletion pkg/forgefile/terraform.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func (a *Terraform) Push(repo string, sha string) (string, error) {
}

utils.Highlight("pushing terraform %s\n", a.File)
cmd := exec.Command("forge", "push", "terraform", a.File, repo)
cmd := exec.Command("plural", "push", "terraform", a.File, repo)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
err = cmd.Run()
Expand Down
2 changes: 1 addition & 1 deletion pkg/scaffold/scaffold.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func merge(build *Build, base *Build) *Build {
}

for i := 0; i < len(base.Scaffolds)-1; i++ {
graph.AddEdge(build.Scaffolds[i].Name, build.Scaffolds[i+1].Name)
graph.AddEdge(base.Scaffolds[i].Name, base.Scaffolds[i+1].Name)
}

sorted, ok := graph.Topsort()
Expand Down

0 comments on commit 960b284

Please sign in to comment.