Skip to content
This repository has been archived by the owner on Sep 14, 2020. It is now read-only.

Commit

Permalink
Fix regressions after deps update
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrkubisa committed Oct 17, 2018
1 parent 0a92262 commit 37dca79
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 18 deletions.
5 changes: 4 additions & 1 deletion ci/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ type Pipeline struct {
func NewPipeline() (*Pipeline, error) {
ctx := context.Background()

cli, err := client.NewEnvClient()
cli, err := client.NewClientWithOpts(
client.WithVersion("1.37"),
client.FromEnv,
)
if err != nil {
return nil, err
}
Expand Down
30 changes: 15 additions & 15 deletions provider/codebuild/buildspec.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ import (
// See:
// - https://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html
type BuildSpec struct {
Version string `yaml:"version"`
Env Env `yaml:"env"`
Phases Phases `yaml:"phases"`
Artifacts Artifacts `yaml:"artifacts"`
Version string `json:"version"`
Env Env `json:"env"`
Phases Phases `json:"phases"`
Artifacts Artifacts `json:"artifacts"`

// Cache is not supported
// Cache interface{} `yaml:"cache"`
// Cache interface{} `json:"cache"`
}

// ParseBuildSpec unmarshals contents of the `buildspec.yml` file to the newly-
Expand All @@ -39,32 +39,32 @@ func ParseBuildSpec(filePath string) (bs BuildSpec, err error) {
// Env describes contents specified in top-root `env` key of the `builspec.yml`
// file.
type Env struct {
Variables map[string]string `yaml:"variables"`
Variables map[string]string `json:"variables"`

// TODO; ParameterStore is not supported right now, so make it work :)
// ParameterStore map[string]string `yaml:"parameter-store"`
// ParameterStore map[string]string `json:"parameter-store"`
}

// Phases describes contents specified in top-root `phases` key
// of the `buildspec.yml` file.
type Phases struct {
Install Phase `yaml:"install"`
PreBuild Phase `yaml:"pre_build"`
Build Phase `yaml:"build"`
PostBuild Phase `yaml:"post_build"`
Install Phase `json:"install"`
PreBuild Phase `json:"pre_build"`
Build Phase `json:"build"`
PostBuild Phase `json:"post_build"`
}

// Phase provides command list which will be run during the build.
type Phase struct {
Commands []string `yaml:"commands"`
Commands []string `json:"commands"`
}

// Artifacts describes contents specified in top-root `artifacts` key
// of the `buildspec.yml` file.
type Artifacts struct {
Files interface{} `yaml:"files"`
DiscardPaths string `yaml:"discard-paths"` // default=yes
BaseDirectory string `yaml:"base-directory"`
Files interface{} `json:"files"`
DiscardPaths string `json:"discard-paths"` // default=yes
BaseDirectory string `json:"base-directory"`
}

// List returns list of files defined in the OutputArtifact
Expand Down
4 changes: 2 additions & 2 deletions provider/codebuild/codebuild.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
const (
envTag = "env"

guestWorkingDirectory = "/tmp/src123456789/src"
guestWorkingDirectory = "/tmp/src"
)

// CodeBuild mimics AWS CodeBuild runtime for the localci
Expand Down Expand Up @@ -292,7 +292,7 @@ func (cb *CodeBuild) CreateContainer(cfg RunConfiguration) (container.ContainerC
Tty: false,
Env: cfg.EnvVariables,
WorkingDir: cfg.WorkingDirectory,
Cmd: []string{`sh ./localci.sh`},
Cmd: []string{"sh", "./localci.sh"},
}
host := &container.HostConfig{
Binds: cfg.Volume,
Expand Down

0 comments on commit 37dca79

Please sign in to comment.