Skip to content

Commit db3eadc

Browse files
committed
New github workflow
1 parent 0ebd713 commit db3eadc

File tree

9 files changed

+12
-9
lines changed

9 files changed

+12
-9
lines changed

.github/workflows/deploy.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
- master
66

77
env:
8-
IMAGE_NAME: "databack/mysql-backup"
8+
IMAGE_NAME: "utils/mysql-backup"
99

1010
jobs:
1111
report:
@@ -29,6 +29,7 @@ jobs:
2929
- name: Login to DockerHub
3030
uses: docker/login-action@v2
3131
with:
32+
registry: registry.f365.org
3233
username: ${{ secrets.DOCKER_USERNAME }}
3334
password: ${{ secrets.DOCKER_PASSWORD }}
3435
- name: Build and push

.github/workflows/release.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
- 'v*'
66

77
env:
8-
IMAGE_NAME: databack/mysql-backup
8+
IMAGE_NAME: utils/mysql-backup
99

1010
jobs:
1111
report:
@@ -41,6 +41,7 @@ jobs:
4141
- name: Login to DockerHub
4242
uses: docker/login-action@v2
4343
with:
44+
registry: registry.f365.org
4445
username: ${{ secrets.DOCKER_USERNAME }}
4546
password: ${{ secrets.DOCKER_PASSWORD }}
4647
- name: Docker meta

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
Back up mysql databases to... anywhere!
44

5+
56
## Overview
67

78
mysql-backup is a simple way to do MySQL database backups and restores, as well as manage your backups.

examples/configs/local.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ spec:
2929
compression: gzip # defaults to gzip
3030
compact: true # defaults to false
3131
maxAllowedPacket: 4194304 # defaults to 4194304
32-
filenamePattern: db_backup_{{ .now }}.{{ .compression }}
32+
filenamePattern: backup.{{ .compression }}
3333
scripts:
3434
preBackup: /path/to/prescripts/
3535
postBackup: /path/to/postscripts/

examples/configs/telemetry.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ spec:
4343
frequency: 1440 # in minutes
4444
begin: 25 # minutes from initialization
4545
compression: gzip # defaults to gzip
46-
filenamePattern: db_backup_{{ .now }}.{{ .compression }}
46+
filenamePattern: backup.{{ .compression }}
4747
scripts:
4848
preBackup: /path/to/prescripts/
4949
postBackup: /path/to/postscripts/

pkg/core/const.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
package core
22

33
const (
4-
DefaultFilenamePattern = "db_backup_{{ .now }}.{{ .compression }}"
4+
DefaultFilenamePattern = "backup.{{ .compression }}"
55
)

pkg/core/dump.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func (e *Executor) Dump(opts DumpOptions) (DumpResults, error) {
4343

4444
// sourceFilename: file that the uploader looks for when performing the upload
4545
// targetFilename: the remote file that is actually uploaded
46-
sourceFilename := fmt.Sprintf("db_backup_%s.%s", timepart, compressor.Extension())
46+
sourceFilename := fmt.Sprintf("backup.%s", compressor.Extension())
4747
targetFilename, err := ProcessFilenamePattern(filenamePattern, now, timepart, compressor.Extension())
4848
if err != nil {
4949
return results, fmt.Errorf("failed to process filename pattern: %v", err)

pkg/core/prune_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ func TestPrune(t *testing.T) {
6363
// and add 30 mins to our "now" time.
6464
relativeTime := now.Add(duration).Add(-30 * time.Minute)
6565
// convert that into the filename
66-
filename := fmt.Sprintf("db_backup_%sZ.gz", relativeTime.Format("2006-01-02T15:04:05"))
66+
filename := "backup.gz"
6767
filenames = append(filenames, filename)
68-
safefilename := fmt.Sprintf("db_backup_%sZ.gz", relativeTime.Format("2006-01-02T15-04-05"))
68+
safefilename := "backup.gz"
6969
safefilenames = append(safefilenames, safefilename)
7070
}
7171
tests := []struct {

scripts.d/post-backup/rename_backup.sh.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ fi
77
if [ -e ${DUMPFILE} ];
88
then
99
now=$(date +"%Y-%m-%d-%H_%M")
10-
new_name=db_backup-${now}.gz
10+
new_name=backup.gz
1111
old_name=$(basename ${DUMPFILE})
1212
echo "Renaming backup file from ${old_name} to ${new_name}"
1313
mv ${DUMPFILE} ${DESTDIR}/${new_name}

0 commit comments

Comments
 (0)