underpost 2.8.481 → 2.8.482
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docker-compose.yml +1 -1
- package/manifests/mongodb/backup-cronjob.yaml +14 -12
- package/package.json +1 -1
- package/src/cli/image.js +2 -2
- package/src/index.js +1 -1
package/docker-compose.yml
CHANGED
|
@@ -16,25 +16,27 @@ spec:
|
|
|
16
16
|
- -c
|
|
17
17
|
- |
|
|
18
18
|
# Perform backup
|
|
19
|
-
mongodump
|
|
19
|
+
mongodump --host=mongodb-service --port=27017 --out=/backup/$(date +\%Y-\%m-\%dT\%H-\%M-\%S)
|
|
20
20
|
# Remove backups older than 7 days
|
|
21
21
|
find /backup -type d -mtime +7 -exec rm -rf {} +
|
|
22
22
|
volumeMounts:
|
|
23
23
|
- name: backup-storage
|
|
24
24
|
mountPath: /backup
|
|
25
|
-
env:
|
|
26
|
-
- name: MONGO_INITDB_ROOT_USERNAME
|
|
27
|
-
valueFrom:
|
|
28
|
-
secretKeyRef:
|
|
29
|
-
name: mongodb-secret
|
|
30
|
-
key: username
|
|
31
|
-
- name: MONGO_INITDB_ROOT_PASSWORD
|
|
32
|
-
valueFrom:
|
|
33
|
-
secretKeyRef:
|
|
34
|
-
name: mongodb-secret
|
|
35
|
-
key: password
|
|
36
25
|
restartPolicy: Never
|
|
37
26
|
volumes:
|
|
38
27
|
- name: backup-storage
|
|
39
28
|
persistentVolumeClaim:
|
|
40
29
|
claimName: backup-pvc
|
|
30
|
+
# mongodump -u $MONGO_INITDB_ROOT_USERNAME -p $MONGO_INITDB_ROOT_PASSWORD --host=mongodb-service --port=27017 --out=/backup/$(date +\%Y-\%m-\%dT\%H-\%M-\%S)
|
|
31
|
+
|
|
32
|
+
# env:
|
|
33
|
+
# - name: MONGO_INITDB_ROOT_USERNAME
|
|
34
|
+
# valueFrom:
|
|
35
|
+
# secretKeyRef:
|
|
36
|
+
# name: mongodb-secret
|
|
37
|
+
# key: username
|
|
38
|
+
# - name: MONGO_INITDB_ROOT_PASSWORD
|
|
39
|
+
# valueFrom:
|
|
40
|
+
# secretKeyRef:
|
|
41
|
+
# name: mongodb-secret
|
|
42
|
+
# key: password
|
package/package.json
CHANGED
package/src/cli/image.js
CHANGED
|
@@ -13,7 +13,7 @@ class UnderpostImage {
|
|
|
13
13
|
pullBaseImages() {
|
|
14
14
|
shellExec(`sudo podman pull docker.io/library/debian:buster`);
|
|
15
15
|
},
|
|
16
|
-
build(deployId = 'default', env = 'development', path = '.',
|
|
16
|
+
build(deployId = 'default', env = 'development', path = '.', options = { imageArchive: false }) {
|
|
17
17
|
const imgName = `${deployId}-${env}:${Underpost.version}`;
|
|
18
18
|
const podManImg = `localhost/${imgName}`;
|
|
19
19
|
const imagesStoragePath = `./images`;
|
|
@@ -30,7 +30,7 @@ class UnderpostImage {
|
|
|
30
30
|
secretDockerInput += ` --secret id=${key},env=${key} \ `;
|
|
31
31
|
}
|
|
32
32
|
// --rm --no-cache
|
|
33
|
-
if (imageArchive !== true) {
|
|
33
|
+
if (options.imageArchive !== true) {
|
|
34
34
|
fs.copyFile(`${getNpmRootPath()}/underpost/.env`, `${path}/.env.underpost`);
|
|
35
35
|
shellExec(
|
|
36
36
|
`cd ${path}${secrets}&& sudo podman build -f ./Dockerfile -t ${imgName} --pull=never --cap-add=CAP_AUDIT_WRITE${secretDockerInput}`,
|