Browse Source

Add PLEROMA_BUILD_ENV to override env for the version generator and use it in the CI for building docs

This is needed because if we run with MIX_ENV=dev we will get a "+dev"
suffix to the version in the docs, but if we run with MIX_ENV=prod the
docs build will fail because ex_doc is dev-only dependency.
underscore-world
rinpatch 2 months ago
parent
commit
bdc1592377
2 changed files with 10 additions and 0 deletions
  1. 1
    0
      .gitlab-ci.yml
  2. 9
    0
      mix.exs

+ 1
- 0
.gitlab-ci.yml View File

@@ -35,6 +35,7 @@ docs-build:
35 35
   - develop@pleroma/pleroma
36 36
   variables:
37 37
     MIX_ENV: dev
38
+    PLEROMA_BUILD_ENV: prod
38 39
   script:
39 40
     - mix deps.get
40 41
     - mix compile

+ 9
- 0
mix.exs View File

@@ -207,6 +207,15 @@ defmodule Pleroma.Mixfile do
207 207
 
208 208
     env_name = if Mix.env() != :prod, do: to_string(Mix.env())
209 209
 
210
+    env_override = System.get_env("PLEROMA_BUILD_ENV")
211
+
212
+    env_name =
213
+      if env_override do
214
+        if env_override != "prod", do: env_override
215
+      else
216
+        env_name
217
+      end
218
+
210 219
     build =
211 220
       [build_name, env_name]
212 221
       |> Enum.filter(fn string -> string && string != "" end)

Loading…
Cancel
Save