# https://github.com/PalmStoneGames/kube-cert-manager/blob/master/buildspec.yml
version: 0.1

environment_variables:
  plaintext:
    SRC_DIR: /go/src/github.com/mweagle/SpartaCodePipeline
    PIPELINE_PACKAGE: SpartaCodePipeline.zip

phases:
  pre_build:
    commands:
      - apt-get update
      - apt-get install zip -y
      - go get -u github.com/golang/dep/cmd/dep
      - mkdir -pv $SRC_DIR && mv $PWD/* $SRC_DIR/ && cd $SRC_DIR && dep ensure -v

  build:
    commands:
      - cd $SRC_DIR && go run main.go provision --level info --s3Bucket weagle --codePipeline $PIPELINE_PACKAGE

  post_build:
    commands:
      # Handle CodeBuild: http://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html#build-spec-ref-syntax
      - unzip $SRC_DIR/.sparta/$PIPELINE_PACKAGE -d $SRC_DIR/.sparta
      - ls $SRC_DIR/.sparta

artifacts:
  base-directory: $SRC_DIR/.sparta
  discard-paths: yes
  files:
    - '**/*'

# https://github.com/PalmStoneGames/kube-cert-manager/blob/master/buildspec.yml
version: 0.1

environment_variables:
  plaintext:
    SRC_DIR: /go/src/github.com/mweagle/SpartaCodePipeline
    PIPELINE_PACKAGE: SpartaCodePipeline.zip

phases:
  pre_build:
    commands:
      - apt-get update
      - apt-get install zip -y
      - go get -u github.com/golang/dep/cmd/dep
      - mkdir -pv $SRC_DIR && mv $PWD/* $SRC_DIR/ && cd $SRC_DIR && dep ensure -v

  build:
    commands:
      - cd $SRC_DIR && go run main.go provision --level info --s3Bucket weagle --codePipelinePackage $PIPELINE_PACKAGE

  post_build:
    commands:
      # Handle CodeBuild: http://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html#build-spec-ref-syntax
      - unzip $SRC_DIR/.sparta/$PIPELINE_PACKAGE -d $SRC_DIR/.sparta
      - ls $SRC_DIR/.sparta

artifacts:
  base-directory: $SRC_DIR/.sparta
  discard-paths: yes
  files:
    - '**/*'

Update to new CLI arg name
Update to new CLI arg name
