From 6482f313487a1e92618517e3dd8026b830a87eea Mon Sep 17 00:00:00 2001 From: Sebastian Stehle Date: Sun, 6 Aug 2017 20:48:41 +0200 Subject: [PATCH] Auto cleanup on failure. --- .drone.yml | 13 +++++++++++-- src/Squidex.Infrastructure/TypeNameRegistry.cs | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index 19921cd60..b59b6e9c4 100644 --- a/.drone.yml +++ b/.drone.yml @@ -40,10 +40,19 @@ pipeline: slack: image: plugins/slack - secrets: [ slack_webhook ] template: > {{#success build.status}} build {{build.number}} succeeded. Good job. {{else}} build {{build.number}} failed. Fix me please. - {{/success}} \ No newline at end of file + {{/success}} + secrets: [ slack_webhook ] + when: + status: [ failure, success ] + + cleanup: + commands: + - docker system prune -f + when: + status: failure + \ No newline at end of file diff --git a/src/Squidex.Infrastructure/TypeNameRegistry.cs b/src/Squidex.Infrastructure/TypeNameRegistry.cs index 77d4b5edf..b08259a04 100644 --- a/src/Squidex.Infrastructure/TypeNameRegistry.cs +++ b/src/Squidex.Infrastructure/TypeNameRegistry.cs @@ -78,7 +78,7 @@ namespace Squidex.Infrastructure { var typeNameAttribute = type.GetTypeInfo().GetCustomAttribute(); - if (typeNameAttribute != null && !string.IsNullOrWhiteSpace(typeNameAttribute.TypeName)) + if (!string.IsNullOrWhiteSpace(typeNameAttribute?.TypeName)) { Map(type, typeNameAttribute.TypeName); }