diff --git a/ci/pipeline.go b/ci/pipeline.go index 5d62369..6f5b36a 100644 --- a/ci/pipeline.go +++ b/ci/pipeline.go @@ -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 } diff --git a/provider/codebuild/buildspec.go b/provider/codebuild/buildspec.go index feddbb1..9255987 100644 --- a/provider/codebuild/buildspec.go +++ b/provider/codebuild/buildspec.go @@ -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- @@ -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 diff --git a/provider/codebuild/codebuild.go b/provider/codebuild/codebuild.go index b5ac9bf..84690f8 100644 --- a/provider/codebuild/codebuild.go +++ b/provider/codebuild/codebuild.go @@ -18,7 +18,7 @@ import ( const ( envTag = "env" - guestWorkingDirectory = "/tmp/src123456789/src" + guestWorkingDirectory = "/tmp/src" ) // CodeBuild mimics AWS CodeBuild runtime for the localci @@ -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,