diff --git a/scripts/.common.sh b/scripts/.common.sh new file mode 100644 index 0000000..3cea091 --- /dev/null +++ b/scripts/.common.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# Colors +BLUE='\E[1;34m' +CYAN='\E[1;36m' +GREEN='\E[1;32m' +RED='\E[1;31m' +RESET='\E[0m' +YELLOW='\E[1;33m' + +export BLUE CYAN GREEN RED RESET YELLOW + +# Docker Compose +COMPOSE_PROJECT_NAME="npmdev" +COMPOSE_FILE="docker/docker-compose.dev.yml" + +export COMPOSE_FILE COMPOSE_PROJECT_NAME diff --git a/scripts/buildx b/scripts/buildx index b22d881..4da6c16 100755 --- a/scripts/buildx +++ b/scripts/buildx @@ -1,10 +1,7 @@ #!/bin/bash -CYAN='\E[1;36m' -YELLOW='\E[1;33m' -BLUE='\E[1;34m' -GREEN='\E[1;32m' -RESET='\E[0m' +DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +. "$DIR/.common.sh" echo -e "${BLUE}❯ ${CYAN}Building docker multiarch: ${YELLOW}${*}${RESET}" diff --git a/scripts/destroy-dev b/scripts/destroy-dev index e86b33f..1309aad 100755 --- a/scripts/destroy-dev +++ b/scripts/destroy-dev @@ -1,15 +1,7 @@ #!/bin/bash -e DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" - -CYAN='\E[1;36m' -BLUE='\E[1;34m' -RED='\E[1;31m' -RESET='\E[0m' - -COMPOSE_PROJECT_NAME="npmdev" -COMPOSE_FILE="docker/docker-compose.dev.yml" -export COMPOSE_FILE COMPOSE_PROJECT_NAME +. "$DIR/.common.sh" # Ensure docker-compose exists # Make sure docker exists diff --git a/scripts/docs-build b/scripts/docs-build index cdab811..9903139 100755 --- a/scripts/docs-build +++ b/scripts/docs-build @@ -1,12 +1,7 @@ #!/bin/bash -e DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" - -CYAN='\E[1;36m' -BLUE='\E[1;34m' -RED='\E[1;31m' -GREEN='\E[1;32m' -RESET='\E[0m' +. "$DIR/.common.sh" # Ensure docker-compose exists if hash docker 2>/dev/null; then diff --git a/scripts/docs-upload b/scripts/docs-upload index 0f3761d..ea71fb8 100755 --- a/scripts/docs-upload +++ b/scripts/docs-upload @@ -2,11 +2,8 @@ # Note: This script is designed to be run inside CI builds -CYAN='\E[1;36m' -YELLOW='\E[1;33m' -BLUE='\E[1;34m' -GREEN='\E[1;32m' -RESET='\E[0m' +DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +. "$DIR/.common.sh" echo -e "${BLUE}❯ ${CYAN}Uploading docs in: ${YELLOW}$1${RESET}" diff --git a/scripts/frontend-build b/scripts/frontend-build index a54c46b..05be2ea 100755 --- a/scripts/frontend-build +++ b/scripts/frontend-build @@ -1,12 +1,7 @@ #!/bin/bash -e DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" - -CYAN='\E[1;36m' -BLUE='\E[1;34m' -RED='\E[1;31m' -GREEN='\E[1;32m' -RESET='\E[0m' +. "$DIR/.common.sh" DOCKER_IMAGE=jc21/alpine-nginx-full:node diff --git a/scripts/start-dev b/scripts/start-dev index a47a935..a5e647f 100755 --- a/scripts/start-dev +++ b/scripts/start-dev @@ -1,16 +1,7 @@ #!/bin/bash -e DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" - -CYAN='\E[1;36m' -BLUE='\E[1;34m' -YELLOW='\E[1;33m' -RED='\E[1;31m' -RESET='\E[0m' - -COMPOSE_PROJECT_NAME="npmdev" -COMPOSE_FILE="docker/docker-compose.dev.yml" -export COMPOSE_FILE COMPOSE_PROJECT_NAME +. "$DIR/.common.sh" # Ensure docker-compose exists if hash docker-compose 2>/dev/null; then diff --git a/scripts/stop-dev b/scripts/stop-dev index 97c68c8..3d27551 100755 --- a/scripts/stop-dev +++ b/scripts/stop-dev @@ -1,15 +1,7 @@ #!/bin/bash -e DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" - -CYAN='\E[1;36m' -BLUE='\E[1;34m' -RED='\E[1;31m' -RESET='\E[0m' - -COMPOSE_PROJECT_NAME="npmdev" -COMPOSE_FILE="docker/docker-compose.dev.yml" -export COMPOSE_FILE COMPOSE_PROJECT_NAME +. "$DIR/.common.sh" # Ensure docker-compose exists # Make sure docker exists diff --git a/scripts/test-dev b/scripts/test-dev index d4ad018..eb5c5bd 100755 --- a/scripts/test-dev +++ b/scripts/test-dev @@ -1,15 +1,7 @@ #!/bin/bash -e DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" - -CYAN='\E[1;36m' -BLUE='\E[1;34m' -RED='\E[1;31m' -RESET='\E[0m' - -COMPOSE_PROJECT_NAME="npmdev" -COMPOSE_FILE="docker/docker-compose.dev.yml" -export COMPOSE_FILE COMPOSE_PROJECT_NAME +. "$DIR/.common.sh" # Ensure docker-compose exists if hash docker-compose 2>/dev/null; then diff --git a/scripts/wait-healthy b/scripts/wait-healthy index b89aef3..b8da5d6 100755 --- a/scripts/wait-healthy +++ b/scripts/wait-healthy @@ -1,11 +1,7 @@ #!/bin/bash -CYAN='\E[1;36m' -YELLOW='\E[1;33m' -BLUE='\E[1;34m' -GREEN='\E[1;32m' -RED='\E[1;31m' -RESET='\E[0m' +DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +. "$DIR/.common.sh" if [ "$1" == "" ]; then echo "Waits for a docker container to be healthy." diff --git a/test/cypress/Dockerfile b/test/cypress/Dockerfile index 6447a16..66f7e3e 100644 --- a/test/cypress/Dockerfile +++ b/test/cypress/Dockerfile @@ -1,4 +1,4 @@ -FROM cypress/included:4.0.2 +FROM cypress/included:4.6.0 COPY --chown=1000 ./test /test diff --git a/test/package.json b/test/package.json index 3636fb9..0ac87e5 100644 --- a/test/package.json +++ b/test/package.json @@ -7,7 +7,7 @@ "@jc21/cypress-swagger-validation": "^0.0.5", "@jc21/restler": "^3.4.0", "chalk": "^3.0.0", - "cypress": "^4.0.2", + "cypress": "^4.6.0", "cypress-plugin-retries": "^1.5.2", "eslint": "^6.7.2", "eslint-plugin-align-assignments": "^1.1.2",