6de2455917
- Added GLOBAL_MARKETS_TITLE to all translation files - Updated footer with 12 markets (4 active + 8 upcoming) - Translated market section to: zh-cn, zh-tw, ja, ko, th, vi, id, ms, hi - Built and deployed to production - CloudFront invalidation: I3RTMXVFDJXWLG3SYX208OP1CC
47 lines
1.4 KiB
YAML
47 lines
1.4 KiB
YAML
apiVersion: batch/v1
|
|
kind: Job
|
|
metadata:
|
|
name: vims-init-db
|
|
namespace: vims
|
|
spec:
|
|
template:
|
|
spec:
|
|
containers:
|
|
- name: init-db
|
|
image: 155407238699.dkr.ecr.eu-north-1.amazonaws.com/vims:prod
|
|
command: ["node", "-e"]
|
|
args:
|
|
- |
|
|
const { Sequelize } = require('sequelize');
|
|
const config = {
|
|
host: process.env.DB_HOST || 'vims-postgres.vims.svc.cluster.local',
|
|
port: process.env.DB_PORT || 5432,
|
|
database: process.env.DB_NAME || 'vims',
|
|
username: process.env.DB_USER || 'postgres',
|
|
password: process.env.DB_PASSWORD || 'postgres',
|
|
dialect: 'postgres'
|
|
};
|
|
|
|
const sequelize = new Sequelize(config.database, config.username, config.password, {
|
|
host: config.host,
|
|
port: config.port,
|
|
dialect: config.dialect,
|
|
logging: false
|
|
});
|
|
|
|
sequelize.sync({ force: true }).then(() => {
|
|
console.log('Database synced successfully');
|
|
process.exit(0);
|
|
}).catch(err => {
|
|
console.error('Sync failed:', err);
|
|
process.exit(1);
|
|
});
|
|
envFrom:
|
|
- configMapRef:
|
|
name: vims-config
|
|
env:
|
|
- name: DB_PASSWORD
|
|
value: "postgres"
|
|
restartPolicy: Never
|
|
backoffLimit: 4
|