Browse Source

Follow up - a86b288f4c8ccb8180baca589854027a34f29f7f - Fixes #3411: Missing 'dotenv' gem in production causes rake tasks to fail.

Thorsten Eckel 4 years ago
parent
commit
bfcca2fe79

+ 1 - 1
.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:

+ 4 - 2
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(