Browse Source

tech(build): installs yarn in build image

bergquist 9 years ago
parent
commit
f7993db73c
4 changed files with 20 additions and 13 deletions
  1. 7 6
      circle.yml
  2. 3 0
      scripts/build/Dockerfile
  3. 10 6
      scripts/build/build.sh
  4. 0 1
      scripts/build/deploy.sh

+ 7 - 6
circle.yml

@@ -37,6 +37,7 @@ deployment:
       - pip install awscli
       - ./scripts/build/build_container.sh
       - ./scripts/build/deploy.sh
+      #- ./scripts/build/sign_packages.sh
       #- aws s3 sync ./dist s3://$BUCKET_NAME
       #- ./scripts/trigger_grafana_docker_build.sh ${TRIGGER_GRAFANA_DOCKER_CIRCLECI_TOKEN}
   gh_tag:
@@ -44,10 +45,10 @@ deployment:
     owner: grafana
     commands:
       - echo lets release stuff!
+      - pip install awscli
+      - ./scripts/build/build_container.sh
+      - ./scripts/build/deploy.sh
       #- ./scripts/build/sign_packages.sh
-#   master:
-#     branch: master
-#     owner: grafana
-#     commands:
-#       - ./scripts/trigger_grafana_packer.sh ${TRIGGER_GRAFANA_PACKER_CIRCLECI_TOKEN}
-#       - ./scripts/trigger_windows_build.sh ${APPVEYOR_TOKEN}
+      #- aws s3 sync ./dist s3://$BUCKET_NAME
+      #- ./scripts/trigger_grafana_docker_build.sh ${TRIGGER_GRAFANA_DOCKER_CIRCLECI_TOKEN}
+

+ 3 - 0
scripts/build/Dockerfile

@@ -21,6 +21,9 @@ RUN /bin/bash -l -c "rvm use 2.1.9 --default"
 RUN curl --silent --location https://rpm.nodesource.com/setup_6.x | bash -
 RUN yum install -y nodejs --nogpgcheck
 
+RUN wget https://dl.yarnpkg.com/rpm/yarn.repo -O /etc/yum.repos.d/yarn.repo
+RUN yum install -y yarn --nogpgcheck
+
 ENV GOLANG_VERSION 1.7.4
 
 RUN wget https://storage.googleapis.com/golang/go1.7.4.linux-amd64.tar.gz

+ 10 - 6
scripts/build/build.sh

@@ -10,14 +10,18 @@ REPO_PATH=$GOPATH/src/github.com/grafana/grafana
 mkdir -p /go/src/github.com/grafana
 cd /go/src/github.com/grafana
 
-echo "CIRCLE BRANCH: ${CIRCLE_BRANCH}"
-
-git clone --depth 1 https://github.com/grafana/grafana.git -b $CIRCLE_BRANCH
-
-cd $REPO_PATH
+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}"
+  git clone --depth 1 https://github.com/grafana/grafana.git
+  cd $REPO_PATH
+  git checkout $CIRCLE_TAG
+fi
 
 go run build.go build
-npm install -g yarn
 yarn install --pure-lockfile
 
 source /etc/profile.d/rvm.sh

+ 0 - 1
scripts/build/deploy.sh

@@ -4,7 +4,6 @@ mkdir -p dist
 
 echo "Circle branch: ${CIRCLE_BRANCH}"
 echo "Circle tag: ${CIRCLE_TAG}"
-echo "dist: $(pwd)/dist"
 docker run -i -t --name gfbuild \
   -v $(pwd)/dist:/tmp/dist \
   -e "CIRCLE_BRANCH=${CIRCLE_BRANCH}" \