Olivier Massot пре 2 година
родитељ
комит
a0db643657
4 измењених фајлова са 45 додато и 5 уклоњено
  1. 3 3
      .gitlab-ci.yml
  2. 34 0
      env/.env.ci
  3. 1 1
      env/.env.test1
  4. 7 1
      env/setupEnv.mjs

+ 3 - 3
.gitlab-ci.yml

@@ -5,8 +5,8 @@ variables:
   APP_ENV: ci
 
 before_script:
-  - echo "" > ./local.app.opentalent.fr.crt
-  - echo "" > ./local.app.opentalent.fr.key
+  - echo "" > ./env/local.app.opentalent.fr.crt
+  - echo "" > ./env/local.app.opentalent.fr.key
 
 cache:
   paths:
@@ -16,7 +16,7 @@ unit:
   stage: test
 
   script:
-    - yarn install
+    - HOST=ci yarn install
     - yarn test
 
   artifacts:

+ 34 - 0
env/.env.ci

@@ -0,0 +1,34 @@
+## LOCAL ENVIRONMENT FILE
+DEBUG=1
+
+HOST=0
+PORT=3000
+
+# Current env
+NUXT_ENV=dev
+NUXT_PUBLIC_ENV=dev
+
+## API Base Url
+NUXT_BASE_URL=
+NUXT_PUBLIC_BASE_URL=
+
+# Legacy API Base Url
+NUXT_BASE_URL_LEGACY=
+NUXT_PUBLIC_BASE_URL_LEGACY=
+
+# Legacy Admin Base Url
+NUXT_BASE_URL_ADMIN_LEGACY=
+NUXT_PUBLIC_BASE_URL_ADMIN_LEGACY=
+
+# Typo3 Base Url
+NUXT_BASE_URL_TYPO3=
+NUXT_PUBLIC_BASE_URL_TYPO3=
+
+# Mercure push events
+NUXT_BASE_URL_MERCURE=
+NUXT_PUBLIC_BASE_URL_MERCURE=
+MERCURE_SUBSCRIBER_JWT_KEY=
+
+# Other links
+NUXT_SUPPORT_URL=
+NUXT_PUBLIC_SUPPORT_URL=

+ 1 - 1
env/.env.test1

@@ -1,4 +1,4 @@
-.env.test## TEST ENVIRONMENT FILE
+## TEST ENVIRONMENT FILE
 
 DEBUG=1
 

+ 7 - 1
env/setupEnv.mjs

@@ -1,6 +1,11 @@
 /**
  * Post install script: create or replace the symlink .env
  * to the .env file matching the current environment
+ *
+ * To force an hostname, define an env variable named HOST :
+ *
+ *     HOST=ci node ./env/setupEnv.mjs
+ *
  */
 import os from "os";
 import fs from "fs";
@@ -10,7 +15,7 @@ import path from 'path';
 
 const projectDir = path.join(path.dirname(fileURLToPath(import.meta.url)), '..')
 
-const hostname = os.hostname()
+const hostname = process.env.HOST ?? os.hostname()
 
 const environments = {
     'app': '.env.docker',
@@ -21,6 +26,7 @@ const environments = {
     'test3': '.env.test3',
     'test4': '.env.test4',
     'test5': '.env.test5',
+    'ci': '.env.ci',
 }
 
 if (!environments.hasOwnProperty(hostname)) {