From bfcca2fe79fb3a7c16bfeaf114bc5545a27d3df5 Mon Sep 17 00:00:00 2001 From: Thorsten Eckel Date: Fri, 26 Feb 2021 08:43:35 +0100 Subject: [PATCH] Follow up - a86b288f4c8ccb8180baca589854027a34f29f7f - Fixes #3411: Missing 'dotenv' gem in production causes rake tasks to fail. --- .github/workflows/build-docker-image.yaml | 2 +- lib/tasks/zammad/ci/refresh_envs.rake | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-docker-image.yaml b/.github/workflows/build-docker-image.yaml index 76ae36ead..d3b6f3a0f 100644 --- a/.github/workflows/build-docker-image.yaml +++ b/.github/workflows/build-docker-image.yaml @@ -2,7 +2,7 @@ name: build-docker-image on: push: - branches: [develop] + branches: [thorsteneckel-debug-docker-image-build] jobs: build-docker-image: diff --git a/lib/tasks/zammad/ci/refresh_envs.rake b/lib/tasks/zammad/ci/refresh_envs.rake index 10ce64d8d..a264b7a9d 100644 --- a/lib/tasks/zammad/ci/refresh_envs.rake +++ b/lib/tasks/zammad/ci/refresh_envs.rake @@ -1,5 +1,3 @@ -require 'dotenv' - namespace :zammad do namespace :ci do @@ -7,6 +5,10 @@ namespace :zammad do desc 'Re-fresh-es dynamic ENV variables' task refresh_envs: :environment do + # require only at runtime of process to avoid errors when loading + # rake tasks in production without this gem installed + require 'dotenv' + Dotenv.overload('fresh.env') result = ExternalCredential::Microsoft365.refresh_token(