From 9d92c37409e19691e82a71ab74bd531d4f1ec3fe Mon Sep 17 00:00:00 2001 From: Noel Palo Date: Sun, 3 Sep 2023 13:23:36 +0800 Subject: [PATCH] feature/DLT-28-create-shell-script - Create scrips to make command running easy --- scripts/artisan.sh | 13 +++++++++++++ scripts/build.sh | 10 ++++++++++ scripts/composer.sh | 12 ++++++++++++ scripts/docker-compose.sh | 8 ++++++++ scripts/down.sh | 12 ++++++++++++ scripts/exec.sh | 12 ++++++++++++ scripts/main-docker-compose.sh | 8 ++++++++ scripts/prune.sh | 10 ++++++++++ scripts/run.sh | 12 ++++++++++++ scripts/stop.sh | 12 ++++++++++++ scripts/up.sh | 12 ++++++++++++ 11 files changed, 121 insertions(+) create mode 100644 scripts/artisan.sh create mode 100644 scripts/build.sh create mode 100644 scripts/composer.sh create mode 100644 scripts/docker-compose.sh create mode 100644 scripts/down.sh create mode 100644 scripts/exec.sh create mode 100644 scripts/main-docker-compose.sh create mode 100644 scripts/prune.sh create mode 100644 scripts/run.sh create mode 100644 scripts/stop.sh create mode 100644 scripts/up.sh diff --git a/scripts/artisan.sh b/scripts/artisan.sh new file mode 100644 index 0000000..a738a2f --- /dev/null +++ b/scripts/artisan.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +set -eo pipefail + +#docker compose \ +# --env-file "docker/environments/config.env" \ +# -f "docker/docker-compose.yml" \ +# run --rm artisan \ +# ${@} + +./scripts/run.sh \ + artisan \ + ${@} \ No newline at end of file diff --git a/scripts/build.sh b/scripts/build.sh new file mode 100644 index 0000000..2da9a9a --- /dev/null +++ b/scripts/build.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +set -eo pipefail + +#docker compose \ +# --env-file "docker/environments/config.env" \ +# -f "docker/docker-compose.yml" \ +# build +./scripts/main-docker-compose.sh \ + build \ No newline at end of file diff --git a/scripts/composer.sh b/scripts/composer.sh new file mode 100644 index 0000000..37509aa --- /dev/null +++ b/scripts/composer.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +set -eo pipefail + +#docker compose \ +# --env-file "docker/environments/config.env" \ +# -f "docker/docker-compose.yml" \ +# run --rm composer \ +# ${@} +./scripts/run.sh \ + composer \ + ${@} \ No newline at end of file diff --git a/scripts/docker-compose.sh b/scripts/docker-compose.sh new file mode 100644 index 0000000..ea816ab --- /dev/null +++ b/scripts/docker-compose.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -eo pipefail + +docker compose \ + --env-file "docker/environments/config.env" \ + -f "docker/docker-compose.yml" \ + ${@} diff --git a/scripts/down.sh b/scripts/down.sh new file mode 100644 index 0000000..a6c077c --- /dev/null +++ b/scripts/down.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +set -eo pipefail + +#docker compose \ +# --env-file "docker/environments/config.env" \ +# -f "docker/docker-compose.yml" \ +# down \ +# ${@} +./scripts/main-docker-compose.sh \ + down \ + ${@} \ No newline at end of file diff --git a/scripts/exec.sh b/scripts/exec.sh new file mode 100644 index 0000000..cbb4a1d --- /dev/null +++ b/scripts/exec.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +set -eo pipefail + +#docker compose \ +# --env-file "docker/environments/config.env" \ +# -f "docker/docker-compose.yml" \ +# run --rm \ +# ${@} +./scripts/main-docker-compose.sh \ + exec \ + ${@} \ No newline at end of file diff --git a/scripts/main-docker-compose.sh b/scripts/main-docker-compose.sh new file mode 100644 index 0000000..ea816ab --- /dev/null +++ b/scripts/main-docker-compose.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -eo pipefail + +docker compose \ + --env-file "docker/environments/config.env" \ + -f "docker/docker-compose.yml" \ + ${@} diff --git a/scripts/prune.sh b/scripts/prune.sh new file mode 100644 index 0000000..8531228 --- /dev/null +++ b/scripts/prune.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +set -eo pipefail + +#docker rmi -f $(docker images -q) +#docker rmi $(docker images) +#docker rmi $(docker images -qf dangling=true); +docker system prune -a --force +docker ps +docker images \ No newline at end of file diff --git a/scripts/run.sh b/scripts/run.sh new file mode 100644 index 0000000..614a2f8 --- /dev/null +++ b/scripts/run.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +set -eo pipefail + +#docker compose \ +# --env-file "docker/environments/config.env" \ +# -f "docker/docker-compose.yml" \ +# run --rm \ +# ${@} +./scripts/main-docker-compose.sh \ + run --rm \ + ${@} \ No newline at end of file diff --git a/scripts/stop.sh b/scripts/stop.sh new file mode 100644 index 0000000..71d8a22 --- /dev/null +++ b/scripts/stop.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +set -eo pipefail + +#docker compose \ +# --env-file "docker/environments/config.env" \ +# -f "docker/docker-compose.yml" \ +# stop \ +# ${@} +./scripts/main-docker-compose.sh \ + stop \ + ${@} \ No newline at end of file diff --git a/scripts/up.sh b/scripts/up.sh new file mode 100644 index 0000000..74b04b6 --- /dev/null +++ b/scripts/up.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +set -eo pipefail + +#docker compose \ +# --env-file "docker/environments/config.env" \ +# -f "docker/docker-compose.yml" \ +# up \ +# ${@} +./scripts/main-docker-compose.sh \ + up \ + ${@} \ No newline at end of file