Explorar el Código

Merge branch 'feature/V8-7250-ci---trouver-un-moyen-dviter-de-' into develop

Olivier Massot hace 9 meses
padre
commit
fcf86f7290

+ 25 - 8
.gitlab-ci.yml

@@ -1,18 +1,35 @@
 stages:
-  - qa
+  - build
+  - analysis
+
+variables:
+  APP_ENV: ci
 
 cache:
   paths:
     - ./node_modules
     - .yarn
+    - yarn.lock
+
+build_image:
+  stage: build
+  image: docker:20.10
+  before_script:
+    - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
+  script:
+    - docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA .
+    - docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA $CI_REGISTRY_IMAGE:latest
+    - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
+    - docker push $CI_REGISTRY_IMAGE:latest
 
-before_script:
-  - corepack enable
-  - yarn set version 4.3.1
-  - yarn install --network-timeout 10000
-  - HOST=ci yarn prepare
+.default_config: &default_config
+  image: $CI_REGISTRY_IMAGE:latest
+  before_script:
+    - yarn install --network-timeout 10000
+    - HOSTNAME=ci yarn prepare
 
-qa:
-  stage: qa
+code_quality:
+  <<: *default_config
+  stage: analysis
   script:
     - yarn lint

+ 11 - 0
Dockerfile

@@ -0,0 +1,11 @@
+FROM node:20-slim
+
+ENV WORKDIR /home/workspace
+
+RUN corepack enable; \
+    yarn set version 4.3.1;
+
+# Define working directory.
+WORKDIR ${WORKDIR}
+
+CMD node

+ 8 - 11
README.md

@@ -1,7 +1,6 @@
+[![pipeline status](http://gitlab.2iopenservice.com/opentalent/site_logiciels/badges/master/pipeline.svg)](http://gitlab.2iopenservice.com/opentalent/site_logiciels/-/commits/master)
 
-[![pipeline status](http://gitlab.2iopenservice.com/opentalent/site_logiciels/badges/master/pipeline.svg)](http://gitlab.2iopenservice.com/opentalent/site_logiciels/-/commits/master) 
-
-[![Latest Release](http://gitlab.2iopenservice.com/opentalent/site_logiciels/-/badges/release.svg)](http://gitlab.2iopenservice.com/opentalent/site_logiciels/-/releases) 
+[![Latest Release](http://gitlab.2iopenservice.com/opentalent/site_logiciels/-/badges/release.svg)](http://gitlab.2iopenservice.com/opentalent/site_logiciels/-/releases)
 
 # Site Logiciels
 
@@ -15,7 +14,6 @@ Développé en nuxt3.
 > @see [vuetifyjs.com](https://cdn.vuetifyjs.com/docs/images/logos/vuetify-logo-v3-slim-text-light.svg) : Composants graphiques préconstruits  
 > @see [typescriptlang.org](https://www.typescriptlang.org/) : Typescript
 
-
 ### Installer
 
     yarn install
@@ -35,24 +33,23 @@ Développé en nuxt3.
     nvm exec yarn build
     sudo supervisorctl restart site_logiciels:site_logiciels_00
 
-Ou utiliser la commande custom : 
+Ou utiliser la commande custom :
 
     cd /var/opentalent/git/site_logiciels
     nvm exec yarn deploy
 
-### Déboguage en prod 
+### Déboguage en prod
 
-Pour déboguer en prod : 
+Pour déboguer en prod :
 
     sudo supervisorctl tail -6000 site_logiciels:site_logiciels_00 stderr
 
+### Tester la qualité du code
 
-### Tester la qualité du code 
-
-Pour tester : 
+Pour tester :
 
     yarn lint
 
-Pour tester et corriger automatiquement les erreurs qui peuvent l'être : 
+Pour tester et corriger automatiquement les erreurs qui peuvent l'être :
 
     yarn lint --fix

+ 8 - 2
assets/style/main.scss

@@ -1,5 +1,5 @@
 body {
-  font-family: "Barlow", serif;
+  font-family: 'Barlow', serif;
   font-style: normal;
   text-align: justify;
   --banner-center-image: 20%;
@@ -33,7 +33,13 @@ body {
   margin: -12px auto;
 }
 
-h1, h2, h3, h4, h5, li, .v-btn {
+h1,
+h2,
+h3,
+h4,
+h5,
+li,
+.v-btn {
   text-align: start;
 }
 

+ 3 - 4
assets/style/theme.scss

@@ -1,4 +1,3 @@
-
 body {
   --neutral-color: #ffffff;
   --primary-color-alt: #fef3ce;
@@ -22,9 +21,9 @@ body {
   --alt-theme: #0e2d32;
   --on-alt-theme: #ffffff;
 
-  --artist-color: #FAC20A;
+  --artist-color: #fac20a;
   --school-color: #2093be;
-  --manager-color: #D8050B;
+  --manager-color: #d8050b;
 
   --action-menu-primary-color: #0e2d32;
   --action-menu-on-primary-color: #ffffff;
@@ -38,7 +37,7 @@ body {
   --school-color-light: #a5d4e5;
   --manager-color-light: #f7cdce;
 
-  --warning-color: #D8050B;
+  --warning-color: #d8050b;
 }
 
 body {

+ 1 - 1
components/Partnerships/Contact.vue

@@ -46,7 +46,7 @@ import AnchoredSection from '~/components/Layout/AnchoredSection.vue'
   .col {
     padding: 0 6px;
     display: flex;
-    flex-direction:column;
+    flex-direction: column;
     align-self: center;
   }
 

+ 12 - 16
components/Partnerships/Partners.vue

@@ -57,36 +57,32 @@ const articles: Ref<Array<Article>> = ref([
 .benefits-block {
   display: flex;
   align-self: center;
-  :deep(.txt_article){
-    padding-top:80px;
-    padding-bottom:80px;
-    padding-left:80px;
-    padding-right:80px;
+  :deep(.txt_article) {
+    padding-top: 80px;
+    padding-bottom: 80px;
+    padding-left: 80px;
+    padding-right: 80px;
   }
 }
 
-.benefits-block:nth-child(odd)
-{
-  :deep(.txt_article){
+.benefits-block:nth-child(odd) {
+  :deep(.txt_article) {
     background: var(--neutral-color-alt-light);
-    padding-left:80px;
-    padding-right:80px;
+    padding-left: 80px;
+    padding-right: 80px;
   }
 }
 
-
 @media (max-width: 960px) {
   .benefits-block {
     padding-top: 40px;
     padding-bottom: 40px;
   }
 
-  .benefits-block:nth-child(odd)
-  {
-    :deep(.txt_article){
-      padding:30px;
+  .benefits-block:nth-child(odd) {
+    :deep(.txt_article) {
+      padding: 30px;
     }
   }
 }
-
 </style>

+ 24 - 30
env/setupEnv.mjs

@@ -7,34 +7,33 @@
  *     HOST=ci node ./env/setupEnv.mjs
  *
  */
-import os from "os";
-import fs from "fs";
-import {fileURLToPath} from "node:url";
-import path from 'path';
-
+import os from 'os'
+import fs from 'fs'
+import { fileURLToPath } from 'node:url'
+import path from 'path'
 
 const projectDir = path.join(path.dirname(fileURLToPath(import.meta.url)), '..')
 
-const hostname = process.env.HOST ?? os.hostname()
+const hostname = process.env.HOSTNAME || os.hostname()
 
 const environments = {
-  'site_logiciels': '.env.docker',
+  site_logiciels: '.env.docker',
   'prod-v2': '.env.prod',
   'test-v2': '.env.test',
-  'test1': '.env.test1',
-  'test2': '.env.test2',
-  'test3': '.env.test3',
-  'test4': '.env.test4',
-  'test5': '.env.test5',
-  'test6': '.env.test6',
-  'test7': '.env.test7',
-  'test8': '.env.test8',
-  'test9': '.env.test9',
-  'ci': '.env.ci',
+  test1: '.env.test1',
+  test2: '.env.test2',
+  test3: '.env.test3',
+  test4: '.env.test4',
+  test5: '.env.test5',
+  test6: '.env.test6',
+  test7: '.env.test7',
+  test8: '.env.test8',
+  test9: '.env.test9',
+  ci: '.env.ci',
 }
 
 if (!environments.hasOwnProperty(hostname)) {
-  throw Error("Critical : unknown environment [" + hostname + "]")
+  throw new Error('Critical : unknown environment [' + hostname + ']')
 }
 
 const targetEnvFile = path.join(projectDir, 'env', environments[hostname])
@@ -45,17 +44,12 @@ fs.unlink(mainEnvFile, (err) => {
   if (err && err.code !== 'ENOENT') {
     throw err
   }
-  console.log(`${mainEnvFile} was deleted`);
-});
+  console.log(`${mainEnvFile} was deleted`)
+})
 
-fs.symlink(
-  targetEnvFile,
-  '.env',
-  'file',
-  (err) => {
-    if (err) {
-      throw (err);
-    }
-    console.log(`Symlink created : ${mainEnvFile} -> ${targetEnvFile}`)
+fs.symlink(targetEnvFile, '.env', 'file', (err) => {
+  if (err) {
+    throw err
   }
-)
+  console.log(`Symlink created : ${mainEnvFile} -> ${targetEnvFile}`)
+})

+ 3 - 1
package.json

@@ -16,7 +16,9 @@
     "prepare": "yarn setupenv && nuxt prepare",
     "start": "nuxt start",
     "deploy": "git pull && yarn install && yarn generate && yarn build && sudo supervisorctl restart site_logiciels:site_logiciels_00",
-    "lint": "eslint --ext \".ts,.js,.vue\" --ignore-path .gitignore ."
+    "lint": "eslint --ext \".ts,.js,.vue\" --ignore-path .gitignore .",
+    "prettier-check": "yarn prettier . --check",
+    "prettier-fix": "yarn prettier . --write"
   },
   "dependencies": {
     "@fortawesome/fontawesome-free": "^6.5.1",

+ 1 - 5
tsconfig.json

@@ -6,11 +6,7 @@
     "esModuleInterop": true,
     "sourceMap": true,
     "experimentalDecorators": true,
-    "types": [
-      "@nuxtjs/date-fns",
-      "@nuxt/types",
-      "@nuxtjs/i18n"
-    ],
+    "types": ["@nuxtjs/date-fns", "@nuxt/types", "@nuxtjs/i18n"],
     "exclude": ["node_modules", ".nuxt"],
     "typeRoots": ["./types"]
   }

+ 3 - 4
types/data.d.ts

@@ -1,10 +1,10 @@
-import ApiResource from "~/models/ApiResource";
-import type {EnumChoice} from "~/types/interfaces";
+import ApiResource from '~/models/ApiResource'
+import type { EnumChoice } from '~/types/interfaces'
 
 type AnyJson = Record<string, any>
 
 interface AssociativeArray {
-  [key: string]: any;
+  [key: string]: any
 }
 
 interface Connector {
@@ -36,7 +36,6 @@ interface ApiCollection extends ApiResponse {
   metadata: HydraMetadata
 }
 
-
 interface Pagination {
   first?: number
   last?: number

+ 14 - 14
types/interface.d.ts

@@ -1,4 +1,4 @@
-import { ActionMenuItemType } from "~/types/enum/layout";
+import { ActionMenuItemType } from '~/types/enum/layout'
 import { COOKIE_CONSENT_CHOICE } from '~/types/enum/enums'
 
 interface ActionMenuItem {
@@ -6,7 +6,7 @@ interface ActionMenuItem {
   color: 'primary' | 'secondary'
   icon: string
   text: string
-  url?: string | object,
+  url?: string | object
   target?: string
 }
 
@@ -44,19 +44,19 @@ interface SolutionItem {
 }
 
 interface Review {
-  name: string,
-  review: string,
-  status: string,
-  structure: string,
+  name: string
+  review: string
+  status: string
+  structure: string
 }
 
 interface MenuScroll {
-  label: string,
+  label: string
   anchor: string
 }
 
 interface FeaturePicto {
-  src: string,
+  src: string
   text: string
 }
 
@@ -167,11 +167,11 @@ interface ContactFormData {
 }
 
 interface CookiesPreferences {
-  consent: COOKIE_CONSENT_CHOICE,
-  analyticsConsent: boolean,
-  advertisingConsent: boolean,
-  adUserDataConsent: boolean,
-  adPersonalizationConsent: boolean,
+  consent: COOKIE_CONSENT_CHOICE
+  analyticsConsent: boolean
+  advertisingConsent: boolean
+  adUserDataConsent: boolean
+  adPersonalizationConsent: boolean
 }
 
 interface Article {
@@ -181,4 +181,4 @@ interface Article {
   imageAlt: string
   btnTitle?: string
   btnHref?: string
-}
+}