Commit 8d2339e1 authored by CarlosGC1989's avatar CarlosGC1989
Browse files

Merge branch 'dev' of gitlab.com:redmic-project/client/web into dev

parents 9e6d9812 6bf15276
Loading
Loading
Loading
Loading
+97 −48
Original line number Diff line number Diff line
image: redmic/web-gitlab

stages:
  - pre-build
  - test-code
  - build
  - test
  - package
  - test-package
  - deploy
  - test-deploy

prepare-for-unbuilt:
  stage: build
prepare-unbuilt-version:
  stage: pre-build
  variables:
    GIT_SUBMODULE_STRATEGY: normal
  script:
@@ -18,7 +20,6 @@ prepare-for-unbuilt:
  only:
    - branches
  except:
    - pre
    - master
  cache:
    key: '${CI_COMMIT_REF_NAME}'
@@ -39,38 +40,12 @@ prepare-for-unbuilt:
      - public/stylesheets/src/
      - public/stylesheets/submodules/

prepare-for-built:
  stage: build
  variables:
    GIT_SUBMODULE_STRATEGY: normal
  script:
    - 'type yarn grunt java'
    - 'yarn install || yarn install'
    - 'grunt'
  only:
    - pre
    - master
  cache:
    key: '${CI_COMMIT_REF_NAME}'
    paths:
      - node_modules/
      - public/javascript/redmic-widgets/node_modules/
      - public/javascript/templates/node_modules/
      - public/stylesheets/node_modules/
    policy: pull
  artifacts:
    name: '${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}'
    expire_in: '1 week'
    paths:
      - dist*.tar.gz

run-local-unit-tests:
  stage: test
run-unit-tests:
  stage: test-code
  script: 'grunt test-unit-local'
  only:
    - branches
  except:
    - pre
    - master
  cache:
    key: '${CI_COMMIT_REF_NAME}'
@@ -81,8 +56,8 @@ run-local-unit-tests:
      - public/stylesheets/node_modules/
    policy: pull

run-local-modules-functional-tests:
  stage: test
run-modules-functional-tests:
  stage: test-code
  script:
    - 'echo $(head -1 /etc/hosts | cut -f1) redmic.local >> /etc/hosts'
    - 'npm start -- -p 80 &'
@@ -90,7 +65,6 @@ run-local-modules-functional-tests:
  only:
    - branches
  except:
    - pre
    - master
  cache:
    key: '${CI_COMMIT_REF_NAME}'
@@ -101,14 +75,19 @@ run-local-modules-functional-tests:
      - public/stylesheets/node_modules/
    policy: pull

run-local-functional-tests:
  stage: test
prepare-built-version:
  stage: build
  variables:
    GIT_SUBMODULE_STRATEGY: normal
  script:
    - 'echo $(head -1 /etc/hosts | cut -f1) redmic.local >> /etc/hosts'
    - 'npm start -- -p 80 &'
    - 'grunt test-functional-local-parallel --user=${REDMIC_USER} --pass=${REDMIC_PASS}'
    - 'type yarn grunt java'
    - 'yarn install || yarn install'
    - 'grunt'
  only:
    - schedules
    - branches
    - tags
  except:
    - master
  cache:
    key: '${CI_COMMIT_REF_NAME}'
    paths:
@@ -117,6 +96,11 @@ run-local-functional-tests:
      - public/javascript/templates/node_modules/
      - public/stylesheets/node_modules/
    policy: pull
  artifacts:
    name: '${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}'
    expire_in: '1 week'
    paths:
      - dist*.tar.gz

docker-build-commit:
  stage: package
@@ -126,7 +110,9 @@ docker-build-commit:
  services:
    - docker:dind
  only:
    - pre
    - branches
  except:
    - master
  script:
    - docker login -u gitlab-ci-token -p ${CI_JOB_TOKEN} ${CI_REGISTRY}
    - docker build -t ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHA} -t ${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME}-latest .
@@ -155,7 +141,10 @@ container_scanning:
  services:
    - docker:stable-dind
  only:
    - pre
    - branches
    - tags
  except:
    - master
  script:
    - docker run -d --name db arminc/clair-db:latest
    - docker run -p 6060:6060 --link db:postgres -d --name clair arminc/clair-local-scan:v2.0.1
@@ -177,26 +166,86 @@ deploy-dev:
    DOCKER_DRIVER: overlay2
    SSH_REMOTE: ${DEV_SSH_REMOTE}
    SERVICE: ${CI_PROJECT_NAME}
    IMAGE_NAME: ${DOCKER_ENV_CI_REGISTRY_IMAGE}
    IMAGE_NAME: ${CI_REGISTRY_IMAGE}
    IMAGE_TAG: ${CI_COMMIT_SHA}
    COMPOSE_FILE: docker-compose.tmpl.yml:docker-compose.dev.yml
    OAUTH_CLIENT_SECRET: ${DEV_OAUTH_CLIENT_SECRET}
  services:
    - docker:dind
  script:
    - deploy.sh IMAGE_NAME=${IMAGE_NAME} IMAGE_TAG=${IMAGE_TAG} COMPOSE_FILE=${COMPOSE_FILE}
    - >
      deploy.sh IMAGE_NAME=${IMAGE_NAME} IMAGE_TAG=${IMAGE_TAG} COMPOSE_FILE=${COMPOSE_FILE}
      OAUTH_CLIENT_SECRET=${OAUTH_CLIENT_SECRET}
  environment:
    name: dev
    url: https://appdev.${DEV_PUBLIC_HOSTNAME}
  only:
    - pre
    - dev

deploy-supporting-branch:
  stage: deploy
  image: redmic/docker-gitlab
  variables:
    DOCKER_DRIVER: overlay2
    SSH_REMOTE: ${DEV_SSH_REMOTE}
    SERVICE: ${CI_PROJECT_NAME}
    IMAGE_NAME: ${CI_REGISTRY_IMAGE}
    IMAGE_TAG: ${CI_COMMIT_SHA}
    COMPOSE_FILE: docker-compose.tmpl.yml:docker-compose.dev.yml
    OAUTH_CLIENT_SECRET: ${DEV_OAUTH_CLIENT_SECRET}
  services:
    - docker:dind
  script:
    - >
      deploy.sh IMAGE_NAME=${IMAGE_NAME} IMAGE_TAG=${IMAGE_TAG} COMPOSE_FILE=${COMPOSE_FILE}
      OAUTH_CLIENT_SECRET=${OAUTH_CLIENT_SECRET}
  environment:
    name: dev
    url: https://appdev.${DEV_PUBLIC_HOSTNAME}
  only:
    - branches
  except:
    - master
    - dev
  when: manual

run-functional-tests:
  stage: test-deploy
  script:
    - 'echo $(head -1 /etc/hosts | cut -f1) redmic.local >> /etc/hosts'
    - 'npm start -- -p 80 &'
    - 'grunt test-functional-local-parallel --user=${REDMIC_USER} --pass=${REDMIC_PASS}'
  only:
    - schedules
  cache:
    key: '${CI_COMMIT_REF_NAME}'
    paths:
      - node_modules/
      - public/javascript/redmic-widgets/node_modules/
      - public/javascript/templates/node_modules/
      - public/stylesheets/node_modules/
    policy: pull

deploy-pro:
  stage: deploy
  image: redmic/docker-gitlab
  variables:
    DOCKER_DRIVER: overlay2
    SSH_REMOTE: ${PRO_SSH_REMOTE}
    SERVICE: ${CI_PROJECT_NAME}
    IMAGE_NAME: ${CI_REGISTRY_IMAGE}
    IMAGE_TAG: ${CI_COMMIT_TAG}
    COMPOSE_FILE: docker-compose.tmpl.yml:docker-compose.prod.yml
    OAUTH_CLIENT_SECRET: ${PRO_OAUTH_CLIENT_SECRET}
  services:
    - docker:dind
  script:
    - 'echo deploy-pro'
    - >
      deploy.sh IMAGE_NAME=${IMAGE_NAME} IMAGE_TAG=${IMAGE_TAG} COMPOSE_FILE=${COMPOSE_FILE}
      OAUTH_CLIENT_SECRET=${OAUTH_CLIENT_SECRET}
  environment:
    name: pro
    url: https://redmic.es
    url: https://${PRO_PUBLIC_HOSTNAME}
  only:
    - tags
  when: manual
+2 −0
Original line number Diff line number Diff line
@@ -5,6 +5,8 @@ services:
    image: ${IMAGE_NAME}:${IMAGE_TAG:-latest}
    networks:
      - redmic-net
    environment:
      - OAUTH_CLIENT_SECRET
    healthcheck:
      test: wget --spider -S -t 3 http://localhost:${WEB_PORT}
      interval: 30s
+0 −4
Original line number Diff line number Diff line
@@ -2636,10 +2636,6 @@ pathval@^1.0.0:
  version "1.1.0"
  resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.0.tgz#b942e6d4bde653005ef6b71361def8727d0645e0"

"pdfjs@https://github.com/mozilla/pdf.js.git#gh-pages":
  version "0.0.0"
  resolved "https://github.com/mozilla/pdf.js.git#2a05f4e38de06521de2e34438ebaf3e3ce79c036"

pend@~1.2.0:
  version "1.2.0"
  resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50"