mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Build: allow dynamically change docker image (#18112)
* Build: allow dynamically change docker image Right now, only for couple DBs. With the 2.1, you can do `${TAG:-5.6}` without needing the `.env` file, but it seems it would be better for back-compat to support `.env` right now. Fixes #17891 * Build: add prefix for removal process * Docs: mention makefile command instead of the bash Since we are moving to makefile for things and make command simplifies some of the actions you have to perform to work with different environments * Docs: mention dynamic tags in the docs * Docs: avoid name collision Fixes #16107
This commit is contained in:
committed by
Torkel Ödegaard
parent
29c89de140
commit
b049b003f2
@@ -8,8 +8,8 @@ grafana_config_file=conf.tmp
|
||||
grafana_config=config
|
||||
|
||||
compose_header_file=docker/compose_header.yml
|
||||
fig_file=docker-compose.yaml
|
||||
fig_config=docker-compose.yaml
|
||||
compose_file=docker-compose.yaml
|
||||
env_file=.env
|
||||
|
||||
if [ "$#" == 0 ]; then
|
||||
blocks=`ls $blocks_dir`
|
||||
@@ -24,15 +24,15 @@ if [ "$#" == 0 ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
for file in $grafana_config_file $fig_file; do
|
||||
for file in $grafana_config_file $compose_file $env_file; do
|
||||
if [ -e $file ]; then
|
||||
echo "Deleting $file"
|
||||
rm $file
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Adding Compose header to $fig_file"
|
||||
cat $compose_header_file >> $fig_file
|
||||
echo "Adding Compose header to $compose_file"
|
||||
cat $compose_header_file >> $compose_file
|
||||
|
||||
for dir in $@; do
|
||||
current_dir=$blocks_dir/$dir
|
||||
@@ -47,10 +47,16 @@ for dir in $@; do
|
||||
echo "" >> $grafana_config_file
|
||||
fi
|
||||
|
||||
if [ -e $current_dir/$fig_config ]; then
|
||||
echo "Adding $current_dir/$fig_config to $fig_file"
|
||||
cat $current_dir/$fig_config >> $fig_file
|
||||
echo "" >> $fig_file
|
||||
if [ -e $current_dir/$compose_file ]; then
|
||||
echo "Adding $current_dir/$compose_file to $compose_file"
|
||||
cat $current_dir/$compose_file >> $compose_file
|
||||
echo "" >> $compose_file
|
||||
fi
|
||||
|
||||
if [ -e $current_dir/$env_file ]; then
|
||||
echo "Adding $current_dir/$env_file to .env"
|
||||
cat $current_dir/$env_file >> .env
|
||||
echo "" >> .env
|
||||
fi
|
||||
done
|
||||
|
||||
|
Reference in New Issue
Block a user