diff --git a/.env.local b/.env.local index 6f01ff6..281b935 100644 --- a/.env.local +++ b/.env.local @@ -6,4 +6,9 @@ POSTGRES_PASSWORD=reportingdashboard123 NODE_ENV=local ACCESS_TOKEN_SECRET=4cd7234152590dcfe77e1b6fc52e84f4d30c06fddadd0dd2fb42cbc51fa14b1bb195bbe9d72c9599ba0c6b556f9bd1607a8478be87e5a91b697c74032e0ae7af REDIS_HOST=localhost -REDIS_PORT=6379 \ No newline at end of file +REDIS_PORT=6379 +BUILD_NAME=docker +POSTGRES_PORT=5432 +NODE_ENV=production +ENVIRONMENT_NAME=local +APP_PATH=/Users/apple/repos/node-express-graphql-template diff --git a/.github/workflows/test_workflows/keploy.sh b/.github/workflows/test_workflows/keploy.sh index 98d0bd7..05cecde 100644 --- a/.github/workflows/test_workflows/keploy.sh +++ b/.github/workflows/test_workflows/keploy.sh @@ -1,18 +1,19 @@ curl --silent -O -L https://keploy.io/ent/install.sh -export DOCKER_BUILDKIT=1 + +sudo docker compose -f keploy-docker-compose.yml build export KEPLOY_API_KEY=Iba1IAlh+GKnXPzYeA== curl --silent -o keployE --location "https://keploy-enterprise.s3.us-west-2.amazonaws.com/releases/latest/enterprise_linux_amd64" sudo chmod a+x keployE && sudo mkdir -p /usr/local/bin && sudo mv keployE /usr/local/bin -export ENVIRONMENT_NAME=local + + # Build the project locally echo "Project built successfully" -# Start keploy in test mode -sudo -E env PATH="$PATH" keployE test -c "sudo docker compose --env-file .env.local up" --containerName "custom_app" --delay 250 --buildDelay 300 --apiTimeout 300 --generateGithubActions=false --coverage=false + +sudo -E env PATH="$PATH" /usr/local/bin/keployE test -c "sudo docker compose -f keploy-docker-compose.yml up" --containerName "custom_app" --delay 30 --apiTimeout 300 --generateGithubActions=false --coverage=false echo "Keploy started in test mode" -# Initialize a flag to track the overall test status all_passed=true # Loop through test sets 1 to 4 diff --git a/Dockerfile b/Dockerfile index 6fa487e..6fc6e84 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,7 +17,7 @@ ARG ENVIRONMENT_NAME ARG BUILD_NAME ARG APP_PATH ENV APP_PATH=${APP_PATH:-/default/path} -RUN yarn global add sequelize-cli@6.2.0 nyc +RUN yarn global add sequelize-cli@6.2.0 nyc@15.1.0 RUN yarn add shelljs bull dotenv pg sequelize@6.6.5 RUN apk add --no-cache dumb-init ADD scripts/migrate-and-run.sh ${APP_PATH}/ diff --git a/docker-compose.yml b/docker-compose.yml index a4f8661..a10a641 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,22 +1,22 @@ version: '3' services: - # db_postgres: - # image: postgres - # ports: - # - 5432:5432 - # restart: always - # env_file: - # - .env.docker - # networks: - # - keploy-network + db_postgres: + image: postgres + ports: + - 5432:5432 + restart: always + env_file: + - .env.docker + networks: + - keploy-network - # redis: - # image: 'redis:alpine' - # ports: - # - '6379:6379' - # command: ['redis-server', '--bind', 'redis', '--port', '6379'] - # networks: - # - keploy-network + redis: + image: 'redis:alpine' + ports: + - '6379:6379' + command: ['redis-server', '--bind', 'redis', '--port', '6379'] + networks: + - keploy-network app: container_name: custom_app @@ -26,13 +26,13 @@ services: ENVIRONMENT_NAME: .docker BUILD_NAME: docker APP_PATH: ${APP_PATH} - # depends_on: - # - db_postgres - # - redis + depends_on: + - db_postgres + - redis ports: - 9000:9000 env_file: - - .env.docker + - .env.local networks: - keploy-network volumes: diff --git a/keploy-docker-compose.yml b/keploy-docker-compose.yml new file mode 100644 index 0000000..74ea795 --- /dev/null +++ b/keploy-docker-compose.yml @@ -0,0 +1,23 @@ +version: '3' +services: + app: + container_name: custom_app + build: + context: . + args: + BUILD_NAME: keploy + APP_PATH: ${APP_PATH} + ports: + - 9000:9000 + env_file: + - .env.local + networks: + - keploy-network + volumes: + - /Users/apple/repos/node-express-graphql-template/dedupData.yaml:${APP_PATH}/dedupData.yaml + stop_grace_period: 50s # Increase the stop grace period to 50 seconds + + +networks: + keploy-network: + external: true diff --git a/keploy.yml b/keploy.yml index 6114e3e..fab410a 100755 --- a/keploy.yml +++ b/keploy.yml @@ -24,7 +24,7 @@ test: test-sets: {} delay: 5 apiTimeout: 30 - coverage: true + coverage: false goCoverage: false coverageReportPath: '' ignoreOrdering: true diff --git a/package.json b/package.json index 46cd791..555973b 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "build:qa": "export ENVIRONMENT_NAME=qa && rm -rf dist && webpack --mode development --config webpack.dev.config.js", "build:prod": "export ENVIRONMENT_NAME=production && rm -rf dist && webpack --mode production --config webpack.prod.config.js", "build:docker": "export ENVIRONMENT_NAME=local && rm -rf dist && webpack --mode production --config webpack.prod.config.js", + "build:keploy": "export ENVIRONMENT_NAME=local && rm -rf dist && webpack --mode production --config webpack.prod.config.js", "start": "nyc node ./dist/main.js", "clean": "rimraf dist", "format": "prettier-standard './**/**/*.js'",