Skip to content

Commit

Permalink
lint bash scripts.
Browse files Browse the repository at this point in the history
Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
  • Loading branch information
cyriltovena committed Jul 6, 2021
1 parent cc84f4f commit 0c8aca4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions tools/dev/loki-boltdb-storage-s3/compose-down.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash

SCRIPT_DIR=$(cd `dirname $0` && pwd)
SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd)

docker-compose -f ${SCRIPT_DIR}/docker-compose.yml down
docker-compose -f "${SCRIPT_DIR}"/docker-compose.yml down --remove-orphans
18 changes: 9 additions & 9 deletions tools/dev/loki-boltdb-storage-s3/compose-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@

set -e

SCRIPT_DIR=$(cd `dirname $0` && pwd)
SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd)

SRC_DEST=${SCRIPT_DIR}/.src/
SRC_DEST="${SCRIPT_DIR}/.src/"
# sync all sources for dlv
rm -Rf ${SRC_DEST}
mkdir ${SRC_DEST}
rm -Rf "${SRC_DEST}"
mkdir "${SRC_DEST}"
for d in cmd pkg vendor clients
do
cp -Rf ${SCRIPT_DIR}/../../../${d}/ ${SRC_DEST}/${d}/
cp -Rf "${SCRIPT_DIR}/../../../${d}/" "${SRC_DEST}/${d}/"
done

# build loki -gcflags "all=-N -l" disables optimizations that allow for better run with combination with Delve debugger.
CGO_ENABLED=0 GOOS=linux go build -mod=vendor -gcflags "all=-N -l" -o ${SCRIPT_DIR}/loki ${SCRIPT_DIR}/../../../cmd/loki
CGO_ENABLED=0 GOOS=linux go build -mod=vendor -gcflags "all=-N -l" -o "${SCRIPT_DIR}/loki" "${SCRIPT_DIR}/../../../cmd/loki"
# ## install loki driver to send logs
docker plugin install grafana/loki-docker-driver:latest --alias loki-compose --grant-all-permissions || true
# build the compose image
docker-compose -f ${SCRIPT_DIR}/docker-compose.yml build distributor
docker compose -f "${SCRIPT_DIR}"/docker-compose.yml build distributor
# cleanup sources
rm -Rf ${SRC_DEST}
docker-compose -f ${SCRIPT_DIR}/docker-compose.yml up $@
rm -Rf "${SRC_DEST}"
docker compose -f "${SCRIPT_DIR}"/docker-compose.yml up "$@"

0 comments on commit 0c8aca4

Please sign in to comment.