This repository has been archived by the owner on Sep 7, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tag master builds of grafana with the changeset.
This PR changes the behaviour of repo a fair bit; firstly, a GRAFANA_VERSION must be specified, otherwise the build will be a no-op. Then, if the GRAFANA_VERSION begins with the character v, we will package a full release; otherwise we will download and package what ever GRAFANA_VERSION is set to and push it to grafana/grafana-dev. Also, trigger a deploy to k8s after all this. Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
- Loading branch information
Showing
5 changed files
with
52 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,28 @@ | ||
#!/bin/sh | ||
|
||
_grafana_tag=$1 | ||
_grafana_version=$(echo ${_grafana_tag} | cut -d "v" -f 2) | ||
_docker_repo=${2:-grafana/grafana} | ||
|
||
# If the tag starts with v, treat this as a official release | ||
if echo "$_grafana_tag" | grep -q "^v"; then | ||
_grafana_version=$(echo "${_grafana_tag}" | cut -d "v" -f 2) | ||
_grafana_url="https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-${_grafana_version}.linux-amd64.tar.gz" | ||
_docker_repo=${2:-grafana/grafana} | ||
else | ||
_grafana_version=$_grafana_tag | ||
_grafana_url="https://s3-us-west-2.amazonaws.com/grafana-releases/master/grafana-${_grafana_version}.linux-x64.tar.gz" | ||
_docker_repo=${2:-grafana/grafana-dev} | ||
fi | ||
|
||
echo "Building ${_docker_repo}:${_grafana_version} from ${_grafana_url}" | ||
|
||
echo ${_grafana_version} | ||
docker build \ | ||
--build-arg GRAFANA_URL="${_grafana_url}" \ | ||
--tag "${_docker_repo}:${_grafana_version}" \ | ||
--no-cache=true . | ||
|
||
if [ "$_grafana_version" != "" ]; then | ||
echo "Building version ${_grafana_version}" | ||
docker build \ | ||
--build-arg GRAFANA_URL="https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-${_grafana_version}.linux-amd64.tar.gz" \ | ||
--tag "${_docker_repo}:${_grafana_version}" \ | ||
--no-cache=true . | ||
docker tag ${_docker_repo}:${_grafana_version} ${_docker_repo}:latest | ||
# Tag as 'latest' for official release; otherwise tag as grafana/grafana:master | ||
if echo "$_grafana_tag" | grep -q "^v"; then | ||
docker tag "${_docker_repo}:${_grafana_version}" "${_docker_repo}:latest" | ||
else | ||
echo "Building latest for master" | ||
docker build \ | ||
--tag "grafana/grafana:master" \ | ||
. | ||
docker tag "${_docker_repo}:${_grafana_version}" "grafana/grafana:master" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh | ||
|
||
curl -s --header "Content-Type: application/json" \ | ||
--data "{\"build_parameters\": {\"CIRCLE_JOB\": \"deploy\", \"IMAGE_NAMES\": \"$1\"}}" \ | ||
--request POST \ | ||
https://circleci.com/api/v1.1/project/github/raintank/deployment_tools/tree/master?circle-token=$CIRCLE_TOKEN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters