mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Refine 'publish.yml'
This commit is contained in:
parent
16812e0966
commit
089c4ee1bb
8
.github/workflows/publish.yml
vendored
8
.github/workflows/publish.yml
vendored
@ -300,14 +300,14 @@ jobs:
|
||||
kubectl -n default rollout restart deployment/ocelot-maintenance
|
||||
kubectl -n default set image deployment/ocelot-neo4j container-ocelot-neo4j=ocelotsocialnetwork/neo4j-community:$BUILD_VERSION
|
||||
kubectl -n default rollout restart deployment/ocelot-neo4j
|
||||
- name: Verify deployment
|
||||
- name: Verify deployment and wait for the pods of each deplyment to get ready for cleaning and seeding of the database
|
||||
run: |
|
||||
kubectl -n default rollout status deployment/ocelot-backend --timeout=240s
|
||||
kubectl -n default rollout status deployment/ocelot-neo4j --timeout=240s
|
||||
kubectl -n default rollout status deployment/ocelot-webapp --timeout=240s
|
||||
kubectl -n default rollout status deployment/ocelot-maintenance --timeout=240s
|
||||
kubectl -n default rollout status deployment/ocelot-backend --timeout=240s
|
||||
kubectl -n default rollout status deployment/ocelot-neo4j --timeout=240s
|
||||
- name: Reset and seed Neo4j database via backend for staging
|
||||
# db cleaning is only possible if env 'PRODUCTION_DB_CLEAN_ALLOW=true' is set in deployment
|
||||
# db cleaning and seeding is only possible in production if env 'PRODUCTION_DB_CLEAN_ALLOW=true' is set in deployment
|
||||
run: |
|
||||
kubectl -n default exec -it $(kubectl -n default get pods | grep ocelot-backend | awk '{ print $1 }') -- /bin/sh -c "node dist/db/clean.js"
|
||||
kubectl -n default exec -it $(kubectl -n default get pods | grep ocelot-backend | awk '{ print $1 }') -- /bin/sh -c "node dist/db/seed.js"
|
||||
|
||||
@ -22,6 +22,8 @@ const environment = {
|
||||
DEBUG: env.NODE_ENV !== 'production' && env.DEBUG,
|
||||
TEST: env.NODE_ENV === 'test',
|
||||
PRODUCTION: env.NODE_ENV === 'production',
|
||||
// used for staging enviroments if 'PRODUCTION=true' and 'PRODUCTION_DB_CLEAN_ALLOW=true'
|
||||
PRODUCTION_DB_CLEAN_ALLOW: env.PRODUCTION_DB_CLEAN_ALLOW === 'true' || false, // default = false
|
||||
DISABLED_MIDDLEWARES: (env.NODE_ENV !== 'production' && env.DISABLED_MIDDLEWARES) || false,
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@ import { cleanDatabase } from '../db/factories'
|
||||
import CONFIG from '../config'
|
||||
|
||||
if (CONFIG.PRODUCTION && !CONFIG.PRODUCTION_DB_CLEAN_ALLOW) {
|
||||
throw new Error(`You cannot clean the database in production environment!`)
|
||||
throw new Error(`You cannot clean the database in a non-staging and real production environment!`)
|
||||
}
|
||||
|
||||
;(async function () {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user