Loading .gitignore +2 −0 Original line number Diff line number Diff line Loading @@ -2,4 +2,6 @@ node_modules dist test_reports .gitmodules.old build-report.txt *.tar.gz *.log .gitlab-ci.build.yml +5 −4 Original line number Diff line number Diff line Loading @@ -7,25 +7,25 @@ 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/ prepare-unbuilt-version: extends: .web-build stage: pre-build script: ':' script: - grunt preBuild tags: - custom-runner artifacts: name: ${CI_JOB_NAME}_${CI_COMMIT_REF_NAME} expire_in: 1 week paths: - node_modules/ - public/javascript/proj4js/dist/proj4.js - public/javascript/redmic-widgets/src/app/ - public/javascript/templates/dist/ - public/stylesheets/style.styl - public/stylesheets/src/ Loading @@ -49,6 +49,7 @@ prepare-built-version: expire_in: 1 month paths: - dist*.tar.gz - build-report.txt rules: - if: $CI_MERGE_REQUEST_ID || $CI_PIPELINE_SOURCE == "schedule" Loading .gitlab-ci.test.yml +56 −19 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ .run-pre-build-tests: extends: .run-tests stage: pre-build needs: ["prepare-unbuilt-version"] rules: - if: $CI_MERGE_REQUEST_ID || $CI_COMMIT_TAG || Loading @@ -27,6 +28,7 @@ .run-unit-tests: extends: .run-pre-build-tests coverage: '/^Coverage\s-\s(\d+(?:\.\d+)?%)/' after_script: - coverage=$(grep '^All files.*' test.out | cut -d '|' -f 2 | tr -d ' ') - echo "Coverage - ${coverage}%" Loading @@ -38,8 +40,12 @@ run-local-unit-tests: <<: *run-local-tests-variables script: - > grunt test-unit-local --headless --browser=${TEST_BROWSER} --seleniumVersion=${LOCAL_SELENIUM_VERSION} --chromeVersion=${LOCAL_CHROME_VERSION} | tee test.out grunt test-unit-local --headless --browser=${TEST_BROWSER} --seleniumVersion=${LOCAL_SELENIUM_VERSION} --chromeVersion=${LOCAL_CHROME_VERSION} | tee test.out .run-remote-unit-tests: extends: .run-unit-tests Loading @@ -47,9 +53,15 @@ run-local-unit-tests: <<: *run-remote-tests-variables script: - > grunt test-unit-remote --headless --browser=${TEST_BROWSER} --ownServerHost="${TEST_OWN_SERVER_HOST}" --remoteHost=${TEST_REMOTE_HOST} --seleniumVersion=${REMOTE_SELENIUM_VERSION} --chromeVersion=${REMOTE_CHROME_VERSION} --firefoxVersion=${REMOTE_FIREFOX_VERSION} | tee test.out grunt test-unit-remote --headless --browser=${TEST_BROWSER} --ownServerHost="${TEST_OWN_SERVER_HOST}" --remoteHost=${TEST_REMOTE_HOST} --seleniumVersion=${REMOTE_SELENIUM_VERSION} --chromeVersion=${REMOTE_CHROME_VERSION} --firefoxVersion=${REMOTE_FIREFOX_VERSION} | tee test.out run-remote-unit-tests-chrome: extends: .run-remote-unit-tests Loading @@ -67,7 +79,7 @@ run-remote-unit-tests-firefox: expire_in: 1 month when: always paths: - 'test_reports/test-functional*' - test_reports/test-functional* run-local-modules-functional-tests: extends: .run-pre-build-tests Loading @@ -77,9 +89,13 @@ run-local-modules-functional-tests: - grunt buildStyles - npm start & - > grunt test-functional-local --functionalSuites=tests/functional/modules/**/!\(*Script\).js --headless --browser=${TEST_BROWSER} --seleniumVersion=${LOCAL_SELENIUM_VERSION} --chromeVersion=${LOCAL_CHROME_VERSION} artifacts: &run-functional-tests-artifacts grunt test-functional-local --functionalSuites=tests/functional/modules/**/!\(*Script\).js --headless --browser=${TEST_BROWSER} --seleniumVersion=${LOCAL_SELENIUM_VERSION} --chromeVersion=${LOCAL_CHROME_VERSION} artifacts: *run-functional-tests-artifacts .run-remote-modules-functional-tests: extends: .run-pre-build-tests Loading @@ -89,11 +105,16 @@ run-local-modules-functional-tests: - grunt buildStyles - npm start & - > grunt test-functional-remote --functionalSuites=tests/functional/modules/**/!\(*Script\).js --headless --browser=${TEST_BROWSER} --ownServerHost="${TEST_OWN_SERVER_HOST}" --remoteHost=${TEST_REMOTE_HOST} --seleniumVersion=${REMOTE_SELENIUM_VERSION} --chromeVersion=${REMOTE_CHROME_VERSION} grunt test-functional-remote --functionalSuites=tests/functional/modules/**/!\(*Script\).js --headless --browser=${TEST_BROWSER} --ownServerHost="${TEST_OWN_SERVER_HOST}" --remoteHost=${TEST_REMOTE_HOST} --seleniumVersion=${REMOTE_SELENIUM_VERSION} --chromeVersion=${REMOTE_CHROME_VERSION} --firefoxVersion=${REMOTE_FIREFOX_VERSION} artifacts: &run-functional-tests-artifacts artifacts: *run-functional-tests-artifacts run-remote-modules-functional-tests-chrome: extends: .run-remote-modules-functional-tests Loading @@ -105,21 +126,37 @@ run-remote-modules-functional-tests-firefox: variables: TEST_BROWSER: firefox run-scheduled-remote-functional-tests: .run-scheduled-remote-functional-tests: extends: .run-tests stage: test-deploy variables: <<: *run-remote-tests-variables SERVER_URL: https://${DEV_PUBLIC_HOSTNAME} TEST_BROWSER: chrome TEST_ROLE: administrator script: - > grunt test-functional-remote --serverUrl="${SERVER_URL}" --user="${REDMIC_TEST_USER}" --pass="${REDMIC_TEST_PASS}" --role=${TEST_ROLE} --suitesGroups="${SUITES_GROUPS}" --browser=${TEST_BROWSER} --remoteHost=${TEST_REMOTE_HOST} --seleniumVersion=${REMOTE_SELENIUM_VERSION} --chromeVersion=${REMOTE_CHROME_VERSION} grunt test-functional-remote --serverUrl="${SERVER_URL}" --user="${REDMIC_TEST_USER}" --pass="${REDMIC_TEST_PASS}" --role=${TEST_ROLE} --suitesGroups="${SUITES_GROUPS}" --browser=${TEST_BROWSER} --remoteHost=${TEST_REMOTE_HOST} --seleniumVersion=${REMOTE_SELENIUM_VERSION} --chromeVersion=${REMOTE_CHROME_VERSION} --firefoxVersion=${REMOTE_FIREFOX_VERSION} dependencies: [] artifacts: &run-functional-tests-artifacts artifacts: *run-functional-tests-artifacts rules: - if: $CI_PIPELINE_SOURCE == "schedule" run-scheduled-remote-functional-tests-chrome: extends: .run-scheduled-remote-functional-tests variables: TEST_BROWSER: chrome run-scheduled-remote-functional-tests-firefox: extends: .run-scheduled-remote-functional-tests variables: TEST_BROWSER: firefox .gitmodules +0 −10 Original line number Diff line number Diff line [submodule "public/javascript/proj4js"] path = public/javascript/proj4js url = ../../third-party/proj4js.git branch = master ignore = dirty [submodule "public/javascript/redmic-widgets"] path = public/javascript/redmic-widgets url = ../widgets.git branch = master ignore = dirty [submodule "public/stylesheets"] path = public/stylesheets url = ../style.git Loading Dockerfile +16 −14 Original line number Diff line number Diff line ARG NODE_IMAGE_TAG=11.15.0-alpine ARG NODE_IMAGE_TAG FROM node:${NODE_IMAGE_TAG} LABEL maintainer="info@redmic.es" ARG PORT=3050 ARG DIRPATH=/redmic ENV NODE_ENV="production" EXPOSE ${PORT} EXPOSE 3050 ENV PORT=${PORT} WORKDIR ${DIRPATH} ADD dist*.tar.gz ./ HEALTHCHECK --interval=30s --timeout=15s --start-period=1m --retries=3 \ CMD wget --spider -q http://localhost:3050 || exit 1 RUN npm install --production CMD ["app", "-b"] HEALTHCHECK --interval=30s --timeout=15s --start-period=1m --retries=3 \ CMD wget --spider -q http://localhost:${PORT} || exit 1 WORKDIR /redmic ENTRYPOINT ["/bin/sh"] ADD dist*.tar.gz ./ CMD ["-c", "node app -b -p ${PORT}"] RUN node -e 'const fs = require("fs"); \ const pkg = JSON.parse(fs.readFileSync("./package.json", "utf-8")); \ delete pkg.devDependencies; \ fs.writeFileSync("./package.json", JSON.stringify(pkg), "utf-8");' && \ yarn install --production --ignore-optional --ignore-scripts && \ yarn cache clean && \ yarn autoclean --init && yarn autoclean --force && \ rm -f yarn.lock .yarnclean Loading
.gitignore +2 −0 Original line number Diff line number Diff line Loading @@ -2,4 +2,6 @@ node_modules dist test_reports .gitmodules.old build-report.txt *.tar.gz *.log
.gitlab-ci.build.yml +5 −4 Original line number Diff line number Diff line Loading @@ -7,25 +7,25 @@ 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/ prepare-unbuilt-version: extends: .web-build stage: pre-build script: ':' script: - grunt preBuild tags: - custom-runner artifacts: name: ${CI_JOB_NAME}_${CI_COMMIT_REF_NAME} expire_in: 1 week paths: - node_modules/ - public/javascript/proj4js/dist/proj4.js - public/javascript/redmic-widgets/src/app/ - public/javascript/templates/dist/ - public/stylesheets/style.styl - public/stylesheets/src/ Loading @@ -49,6 +49,7 @@ prepare-built-version: expire_in: 1 month paths: - dist*.tar.gz - build-report.txt rules: - if: $CI_MERGE_REQUEST_ID || $CI_PIPELINE_SOURCE == "schedule" Loading
.gitlab-ci.test.yml +56 −19 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ .run-pre-build-tests: extends: .run-tests stage: pre-build needs: ["prepare-unbuilt-version"] rules: - if: $CI_MERGE_REQUEST_ID || $CI_COMMIT_TAG || Loading @@ -27,6 +28,7 @@ .run-unit-tests: extends: .run-pre-build-tests coverage: '/^Coverage\s-\s(\d+(?:\.\d+)?%)/' after_script: - coverage=$(grep '^All files.*' test.out | cut -d '|' -f 2 | tr -d ' ') - echo "Coverage - ${coverage}%" Loading @@ -38,8 +40,12 @@ run-local-unit-tests: <<: *run-local-tests-variables script: - > grunt test-unit-local --headless --browser=${TEST_BROWSER} --seleniumVersion=${LOCAL_SELENIUM_VERSION} --chromeVersion=${LOCAL_CHROME_VERSION} | tee test.out grunt test-unit-local --headless --browser=${TEST_BROWSER} --seleniumVersion=${LOCAL_SELENIUM_VERSION} --chromeVersion=${LOCAL_CHROME_VERSION} | tee test.out .run-remote-unit-tests: extends: .run-unit-tests Loading @@ -47,9 +53,15 @@ run-local-unit-tests: <<: *run-remote-tests-variables script: - > grunt test-unit-remote --headless --browser=${TEST_BROWSER} --ownServerHost="${TEST_OWN_SERVER_HOST}" --remoteHost=${TEST_REMOTE_HOST} --seleniumVersion=${REMOTE_SELENIUM_VERSION} --chromeVersion=${REMOTE_CHROME_VERSION} --firefoxVersion=${REMOTE_FIREFOX_VERSION} | tee test.out grunt test-unit-remote --headless --browser=${TEST_BROWSER} --ownServerHost="${TEST_OWN_SERVER_HOST}" --remoteHost=${TEST_REMOTE_HOST} --seleniumVersion=${REMOTE_SELENIUM_VERSION} --chromeVersion=${REMOTE_CHROME_VERSION} --firefoxVersion=${REMOTE_FIREFOX_VERSION} | tee test.out run-remote-unit-tests-chrome: extends: .run-remote-unit-tests Loading @@ -67,7 +79,7 @@ run-remote-unit-tests-firefox: expire_in: 1 month when: always paths: - 'test_reports/test-functional*' - test_reports/test-functional* run-local-modules-functional-tests: extends: .run-pre-build-tests Loading @@ -77,9 +89,13 @@ run-local-modules-functional-tests: - grunt buildStyles - npm start & - > grunt test-functional-local --functionalSuites=tests/functional/modules/**/!\(*Script\).js --headless --browser=${TEST_BROWSER} --seleniumVersion=${LOCAL_SELENIUM_VERSION} --chromeVersion=${LOCAL_CHROME_VERSION} artifacts: &run-functional-tests-artifacts grunt test-functional-local --functionalSuites=tests/functional/modules/**/!\(*Script\).js --headless --browser=${TEST_BROWSER} --seleniumVersion=${LOCAL_SELENIUM_VERSION} --chromeVersion=${LOCAL_CHROME_VERSION} artifacts: *run-functional-tests-artifacts .run-remote-modules-functional-tests: extends: .run-pre-build-tests Loading @@ -89,11 +105,16 @@ run-local-modules-functional-tests: - grunt buildStyles - npm start & - > grunt test-functional-remote --functionalSuites=tests/functional/modules/**/!\(*Script\).js --headless --browser=${TEST_BROWSER} --ownServerHost="${TEST_OWN_SERVER_HOST}" --remoteHost=${TEST_REMOTE_HOST} --seleniumVersion=${REMOTE_SELENIUM_VERSION} --chromeVersion=${REMOTE_CHROME_VERSION} grunt test-functional-remote --functionalSuites=tests/functional/modules/**/!\(*Script\).js --headless --browser=${TEST_BROWSER} --ownServerHost="${TEST_OWN_SERVER_HOST}" --remoteHost=${TEST_REMOTE_HOST} --seleniumVersion=${REMOTE_SELENIUM_VERSION} --chromeVersion=${REMOTE_CHROME_VERSION} --firefoxVersion=${REMOTE_FIREFOX_VERSION} artifacts: &run-functional-tests-artifacts artifacts: *run-functional-tests-artifacts run-remote-modules-functional-tests-chrome: extends: .run-remote-modules-functional-tests Loading @@ -105,21 +126,37 @@ run-remote-modules-functional-tests-firefox: variables: TEST_BROWSER: firefox run-scheduled-remote-functional-tests: .run-scheduled-remote-functional-tests: extends: .run-tests stage: test-deploy variables: <<: *run-remote-tests-variables SERVER_URL: https://${DEV_PUBLIC_HOSTNAME} TEST_BROWSER: chrome TEST_ROLE: administrator script: - > grunt test-functional-remote --serverUrl="${SERVER_URL}" --user="${REDMIC_TEST_USER}" --pass="${REDMIC_TEST_PASS}" --role=${TEST_ROLE} --suitesGroups="${SUITES_GROUPS}" --browser=${TEST_BROWSER} --remoteHost=${TEST_REMOTE_HOST} --seleniumVersion=${REMOTE_SELENIUM_VERSION} --chromeVersion=${REMOTE_CHROME_VERSION} grunt test-functional-remote --serverUrl="${SERVER_URL}" --user="${REDMIC_TEST_USER}" --pass="${REDMIC_TEST_PASS}" --role=${TEST_ROLE} --suitesGroups="${SUITES_GROUPS}" --browser=${TEST_BROWSER} --remoteHost=${TEST_REMOTE_HOST} --seleniumVersion=${REMOTE_SELENIUM_VERSION} --chromeVersion=${REMOTE_CHROME_VERSION} --firefoxVersion=${REMOTE_FIREFOX_VERSION} dependencies: [] artifacts: &run-functional-tests-artifacts artifacts: *run-functional-tests-artifacts rules: - if: $CI_PIPELINE_SOURCE == "schedule" run-scheduled-remote-functional-tests-chrome: extends: .run-scheduled-remote-functional-tests variables: TEST_BROWSER: chrome run-scheduled-remote-functional-tests-firefox: extends: .run-scheduled-remote-functional-tests variables: TEST_BROWSER: firefox
.gitmodules +0 −10 Original line number Diff line number Diff line [submodule "public/javascript/proj4js"] path = public/javascript/proj4js url = ../../third-party/proj4js.git branch = master ignore = dirty [submodule "public/javascript/redmic-widgets"] path = public/javascript/redmic-widgets url = ../widgets.git branch = master ignore = dirty [submodule "public/stylesheets"] path = public/stylesheets url = ../style.git Loading
Dockerfile +16 −14 Original line number Diff line number Diff line ARG NODE_IMAGE_TAG=11.15.0-alpine ARG NODE_IMAGE_TAG FROM node:${NODE_IMAGE_TAG} LABEL maintainer="info@redmic.es" ARG PORT=3050 ARG DIRPATH=/redmic ENV NODE_ENV="production" EXPOSE ${PORT} EXPOSE 3050 ENV PORT=${PORT} WORKDIR ${DIRPATH} ADD dist*.tar.gz ./ HEALTHCHECK --interval=30s --timeout=15s --start-period=1m --retries=3 \ CMD wget --spider -q http://localhost:3050 || exit 1 RUN npm install --production CMD ["app", "-b"] HEALTHCHECK --interval=30s --timeout=15s --start-period=1m --retries=3 \ CMD wget --spider -q http://localhost:${PORT} || exit 1 WORKDIR /redmic ENTRYPOINT ["/bin/sh"] ADD dist*.tar.gz ./ CMD ["-c", "node app -b -p ${PORT}"] RUN node -e 'const fs = require("fs"); \ const pkg = JSON.parse(fs.readFileSync("./package.json", "utf-8")); \ delete pkg.devDependencies; \ fs.writeFileSync("./package.json", JSON.stringify(pkg), "utf-8");' && \ yarn install --production --ignore-optional --ignore-scripts && \ yarn cache clean && \ yarn autoclean --init && yarn autoclean --force && \ rm -f yarn.lock .yarnclean