This repository has been archived by the owner on Dec 27, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
bohendo
committed
Oct 19, 2020
1 parent
d152654
commit b62ca0b
Showing
19 changed files
with
211 additions
and
196 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,7 @@ config-prod.json | |
**/.test-store | ||
**/.tmp | ||
**/cache/** | ||
**/*.backup | ||
|
||
# Data Storage | ||
**/.bot-store/ | ||
|
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
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,34 +1,34 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
root="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." >/dev/null 2>&1 && pwd )" | ||
project="`cat $root/package.json | grep '"name":' | head -n 1 | cut -d '"' -f 4`" | ||
#root="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." >/dev/null 2>&1 && pwd )" | ||
#project="$(grep '"name":' "$root/package.json" | head -n 1 | cut -d '"' -f 4)" | ||
|
||
target=$1 | ||
shift | ||
|
||
service_id="`docker service ls --format '{{.ID}} {{.Name}}' |\ | ||
service_id=$(docker service ls --format '{{.ID}} {{.Name}}' |\ | ||
grep "_$target" |\ | ||
head -n 1 |\ | ||
cut -d " " -f 1 | ||
`" | ||
) | ||
|
||
if [[ -n "$service_id" ]] | ||
then | ||
docker service ps --no-trunc $service_id | ||
docker service ps --no-trunc "$service_id" | ||
sleep 0.5 | ||
exec docker service logs --follow --raw --tail 100 $service_id $@ | ||
exec docker service logs --follow --raw --tail 100 "$service_id" "$@" | ||
fi | ||
|
||
container_id="`docker container ls --filter 'status=running' --format '{{.ID}} {{.Names}}' |\ | ||
container_id=$(docker container ls --filter 'status=running' --format '{{.ID}} {{.Names}}' |\ | ||
cut -d "." -f 1 |\ | ||
grep "_$target" |\ | ||
sort |\ | ||
head -n 1 |\ | ||
cut -d " " -f 1 | ||
`" | ||
) | ||
|
||
if [[ -n "$container_id" ]] | ||
then exec docker container logs --tail 100 --follow $container_id $@ | ||
then exec docker container logs --tail 100 --follow "$container_id" "$@" | ||
else echo "No service or running container names match: $target" | ||
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
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
Oops, something went wrong.