diff --git a/circle.yml b/circle.yml index 75dae71d0ab..9c5f0f1ccbd 100644 --- a/circle.yml +++ b/circle.yml @@ -33,7 +33,7 @@ dependencies: test: override: - - bash scripts/circle-test.sh + - bash scripts/circle-test.sh deployment: gh_branch: @@ -54,4 +54,3 @@ deployment: - aws s3 sync ./dist s3://$BUCKET_NAME/release - ./scripts/trigger_windows_build.sh ${APPVEYOR_TOKEN} ${CIRCLE_SHA1} release - ./scripts/trigger_docker_build.sh ${TRIGGER_GRAFANA_PACKER_CIRCLECI_TOKEN} ${CIRCLE_TAG} - diff --git a/scripts/build/build.sh b/scripts/build/build.sh index 6e1b2cbe5b9..4f16ee240c4 100755 --- a/scripts/build/build.sh +++ b/scripts/build/build.sh @@ -7,20 +7,7 @@ GOPATH=/go REPO_PATH=$GOPATH/src/github.com/grafana/grafana -mkdir -p /go/src/github.com/grafana -cd /go/src/github.com/grafana - -if [ "$CIRCLE_TAG" != "" ]; then - echo "Builing from tag $CIRCLE_TAG" - git clone https://github.com/grafana/grafana.git - cd $REPO_PATH - git checkout $CIRCLE_TAG -else - echo "Building from branch $CIRCLE_BRANCH" - git clone --depth 1 https://github.com/grafana/grafana.git -b $CIRCLE_BRANCH - cd $REPO_PATH -fi - +cd /go/src/github.com/grafana/grafana echo "current dir: $(pwd)" if [ "$CIRCLE_TAG" != "" ]; then @@ -47,7 +34,3 @@ else echo "Packaging incremental build for $CIRCLE_BRANCH" go run build.go -buildNumber=${CIRCLE_BUILD_NUM} package latest fi - -cp dist/* /tmp/dist/ - - diff --git a/scripts/build/deploy.sh b/scripts/build/deploy.sh index bfc735e4c79..49b2a9e3a7c 100755 --- a/scripts/build/deploy.sh +++ b/scripts/build/deploy.sh @@ -5,8 +5,10 @@ mkdir -p dist echo "Circle branch: ${CIRCLE_BRANCH}" echo "Circle tag: ${CIRCLE_TAG}" docker run -i -t --name gfbuild \ - -v $(pwd)/dist:/tmp/dist \ + -v $(pwd):/go/src/github.com/grafana/grafana \ -e "CIRCLE_BRANCH=${CIRCLE_BRANCH}" \ -e "CIRCLE_TAG=${CIRCLE_TAG}" \ -e "CIRCLE_BUILD_NUM=${CIRCLE_BUILD_NUM}" \ grafana/buildcontainer + +sudo chown -R ${USER:=$(/usr/bin/id -run)}:$USER dist diff --git a/scripts/circle-test.sh b/scripts/circle-test.sh index e11007d8e76..a3a2790bcdc 100755 --- a/scripts/circle-test.sh +++ b/scripts/circle-test.sh @@ -24,7 +24,8 @@ exit_if_fail test -z "$(gofmt -s -l ./pkg | tee /dev/stderr)" echo "running go vet" exit_if_fail test -z "$(go vet ./pkg/... | tee /dev/stderr)" +echo "building binaries" exit_if_fail go run build.go build + +echo "running go test" exit_if_fail go test -v ./pkg/... - -