add notify to dron
This commit is contained in:
+9
-1
@@ -11,9 +11,17 @@ pipeline:
|
||||
- cd app
|
||||
- go get -v ./...
|
||||
- go test -v ./...
|
||||
|
||||
|
||||
docker:
|
||||
image: plugins/docker
|
||||
repo: umputun/remark
|
||||
secrets: [ docker_username, docker_password ]
|
||||
tags: ${DRONE_REPO_BRANCH}
|
||||
|
||||
notify:
|
||||
image: drillster/drone-email
|
||||
host: homemail.umputun.com
|
||||
from: drone@yhomemail.umputun.com
|
||||
recipients: [ umputun@gmail.com ]
|
||||
when:
|
||||
status: [ changed, failure ]
|
||||
|
||||
@@ -17,8 +17,6 @@ RUN go build -o remark -ldflags "-X main.revision=$(git rev-parse --abbrev-ref H
|
||||
|
||||
FROM umputun/baseimage:micro-latest
|
||||
|
||||
RUN apk add --update ca-certificates && update-ca-certificates
|
||||
|
||||
COPY --from=build /go/src/github.com/umputun/remark/remark /srv/
|
||||
COPY --from=build /go/src/github.com/umputun/remark/web /srv/web
|
||||
RUN chown -R umputun:umputun /srv
|
||||
|
||||
@@ -21,14 +21,19 @@ func TestMigrator_RemoveOldBackupFiles(t *testing.T) {
|
||||
err := ioutil.WriteFile(fname, []byte("blah"), 0600)
|
||||
assert.Nil(t, err)
|
||||
}
|
||||
fname := fmt.Sprintf("%s/backup-site2-20171210.gz", loc)
|
||||
err := ioutil.WriteFile(fname, []byte("blah"), 0600)
|
||||
assert.Nil(t, err)
|
||||
|
||||
bk := AutoBackup{BackupLocation: loc, SiteID: "site1", KeepMax: 3}
|
||||
bk.removeOldBackupFiles()
|
||||
ff, err := ioutil.ReadDir(loc)
|
||||
assert.Nil(t, err)
|
||||
assert.Equal(t, 3, len(ff), "should keep 3 files only")
|
||||
assert.Equal(t, 4, len(ff), "should keep 4 files - 3 kept for sit1, and one for site2")
|
||||
assert.Equal(t, "backup-site1-20171208.gz", ff[0].Name())
|
||||
assert.Equal(t, "backup-site1-20171209.gz", ff[1].Name())
|
||||
assert.Equal(t, "backup-site1-20171210.gz", ff[2].Name())
|
||||
assert.Equal(t, "backup-site2-20171210.gz", ff[3].Name())
|
||||
}
|
||||
|
||||
func TestMigrator_MakeBackup(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user