Skip to content

Commit ca8c230

Browse files
authored
Merge pull request #77 from openimis-wb/fix/ci
Fix docker build & CI
2 parents 69a5df5 + 1622367 commit ca8c230

5 files changed

Lines changed: 309 additions & 197 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,12 @@ jobs:
3838
- name: Setup environment
3939
run: |
4040
cp .env.example .env
41+
sed -i.bak '/^DEMO_DATASET=/d;/^BE_TAG=/d;/^FE_TAG=/d;/^SECRET_KEY=/d' .env
42+
rm -f .env.bak
43+
echo 'SECRET_KEY=cypressci' >> .env
4144
echo 'DEMO_DATASET=true' >> .env
4245
echo 'BE_TAG=develop' >> .env
4346
echo 'FE_TAG=develop' >> .env
44-
echo 'SECRET_KEY=cypressci' >> .env
4547
cp .env.cache.example .env.cache
4648
cp .env.openSearch.example .env.openSearch
4749
cp .env.database.example .env.database
@@ -68,10 +70,19 @@ jobs:
6870
- name: Cypress run
6971
uses: cypress-io/github-action@v6
7072
with:
71-
record: true
72-
parallel: true
73+
record: false
74+
parallel: false
7375
wait-on: 'http://localhost/front/'
7476
env:
7577
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
7678
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7779

80+
- name: Upload test artifacts
81+
if: always()
82+
uses: actions/upload-artifact@v4
83+
with:
84+
name: cypress-artifacts
85+
path: |
86+
cypress/screenshots/**
87+
cypress/videos/**
88+
cypress/reports/**

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,5 +104,5 @@ This can be useful for local development or verifying a staging deployment,
104104
for example, if the target host is localhost:3000,
105105
pass it into the corresponding test command with `-- --config "baseUrl=http://localhost:3000"`:
106106

107-
Headless: `npx cypress run -- --config "baseUrl=http://localhost:3000"`
108-
Headed: `npx cypress open -- --config "baseUrl=http://localhost:3000"`
107+
- Headless: `npx cypress run --config "baseUrl=http://localhost:3000"`
108+
- Headed: `npx cypress open --config "baseUrl=http://localhost:3000"`

compose.base.yml

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ x-api: &default-api
2121
- OPENSEARCH_HOSTS=${OPENSEARCH_HOSTS}
2222
volumes:
2323
- photos:/openimis-be/openIMIS/images/insurees
24-
# - ./be.openimis.json:/openimis-be/openimis.json
2524
depends_on:
2625
db:
2726
condition: service_healthy
@@ -38,27 +37,16 @@ services:
3837
- OPENIMIS_CONF_JSON=${OPENIMIS_FE_CONF_JSON}
3938
- OPENSEARCH_BASIC_TOKEN=${OPENSEARCH_BASIC_TOKEN}
4039
networks:
41-
proxy:
4240
openimis-net:
41+
ports:
42+
- ${HTTP_PORT:-80}:80
43+
- ${HTTPS_PORT:-443}:443
4344
depends_on:
4445
- backend
4546
volumes:
4647
- ./data/certbot/conf:/etc/letsencrypt
4748
- ./data/certbot/www:/var/www/certbot
48-
# - ./fe.openimis.json:/app/openimis.json
4949
# comment the following line if you are using your own gateway
50-
# - ./conf/nginx:/conf/
51-
ports:
52-
- ${HTTP_PORT:-80}:80
53-
- ${HTTPS_PORT:-443}:443
54-
labels:
55-
- traefik.enable=true
56-
- traefik.http.routers.${PROJECT_NAME}.rule=Host("${DOMAIN}")
57-
- traefik.http.routers.${PROJECT_NAME}.entrypoints=websecure
58-
- traefik.http.routers.${PROJECT_NAME}.tls=true
59-
- traefik.docker.network=proxy
60-
- traefik.http.services.${PROJECT_NAME}.loadbalancer.server.port=80
61-
6250
- ./conf/nginx:/conf/
6351
migrations:
6452
<<: *default-api
@@ -71,13 +59,17 @@ services:
7159
depends_on:
7260
migrations:
7361
condition: service_completed_successfully
62+
redis:
63+
condition: service_healthy
7464
worker:
7565
<<: *default-api
7666
command: worker
7767
restart: always
7868
depends_on:
7969
migrations:
8070
condition: service_completed_successfully
71+
redis:
72+
condition: service_healthy
8173
deploy:
8274
mode: replicated
8375
replicas: ${WORKER_REPLICAS:-3}
@@ -89,8 +81,6 @@ services:
8981
networks:
9082
openimis-net:
9183
name: "${PROJECT_NAME:-openimis}-net"
92-
proxy:
93-
external: true
9484
volumes:
9585
database:
9686
photos:

compose.cache.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ services:
44
restart: always
55
ports:
66
- "6379:6379"
7-
command: redis-server /usr/local/etc/redis/redis.conf --requirepass ${REDIS_PASSWORD} --maxmemory ${REDIS_MAX_MEMORY:-256mb}
7+
command: redis-server /usr/local/etc/redis/redis.conf --requirepass ${REDIS_PASSWORD}
88
volumes:
99
- redis-database:/data
10-
#- ./conf/redis/redis.conf:/usr/local/etc/redis/redis.conf
10+
- ./conf/redis/redis.conf:/usr/local/etc/redis/redis.conf
1111
env_file:
1212
- ".env.cache"
1313
environment:
@@ -16,5 +16,10 @@ services:
1616
- REDIS_DATABASES=1
1717
networks:
1818
openimis-net:
19+
healthcheck:
20+
test: ["CMD", "redis-cli", "-a", "$$REDIS_PASSWORD", "ping"]
21+
interval: 5s
22+
timeout: 3s
23+
retries: 5
1924
volumes:
20-
redis-database:
25+
redis-database:

0 commit comments

Comments
 (0)