just use an env var for this
This commit is contained in:
parent
08f1db3f68
commit
a61c1f241e
12
README.md
12
README.md
@ -42,6 +42,18 @@ Start the development environment
|
|||||||
$ ./sndev start
|
$ ./sndev start
|
||||||
```
|
```
|
||||||
|
|
||||||
|
By default all will be run. If you only want to run specific services for specific features, set `COMPOSE_PROFILES` to use one or more of `minimal|images|search|payments`. To only run mininal services without images, search, or payments:
|
||||||
|
|
||||||
|
```txt
|
||||||
|
$ COMPOSE_PROFILES=minimal ./sndev start
|
||||||
|
```
|
||||||
|
|
||||||
|
To run with images and payments services:
|
||||||
|
|
||||||
|
```txt
|
||||||
|
$ COMPOSE_PROFILES=images,payments ./sndev start
|
||||||
|
```
|
||||||
|
|
||||||
View all available commands
|
View all available commands
|
||||||
|
|
||||||
```txt
|
```txt
|
||||||
|
38
sndev
38
sndev
@ -9,7 +9,11 @@ docker__compose() {
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
CURRENT_UID=$(id -u) CURRENT_GID=$(id -g) command docker compose --env-file .env.development "$@"
|
if [ -z "$COMPOSE_PROFILES" ]; then
|
||||||
|
COMPOSE_PROFILES="images,search,payments"
|
||||||
|
fi
|
||||||
|
|
||||||
|
CURRENT_UID=$(id -u) CURRENT_GID=$(id -g) COMPOSE_PROFILES=$COMPOSE_PROFILES command docker compose --env-file .env.development "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
docker__exec() {
|
docker__exec() {
|
||||||
@ -74,30 +78,12 @@ EOF
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
profile=''
|
if [ $# -eq 0 ]; then
|
||||||
args='--build'
|
docker__compose up --build
|
||||||
while test $# -gt 0; do
|
exit 0
|
||||||
case "$1" in
|
|
||||||
--profile)
|
|
||||||
profile="$profile --profile $2"
|
|
||||||
shift
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
args="$args $1"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
|
|
||||||
if [ -z "$profile" ]; then
|
|
||||||
if [ -z "$COMPOSE_PROFILES" ]; then
|
|
||||||
profile="--profile images --profile search --profile payments"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
docker__compose $profile up $args
|
docker__compose up "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
sndev__help_start() {
|
sndev__help_start() {
|
||||||
@ -107,8 +93,7 @@ start the sndev env
|
|||||||
USAGE
|
USAGE
|
||||||
$ sndev start [OPTIONS]
|
$ sndev start [OPTIONS]
|
||||||
|
|
||||||
OPTIONS
|
OPTIONS"
|
||||||
--profile stringArray Set the profile of services to start (\"base\"|$(docker__compose config --profiles | awk '{ printf "%s\"%s\"", (NR==1? "" : "|"), $0} END{ print "" }')) (default all)"
|
|
||||||
|
|
||||||
echo "$help"
|
echo "$help"
|
||||||
docker__compose up --help | awk '/Options:/{y=1;next}y'
|
docker__compose up --help | awk '/Options:/{y=1;next}y'
|
||||||
@ -126,8 +111,7 @@ stop the sndev env
|
|||||||
USAGE
|
USAGE
|
||||||
$ sndev stop [OPTIONS]
|
$ sndev stop [OPTIONS]
|
||||||
|
|
||||||
OPTIONS
|
OPTIONS"
|
||||||
--profile stringArray Set the profile of services to start ($(docker__compose config --profiles | awk '{ printf "%s\"%s\"", (NR==1? "" : "|"), $0} END{ print "" }')) (default \"*\")"
|
|
||||||
|
|
||||||
echo "$help"
|
echo "$help"
|
||||||
docker__compose down --help | awk '/Options:/{y=1;next}y'
|
docker__compose down --help | awk '/Options:/{y=1;next}y'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user