Commit 0c04d32d authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Merge branch 'release-0.20.2' into 'master'

Release 0.20.2

See merge request redmic-project/client/web!88
parents 619c8a56 63ae90ec
Loading
Loading
Loading
Loading
+48 −54
Original line number Diff line number Diff line
@@ -8,52 +8,53 @@ include:
  - project: 'redmic-project/gitlab-ci-templates'
    ref: master
    file: '/deployment.yml'
  - project: 'redmic-project/gitlab-ci-templates'
    ref: master
    file: '/deployment-custom-image.yml'

stages:
  - pre-build
  - test-code
  - build
  - license-list
  - pre-package
  - package
  - test-package
  - post-package
  - deploy
  - test-deploy

variables:
  STACK: client
  WEB_BUILD_IMAGE_NAME: registry.gitlab.com/redmic-project/docker/web-build
  WEB_BUILD_IMAGE_TAG: latest
  PROJECT_PARENT_NAME: client

.web-build:
  image: ${WEB_BUILD_IMAGE_NAME}:${WEB_BUILD_IMAGE_TAG}
  variables:
    GIT_SUBMODULE_STRATEGY: normal
    WEB_BUILD_IMAGE_NAME: registry.gitlab.com/redmic-project/docker/web-build
    WEB_BUILD_IMAGE_TAG: latest
  before_script:
    - type yarn grunt java
    - yarn install
    - grunt preBuild
  cache:
    paths:
      - node_modules/
      - public/javascript/redmic-widgets/node_modules/
      - public/javascript/templates/node_modules/
      - public/stylesheets/node_modules/
    policy: pull

.prepare-dependencies:
  extends: .web-build
  variables:
    GIT_SUBMODULE_STRATEGY: normal
  before_script:
    - type yarn grunt java
    - yarn install || yarn install
.only-non-master-branches-job:
  rules: &only-non-master-branches-job-rules
    - if: $CI_MERGE_REQUEST_ID ||
          $CI_COMMIT_TAG ||
          $CI_PIPELINE_SOURCE == "schedule" ||
          $CI_COMMIT_BRANCH == "master"
      when: never
    - if: $CI_COMMIT_BRANCH

prepare-unbuilt-version:
  extends: .web-build
  stage: pre-build
  extends: .prepare-dependencies
  script:
    - grunt preBuild
  only:
    - branches
  except:
    - master
    - schedules
  cache:
    policy: pull-push
  script: ':'
  artifacts:
    name: ${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}
    expire_in: 1 week
@@ -65,77 +66,70 @@ prepare-unbuilt-version:
      - public/stylesheets/style.styl
      - public/stylesheets/src/
      - public/stylesheets/submodules/
  rules: *only-non-master-branches-job-rules

run-unit-tests:
  stage: test-code
  extends: .web-build
  stage: pre-build
  script:
    - grunt test | tee test.out
    - coverage=$(grep '^All files.*' test.out | cut -d '|' -f 2 | tr -d ' ')
    - echo "Coverage - ${coverage}%"
    - rm test.out
  only:
    - branches
  except:
    - master
    - schedules
  cache:
    policy: pull
  rules: *only-non-master-branches-job-rules

run-modules-functional-tests:
  stage: test-code
  extends: .web-build
  stage: pre-build
  script:
    - npm start &
    - grunt test-functional-local --functionalSuites=tests/functional/modules/**/!\(*Script\).js --headless
  only:
    - branches
  except:
    - master
    - schedules
  cache:
    policy: pull
  rules: *only-non-master-branches-job-rules

prepare-built-version:
  extends: .web-build
  stage: build
  extends: .prepare-dependencies
  script:
    - grunt
  only:
    - branches
  except:
    - schedules
  dependencies: []
  artifacts:
    name: ${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}
    expire_in: 1 month
    paths:
      - dist*.tar.gz
  rules:
    - if: $CI_MERGE_REQUEST_ID ||
          $CI_COMMIT_TAG ||
          $CI_PIPELINE_SOURCE == "schedule"
      when: never
    - if: $CI_COMMIT_BRANCH

.deploy:
  variables:
    STACK: ${PROJECT_PARENT_NAME}
    SERVICES_TO_CHECK: ${PROJECT_PARENT_NAME}_${CI_PROJECT_NAME}
  environment:
    url: https://${PUBLIC_HOSTNAME}

.deploy-development:
  variables:
    DD_PRODUCTION: 0

.deploy-production:
  variables:
    DD_PRODUCTION: 1

run-functional-tests:
  extends: .web-build
  stage: test-deploy
  extends: .prepare-dependencies
  script:
    - >
      grunt test-functional-local --serverUrl="https://${DEV_PUBLIC_HOSTNAME}" --user="${REDMIC_TEST_USER}"
      --pass="${REDMIC_TEST_PASS}" --role=administrator --suitesGroups="${SUITES_GROUPS}" --headless
  only:
    - schedules
  cache:
    paths:
      - node_modules/
  dependencies: []
  cache:
    policy: pull
  artifacts:
    name: ${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}
    expire_in: 1 month
    when: always
    paths:
      - 'test_reports/test-functional-local*'
  rules:
    - if: $CI_PIPELINE_SOURCE == "schedule"
+11 −2
Original line number Diff line number Diff line
FROM node:11-alpine
ARG NODE_IMAGE_TAG=11.15.0-alpine

FROM node:${NODE_IMAGE_TAG}

LABEL maintainer="info@redmic.es"

@@ -7,10 +9,17 @@ ARG DIRPATH=/redmic

EXPOSE ${PORT}

ENV PORT=${PORT}

WORKDIR ${DIRPATH}

ADD dist*.tar.gz ./

RUN npm install --production

CMD ["node", "app", "-b"]
HEALTHCHECK --interval=30s --timeout=15s --start-period=1m --retries=3 \
	CMD wget --spider -q http://localhost:${PORT} || exit 1

ENTRYPOINT ["/bin/sh"]

CMD ["-c", "node app -b -p ${PORT}"]
+1 −1
Original line number Diff line number Diff line
# REDMIC web client

| Metrics | Master | Develop |
| Metric | Master | Dev |
|:-:|:-:|:-:|
| CI status | [![pipeline status](https://gitlab.com/redmic-project/client/web/badges/master/pipeline.svg)](https://gitlab.com/redmic-project/client/web/commits/master) | [![pipeline status](https://gitlab.com/redmic-project/client/web/badges/dev/pipeline.svg)](https://gitlab.com/redmic-project/client/web/commits/dev) |
| Test coverage | [![coverage report](https://gitlab.com/redmic-project/client/web/badges/master/coverage.svg)](https://gitlab.com/redmic-project/client/web/commits/master) | [![coverage report](https://gitlab.com/redmic-project/client/web/badges/dev/coverage.svg)](https://gitlab.com/redmic-project/client/web/commits/dev) |
+5 −2
Original line number Diff line number Diff line
NODE_IMAGE_TAG=11.15.0-alpine
PORT=3050
DIRPATH=/redmic

OAUTH_URL=https://api.domain/oauth
OAUTH_CLIENT_SECRET=secret
API_URL=https://api.domain
PRODUCTION=0
PORT=3050
PUBLIC_HOSTNAME=change.me
+5 −0
Original line number Diff line number Diff line
version: '3.5'

services:
  web:
    environment:
      PRODUCTION: 0
Loading