ci: add disable daily DB refresh flag
This commit is contained in:
parent
f7708c9411
commit
b3c0b30838
7
.github/workflows/build.yml
vendored
7
.github/workflows/build.yml
vendored
|
@ -17,6 +17,11 @@ on:
|
|||
default: true
|
||||
required: true
|
||||
type: boolean
|
||||
sandboxNoDbRefresh:
|
||||
description: 'Sandbox Disable Daily DB Refresh'
|
||||
default: false
|
||||
required: true
|
||||
type: boolean
|
||||
legacySandbox:
|
||||
description: 'Deploy to Legacy Sandbox'
|
||||
default: false
|
||||
|
@ -325,7 +330,7 @@ jobs:
|
|||
npm ci
|
||||
cd ../..
|
||||
echo "Start Deploy..."
|
||||
node ./dev/deploy-to-container/cli.js --branch ${{ github.ref_name }} --domain dev.ietf.org --appversion ${{ env.PKG_VERSION }} --commit ${{ github.sha }} --ghrunid ${{ github.run_id }}
|
||||
node ./dev/deploy-to-container/cli.js --branch ${{ github.ref_name }} --domain dev.ietf.org --appversion ${{ env.PKG_VERSION }} --commit ${{ github.sha }} --ghrunid ${{ github.run_id }} --nodbrefresh ${{ github.event.inputs.sandboxNoDbRefresh }}
|
||||
|
||||
- name: Cleanup old docker resources
|
||||
env:
|
||||
|
|
|
@ -175,6 +175,9 @@ async function main () {
|
|||
Image: 'ghcr.io/ietf-tools/datatracker-db:latest',
|
||||
name: `dt-db-${branch}`,
|
||||
Hostname: `dt-db-${branch}`,
|
||||
Labels: {
|
||||
...argv.nodbrefresh ?? { nodbrefresh: '1' }
|
||||
},
|
||||
HostConfig: {
|
||||
NetworkMode: 'shared',
|
||||
RestartPolicy: {
|
||||
|
@ -194,6 +197,9 @@ async function main () {
|
|||
Env: [
|
||||
`CELERY_PASSWORD=${mqKey}`
|
||||
],
|
||||
Labels: {
|
||||
...argv.nodbrefresh ?? { nodbrefresh: '1' }
|
||||
},
|
||||
HostConfig: {
|
||||
Memory: 4 * (1024 ** 3), // in bytes
|
||||
NetworkMode: 'shared',
|
||||
|
@ -222,6 +228,9 @@ async function main () {
|
|||
`CELERY_ROLE=${conConf.role}`,
|
||||
'UPDATE_REQUIREMENTS_FROM=requirements.txt'
|
||||
],
|
||||
Labels: {
|
||||
...argv.nodbrefresh ?? { nodbrefresh: '1' }
|
||||
},
|
||||
HostConfig: {
|
||||
Binds: [
|
||||
'dt-assets:/assets',
|
||||
|
@ -254,7 +263,8 @@ async function main () {
|
|||
appversion: `${argv.appversion}` ?? '0.0.0',
|
||||
commit: `${argv.commit}` ?? 'unknown',
|
||||
ghrunid: `${argv.ghrunid}` ?? '0',
|
||||
hostname
|
||||
hostname,
|
||||
...argv.nodbrefresh ?? { nodbrefresh: '1' }
|
||||
},
|
||||
HostConfig: {
|
||||
Binds: [
|
||||
|
|
|
@ -24,7 +24,8 @@ async function main () {
|
|||
const containersToRestart = []
|
||||
for (const container of containers) {
|
||||
if (
|
||||
container.Names.some(n => n.startsWith('/dt-db-'))
|
||||
container.Names.some(n => n.startsWith('/dt-db-')) &&
|
||||
container.Labels?.nodbrefresh !== '1'
|
||||
) {
|
||||
console.info(`Terminating DB container ${container.Id}...`)
|
||||
dbContainersToCreate.push(container.Names.find(n => n.startsWith('/dt-db-')).substring(1))
|
||||
|
@ -37,9 +38,11 @@ async function main () {
|
|||
v: true
|
||||
})
|
||||
} else if (
|
||||
container.Names.some(n => n.startsWith('/dt-app-')) ||
|
||||
container.Names.some(n => n.startsWith('/dt-celery-')) ||
|
||||
container.Names.some(n => n.startsWith('/dt-beat-'))
|
||||
(
|
||||
container.Names.some(n => n.startsWith('/dt-app-')) ||
|
||||
container.Names.some(n => n.startsWith('/dt-celery-')) ||
|
||||
container.Names.some(n => n.startsWith('/dt-beat-'))
|
||||
) && container.Labels?.nodbrefresh !== '1'
|
||||
) {
|
||||
if (container.State === 'running') {
|
||||
const appContainer = dock.getContainer(container.Id)
|
||||
|
|
Loading…
Reference in a new issue