Browse Source

tech(build): disable package iteration for release builds

bergquist 9 years ago
parent
commit
d72f257f27
4 changed files with 51 additions and 35 deletions
  1. 1 1
      build.go
  2. 6 7
      circle.yml
  3. 25 12
      scripts/build/build.sh
  4. 19 15
      yarn.lock

+ 1 - 1
build.go

@@ -324,7 +324,7 @@ func grunt(params ...string) {
 }
 }
 
 
 func gruntBuildArg(task string) []string {
 func gruntBuildArg(task string) []string {
-	var args []string
+	args := []string{task}
 	if includeBuildNumber {
 	if includeBuildNumber {
 		args = append(args, fmt.Sprintf("--pkgVer=%v-%v", linuxPackageVersion, linuxPackageIteration))
 		args = append(args, fmt.Sprintf("--pkgVer=%v-%v", linuxPackageVersion, linuxPackageIteration))
 	} else {
 	} else {

+ 6 - 7
circle.yml

@@ -25,6 +25,11 @@ dependencies:
     - rm -rf ${GOPATH}/src/${REPO_PATH}
     - rm -rf ${GOPATH}/src/${REPO_PATH}
     - mkdir -p ${GOPATH}/src/${ORG_PATH}
     - mkdir -p ${GOPATH}/src/${ORG_PATH}
     - cp -r ~/grafana ${GOPATH}/src/${ORG_PATH}
     - cp -r ~/grafana ${GOPATH}/src/${ORG_PATH}
+  pre:
+    - pip install awscli
+    - sudo apt-get update; sudo apt-get install rpm; sudo apt-get install expect
+    - ./scripts/build/build_container.sh
+
 
 
 test:
 test:
   override:
   override:
@@ -32,11 +37,8 @@ test:
 
 
 deployment:
 deployment:
   gh_branch:
   gh_branch:
-    branch: new_master
+    branch: master
     commands:
     commands:
-      - pip install awscli
-      - sudo apt-get update; sudo apt-get install rpm; sudo apt-get install expect
-      - ./scripts/build/build_container.sh
       - ./scripts/build/deploy.sh
       - ./scripts/build/deploy.sh
       - ./scripts/build/sign_packages.sh
       - ./scripts/build/sign_packages.sh
       - go run build.go sha1-dist
       - go run build.go sha1-dist
@@ -45,9 +47,6 @@ deployment:
   gh_tag:
   gh_tag:
     tag: /^v[0-9]+(\.[0-9]+){2}(-.+|[^-.]*)$/
     tag: /^v[0-9]+(\.[0-9]+){2}(-.+|[^-.]*)$/
     commands:
     commands:
-      - pip install awscli
-      - sudo apt-get update; sudo apt-get install rpm; sudo apt-get install expect
-      - ./scripts/build/build_container.sh
       - ./scripts/build/deploy.sh
       - ./scripts/build/deploy.sh
       - ./scripts/build/sign_packages.sh
       - ./scripts/build/sign_packages.sh
       - go run build.go sha1-dist
       - go run build.go sha1-dist

+ 25 - 12
scripts/build/build.sh

@@ -10,18 +10,27 @@ REPO_PATH=$GOPATH/src/github.com/grafana/grafana
 mkdir -p /go/src/github.com/grafana
 mkdir -p /go/src/github.com/grafana
 cd /go/src/github.com/grafana
 cd /go/src/github.com/grafana
 
 
-if [ -n "${CIRCLE_TAG}" ]; then
-  echo "Building from tag ${CIRCLE_TAG}"
-  git clone --depth 1 https://github.com/grafana/grafana.git -b $CIRCLE_BRANCH
-  cd $REPO_PATH
-else
-  echo "Building from branch ${CIRCLE_BRANCH}"
+if [ "$CIRCLE_TAG" != "" ]; then
+  echo "Builing from tag $CIRCLE_TAG"
   git clone https://github.com/grafana/grafana.git
   git clone https://github.com/grafana/grafana.git
   cd $REPO_PATH
   cd $REPO_PATH
   git checkout $CIRCLE_TAG
   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)"
+
+if [ "$CIRCLE_TAG" != "" ]; then
+  echo "Building incremental build for master"
+  go run build.go build
+else
+  echo "Building a release"
+  go run build.go -includeBuildNumber=false build
 fi
 fi
 
 
-go run build.go build
 yarn install --pure-lockfile
 yarn install --pure-lockfile
 
 
 source /etc/profile.d/rvm.sh
 source /etc/profile.d/rvm.sh
@@ -29,11 +38,15 @@ rvm use 2.1.9 --default
 
 
 gem install fpm -v 1.4
 gem install fpm -v 1.4
 
 
-#if [ -n "${CIRCLE_TAG}" ]; then
-  #go run build.go -includeBuildNumber=false package latest
-#else
-go run build.go package latest
-#fi
+echo "current dir: $(pwd)"
+
+if [ "$CIRCLE_TAG" != "" ]; then
+  echo "Building incremental build for master"
+  go run build.go package latest
+else
+  echo "Building a release"
+  go run build.go -includeBuildNumber=false package latest
+fi
 
 
 cp dist/* /tmp/dist/
 cp dist/* /tmp/dist/
 
 

+ 19 - 15
yarn.lock

@@ -612,8 +612,8 @@ camelcase@^3.0.0:
   resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a"
   resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a"
 
 
 caniuse-db@^1.0.30000617:
 caniuse-db@^1.0.30000617:
-  version "1.0.30000617"
-  resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30000617.tgz#9b7fd81f58a35526315c83e60cb5f076f0beb392"
+  version "1.0.30000618"
+  resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30000618.tgz#821258ff484f662864f28ffbcf849a6247acf1fa"
 
 
 capture-stack-trace@^1.0.0:
 capture-stack-trace@^1.0.0:
   version "1.0.0"
   version "1.0.0"
@@ -823,7 +823,7 @@ concat-map@0.0.1:
   version "0.0.1"
   version "0.0.1"
   resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
   resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
 
 
-concat-stream@1.5.0, concat-stream@^1.4.1, concat-stream@^1.4.6:
+concat-stream@1.5.0:
   version "1.5.0"
   version "1.5.0"
   resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.5.0.tgz#53f7d43c51c5e43f81c8fdd03321c631be68d611"
   resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.5.0.tgz#53f7d43c51c5e43f81c8fdd03321c631be68d611"
   dependencies:
   dependencies:
@@ -831,6 +831,14 @@ concat-stream@1.5.0, concat-stream@^1.4.1, concat-stream@^1.4.6:
     readable-stream "~2.0.0"
     readable-stream "~2.0.0"
     typedarray "~0.0.5"
     typedarray "~0.0.5"
 
 
+concat-stream@^1.4.1, concat-stream@^1.4.6:
+  version "1.6.0"
+  resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.0.tgz#0aac662fd52be78964d5532f694784e70110acf7"
+  dependencies:
+    inherits "^2.0.3"
+    readable-stream "^2.2.2"
+    typedarray "^0.0.6"
+
 configstore@^2.0.0:
 configstore@^2.0.0:
   version "2.1.0"
   version "2.1.0"
   resolved "https://registry.yarnpkg.com/configstore/-/configstore-2.1.0.tgz#737a3a7036e9886102aa6099e47bb33ab1aba1a1"
   resolved "https://registry.yarnpkg.com/configstore/-/configstore-2.1.0.tgz#737a3a7036e9886102aa6099e47bb33ab1aba1a1"
@@ -2303,7 +2311,7 @@ inherits@1:
   version "1.0.2"
   version "1.0.2"
   resolved "https://registry.yarnpkg.com/inherits/-/inherits-1.0.2.tgz#ca4309dadee6b54cc0b8d247e8d7c7a0975bdc9b"
   resolved "https://registry.yarnpkg.com/inherits/-/inherits-1.0.2.tgz#ca4309dadee6b54cc0b8d247e8d7c7a0975bdc9b"
 
 
-inherits@2, inherits@2.0.3, inherits@^2.0.1, inherits@~2.0.0, inherits@~2.0.1:
+inherits@2, inherits@2.0.3, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.0, inherits@~2.0.1:
   version "2.0.3"
   version "2.0.3"
   resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
   resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
 
 
@@ -2556,8 +2564,8 @@ js-base64@^2.1.9:
   resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.1.9.tgz#f0e80ae039a4bd654b5f281fc93f04a914a7fcce"
   resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.1.9.tgz#f0e80ae039a4bd654b5f281fc93f04a914a7fcce"
 
 
 js-tokens@^3.0.0:
 js-tokens@^3.0.0:
-  version "3.0.0"
-  resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.0.tgz#a2f2a969caae142fb3cd56228358c89366957bd1"
+  version "3.0.1"
+  resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.1.tgz#08e9f132484a2c45a30907e9dc4d5567b7f114d7"
 
 
 js-yaml@3.x, js-yaml@^3.4.6, js-yaml@^3.5.1, js-yaml@^3.5.4:
 js-yaml@3.x, js-yaml@^3.4.6, js-yaml@^3.5.1, js-yaml@^3.5.4:
   version "3.7.0"
   version "3.7.0"
@@ -3761,7 +3769,7 @@ readable-stream@1.1:
     isarray "0.0.1"
     isarray "0.0.1"
     string_decoder "~0.10.x"
     string_decoder "~0.10.x"
 
 
-readable-stream@^2.0.0, "readable-stream@^2.0.0 || ^1.1.13", readable-stream@^2.0.2, readable-stream@^2.0.4, readable-stream@^2.0.5:
+readable-stream@^2.0.0, "readable-stream@^2.0.0 || ^1.1.13", readable-stream@^2.0.2, readable-stream@^2.0.4, readable-stream@^2.0.5, readable-stream@^2.2.2:
   version "2.2.2"
   version "2.2.2"
   resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.2.tgz#a9e6fec3c7dda85f8bb1b3ba7028604556fc825e"
   resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.2.tgz#a9e6fec3c7dda85f8bb1b3ba7028604556fc825e"
   dependencies:
   dependencies:
@@ -3953,14 +3961,10 @@ resolve-pkg@^0.1.0:
   dependencies:
   dependencies:
     resolve-from "^2.0.0"
     resolve-from "^2.0.0"
 
 
-resolve@1.1.x, resolve@~1.1.0:
+resolve@1.1.x, resolve@^1.1.6, resolve@^1.1.7, resolve@~1.1.0:
   version "1.1.7"
   version "1.1.7"
   resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b"
   resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b"
 
 
-resolve@^1.1.6, resolve@^1.1.7:
-  version "1.2.0"
-  resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.2.0.tgz#9589c3f2f6149d1417a40becc1663db6ec6bc26c"
-
 restore-cursor@^1.0.1:
 restore-cursor@^1.0.1:
   version "1.0.1"
   version "1.0.1"
   resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-1.0.1.tgz#34661f46886327fed2991479152252df92daa541"
   resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-1.0.1.tgz#34661f46886327fed2991479152252df92daa541"
@@ -4396,8 +4400,8 @@ systemjs@0.19.41:
     when "^3.7.5"
     when "^3.7.5"
 
 
 systemjs@^0.19.43:
 systemjs@^0.19.43:
-  version "0.19.45"
-  resolved "https://registry.yarnpkg.com/systemjs/-/systemjs-0.19.45.tgz#897010fb172f0016601b93b86e7f17568c52d495"
+  version "0.19.46"
+  resolved "https://registry.yarnpkg.com/systemjs/-/systemjs-0.19.46.tgz#c04574b3335f052a0e3c7a00ee4188c6e4c1e38e"
   dependencies:
   dependencies:
     when "^3.7.5"
     when "^3.7.5"
 
 
@@ -4574,7 +4578,7 @@ type-is@~1.6.10, type-is@~1.6.14:
     media-typer "0.3.0"
     media-typer "0.3.0"
     mime-types "~2.1.13"
     mime-types "~2.1.13"
 
 
-typedarray@~0.0.5:
+typedarray@^0.0.6, typedarray@~0.0.5:
   version "0.0.6"
   version "0.0.6"
   resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
   resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"