Commit 26bb9ad3 by bergquist

build: use initial checkout within container

speedup and simplify the build within the container
parent f185c2c9
...@@ -33,7 +33,7 @@ dependencies: ...@@ -33,7 +33,7 @@ dependencies:
test: test:
override: override:
- bash scripts/circle-test.sh - bash scripts/circle-test.sh
deployment: deployment:
gh_branch: gh_branch:
...@@ -54,4 +54,3 @@ deployment: ...@@ -54,4 +54,3 @@ deployment:
- aws s3 sync ./dist s3://$BUCKET_NAME/release - aws s3 sync ./dist s3://$BUCKET_NAME/release
- ./scripts/trigger_windows_build.sh ${APPVEYOR_TOKEN} ${CIRCLE_SHA1} release - ./scripts/trigger_windows_build.sh ${APPVEYOR_TOKEN} ${CIRCLE_SHA1} release
- ./scripts/trigger_docker_build.sh ${TRIGGER_GRAFANA_PACKER_CIRCLECI_TOKEN} ${CIRCLE_TAG} - ./scripts/trigger_docker_build.sh ${TRIGGER_GRAFANA_PACKER_CIRCLECI_TOKEN} ${CIRCLE_TAG}
...@@ -7,20 +7,7 @@ ...@@ -7,20 +7,7 @@
GOPATH=/go GOPATH=/go
REPO_PATH=$GOPATH/src/github.com/grafana/grafana REPO_PATH=$GOPATH/src/github.com/grafana/grafana
mkdir -p /go/src/github.com/grafana cd /go/src/github.com/grafana/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
echo "current dir: $(pwd)" echo "current dir: $(pwd)"
if [ "$CIRCLE_TAG" != "" ]; then if [ "$CIRCLE_TAG" != "" ]; then
...@@ -47,7 +34,3 @@ else ...@@ -47,7 +34,3 @@ else
echo "Packaging incremental build for $CIRCLE_BRANCH" echo "Packaging incremental build for $CIRCLE_BRANCH"
go run build.go -buildNumber=${CIRCLE_BUILD_NUM} package latest go run build.go -buildNumber=${CIRCLE_BUILD_NUM} package latest
fi fi
cp dist/* /tmp/dist/
...@@ -5,8 +5,10 @@ mkdir -p dist ...@@ -5,8 +5,10 @@ mkdir -p dist
echo "Circle branch: ${CIRCLE_BRANCH}" echo "Circle branch: ${CIRCLE_BRANCH}"
echo "Circle tag: ${CIRCLE_TAG}" echo "Circle tag: ${CIRCLE_TAG}"
docker run -i -t --name gfbuild \ 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_BRANCH=${CIRCLE_BRANCH}" \
-e "CIRCLE_TAG=${CIRCLE_TAG}" \ -e "CIRCLE_TAG=${CIRCLE_TAG}" \
-e "CIRCLE_BUILD_NUM=${CIRCLE_BUILD_NUM}" \ -e "CIRCLE_BUILD_NUM=${CIRCLE_BUILD_NUM}" \
grafana/buildcontainer grafana/buildcontainer
sudo chown -R ${USER:=$(/usr/bin/id -run)}:$USER dist
...@@ -24,7 +24,8 @@ exit_if_fail test -z "$(gofmt -s -l ./pkg | tee /dev/stderr)" ...@@ -24,7 +24,8 @@ exit_if_fail test -z "$(gofmt -s -l ./pkg | tee /dev/stderr)"
echo "running go vet" echo "running go vet"
exit_if_fail test -z "$(go vet ./pkg/... | tee /dev/stderr)" exit_if_fail test -z "$(go vet ./pkg/... | tee /dev/stderr)"
echo "building binaries"
exit_if_fail go run build.go build exit_if_fail go run build.go build
exit_if_fail go test -v ./pkg/...
echo "running go test"
exit_if_fail go test -v ./pkg/...
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment