Skip to content

Commit

Permalink
Different patching depending on deployment
Browse files Browse the repository at this point in the history
Signed-off-by: Lukasz Gryglicki <[email protected]>
  • Loading branch information
lukaszgryglicki committed May 12, 2019
1 parent 6a1ebdf commit ed6d4a0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
3 changes: 2 additions & 1 deletion images/Dockerfile.full
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ ADD devstatscode.tar .
ADD devstats-docker-images.tar .
ADD grafana-bins.tar .
RUN cp replacer patches/patch.sh /usr/bin/
RUN patch.sh testsrv devstats-demo.net
RUN patch.sh testsrv devstats-demo.net 'cncf prometheus'
RUN patch.sh testsrv devstats.graphql.org 'graphql graphqljs graphiql expressgraphql graphqlspec'
RUN make -f ./images/Makefile.full dockerinstall
RUN make -f ./images/Makefile.full links
FROM alpine
Expand Down
3 changes: 2 additions & 1 deletion images/Dockerfile.minimal
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ ADD devstatscode.tar .
ADD devstats-docker-images.tar .
ADD grafana-bins.tar .
RUN cp replacer patches/patch.sh /usr/bin/
RUN patch.sh testsrv devstats-demo.net
RUN patch.sh testsrv devstats-demo.net 'cncf prometheus'
RUN patch.sh testsrv devstats.graphql.org 'graphql graphqljs graphiql expressgraphql graphqlspec'
RUN make -f ./images/Makefile.minimal dockerinstall
FROM alpine
RUN apk add git bash
Expand Down
10 changes: 9 additions & 1 deletion patches/patch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ then
echo "$0: you need to specify hostname: devstats-demo.net, graphql.devstats.org etc."
exit 2
fi
if [ -z "$3" ]
then
echo "$0: projects to patch not specified, assuming all"
projs="."
else
projs="$3"
fi
if [ "$1" = "prodsrv" ]
then
fromh='devstats.cncf.io'
Expand All @@ -19,7 +26,8 @@ else
echo "$0: 1st arg must be either prodsrv or testsrv, got: $1"
exit 3
fi
files=`find ./metrics/ -name vars.yaml -o -name sync_vars.yaml` || exit 4
cd metrics || exit 4
files=`find $projs -name vars.yaml -o -name sync_vars.yaml` || exit 5
for fn in $files
do
echo "Patching $fn"
Expand Down

0 comments on commit ed6d4a0

Please sign in to comment.