Last active
September 1, 2018 23:21
-
-
Save svet-b/8912a3d7be3b013f5629e1268b652673 to your computer and use it in GitHub Desktop.
Setting up Grafana environment
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
#!/bin/bash | |
export CODEDIR="/opt/codebase" | |
export DEVGROUP="devs" | |
export GH_ORIG="github.com/grafana" | |
export GH_FORK="github.com/ammpio" | |
export REPONAME="grafana" | |
export GOROOT=/usr/local/go | |
export GOPATH=$CODEDIR | |
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH | |
# If code directory doesn't exist, create it | |
if [!-d $CODEDIR]; then | |
mkdir -p $CODEDIR; | |
fi; | |
# Get code from repo. The -d flags make go stop after download. | |
go get -v -d $GH_FORK/$REPONAME | |
cd $CODEDIR/$GH_FORK/$REPONAME | |
## First-time setup: | |
# Add remote for upstream repo | |
git remote add upstream https://github.com/grafana/grafana | |
# In order to be able to push to the fork: | |
git remote set-url origin [email protected]:ammpio/grafana.git | |
# Fetch upstream and merge changes into forked master | |
git fetch upstream | |
git checkout master | |
# Merge a particular tagged commit | |
git merge v5.2.0 | |
# Or merge the upstream master | |
git merge upstream/master | |
# Push to fork | |
git push |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment