#!/bin/bash -exu

export TMPDIR=/tmp
export GOPATH=$PWD/go
export PATH=$GOPATH/bin:$PATH
export INPUTDIR=$PWD/go
pushd $GOPATH/src/github.com/pivotal-cf/email-resource

export GOPATH=${PWD}/Godeps/_workspace:$GOPATH
export PATH=${PWD}/Godeps/_workspace/bin:$PATH

go install github.com/onsi/ginkgo/ginkgo

ginkgo -r "$@"

go build -tags netgo -a -o bin/check ./actions/check
go build -tags netgo -a -o bin/in ./actions/in
go build -tags netgo -a -o bin/out ./actions/out

popd
cp /etc/ssl/certs/ca-certificates.crt test-and-build-docker-resource/ca-certificates.crt
cp -r $INPUTDIR/src/github.com/pivotal-cf/email-resource/bin test-and-build-docker-resource/
cp $INPUTDIR/src/github.com/pivotal-cf/email-resource/Dockerfile test-and-build-docker-resource/ 

#!/bin/bash -exu

export TMPDIR=/tmp
export GOPATH=$PWD/go
export PATH=$GOPATH/bin:$PATH

pushd $GOPATH/src/github.com/pivotal-cf/email-resource

export GOPATH=${PWD}/Godeps/_workspace:$GOPATH
export PATH=${PWD}/Godeps/_workspace/bin:$PATH

go install github.com/onsi/ginkgo/ginkgo

ginkgo -r "$@"

go build -tags netgo -a -o bin/check ./actions/check
go build -tags netgo -a -o bin/in ./actions/in
go build -tags netgo -a -o bin/out ./actions/out

popd
cp /etc/ssl/certs/ca-certificates.crt test-and-build-docker-resource/ca-certificates.crt
cp -r $GOPATH/src/github.com/pivotal-cf/email-resource/bin test-and-build-docker-resource/
cp $GOPATH/src/github.com/pivotal-cf/email-resource/Dockerfile test-and-build-docker-resource/ 

--- 
+++ 
@@ -3,7 +3,7 @@
 export TMPDIR=/tmp
 export GOPATH=$PWD/go
 export PATH=$GOPATH/bin:$PATH
-
+export INPUTDIR=$PWD/go
 pushd $GOPATH/src/github.com/pivotal-cf/email-resource
 
 export GOPATH=${PWD}/Godeps/_workspace:$GOPATH
@@ -19,5 +19,5 @@
 
 popd
 cp /etc/ssl/certs/ca-certificates.crt test-and-build-docker-resource/ca-certificates.crt
-cp -r $GOPATH/src/github.com/pivotal-cf/email-resource/bin test-and-build-docker-resource/
-cp $GOPATH/src/github.com/pivotal-cf/email-resource/Dockerfile test-and-build-docker-resource/ 
+cp -r $INPUTDIR/src/github.com/pivotal-cf/email-resource/bin test-and-build-docker-resource/
+cp $INPUTDIR/src/github.com/pivotal-cf/email-resource/Dockerfile test-and-build-docker-resource/ 
Fix for taking the correct build directory

[#113549907] Make sure all concourse jobs use task outputs for images pipeline

Signed-off-by: Difan Zhao <d4b657a67385123ddb690ebdb0d79b9c6cd38927@pivotal.io>
