Skip to content

Commit

Permalink
Fixing keploy CI
Browse files Browse the repository at this point in the history
  • Loading branch information
sagar-t-97 committed Jun 13, 2024
1 parent 4366279 commit 0c41431
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 28 deletions.
7 changes: 6 additions & 1 deletion .env.local
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,9 @@ POSTGRES_PASSWORD=reportingdashboard123
NODE_ENV=local
ACCESS_TOKEN_SECRET=4cd7234152590dcfe77e1b6fc52e84f4d30c06fddadd0dd2fb42cbc51fa14b1bb195bbe9d72c9599ba0c6b556f9bd1607a8478be87e5a91b697c74032e0ae7af
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_PORT=6379
BUILD_NAME=docker
POSTGRES_PORT=5432
NODE_ENV=production
ENVIRONMENT_NAME=local
APP_PATH=/Users/apple/repos/node-express-graphql-template
11 changes: 6 additions & 5 deletions .github/workflows/test_workflows/keploy.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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}/
Expand Down
40 changes: 20 additions & 20 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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:
Expand Down
23 changes: 23 additions & 0 deletions keploy-docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion keploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ test:
test-sets: {}
delay: 5
apiTimeout: 30
coverage: true
coverage: false
goCoverage: false
coverageReportPath: ''
ignoreOrdering: true
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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'",
Expand Down

0 comments on commit 0c41431

Please sign in to comment.