diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 67fc677b99053a964fbe2b2c695a39835fe12b61..8c68fa38c2d821893c6ebff0b7b99c6b43e25c89 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,57 +1,53 @@ -variables: - CONTAINER_IMAGE: "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME" - NODE_IMAGE: "node:16.14.0" - CYPRESS_IMAGE: "cypress/browsers:node16.14.0-slim-chrome99-ff97" - CYPRESS_CACHE_FOLDER: "cache/Cypress" +--- +default: + image: node:16.14.0 + tags: + - docker stages: - - dependencies - check - build - test - - release - deploy -default: - tags: - - docker +include: + - project: "ics-infrastructure/gitlab-ci-yml" + file: "PreCommit.gitlab-ci.yml" -dependencies: - stage: dependencies - image: $NODE_IMAGE +variables: + CONTAINER_IMAGE: "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME" + CYPRESS_CACHE_FOLDER: "cache/Cypress" + +install-dependencies: + stage: check script: - npm ci artifacts: paths: - node_modules - - ${CYPRESS_CACHE_FOLDER} + - ${CYPRESS_CACHE_FOLDER} # for some inexplicable reason this path MUST be in a variable -pre-commit: - stage: check - image: registry.esss.lu.se/ics-docker/pre-commit:latest - script: - - pre-commit run --all-files +run-pre-commit: needs: - - job: dependencies + - job: install-dependencies artifacts: true lint: stage: check - image: $NODE_IMAGE script: - npm run code-quality needs: - - job: dependencies + - job: install-dependencies artifacts: true artifacts: reports: codequality: gl-codequality.json -build-image: +build-container: stage: build image: docker:latest needs: - - job: dependencies + - job: install-dependencies artifacts: true before_script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY @@ -61,11 +57,10 @@ build-image: build-storybook: stage: build - image: $NODE_IMAGE script: - npm run build-storybook needs: - - job: dependencies + - job: install-dependencies artifacts: true artifacts: paths: @@ -73,11 +68,11 @@ build-storybook: test-components-chrome: stage: test - image: $CYPRESS_IMAGE + image: cypress/browsers:node16.14.0-slim-chrome99-ff97 script: - CHOKIDAR_USEPOLLING=true WATCHPACK_POLLING=true npx cypress run --component --browser chrome needs: - - job: dependencies + - job: install-dependencies artifacts: true artifacts: when: on_failure @@ -85,48 +80,28 @@ test-components-chrome: - cypress/videos - cypress/screenshots -release-image: - stage: release - image: docker:latest - needs: - - build-image - before_script: - - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - script: - - docker pull "$CONTAINER_IMAGE" - - docker tag "$CONTAINER_IMAGE" "$CI_REGISTRY_IMAGE:latest" - - docker push "$CI_REGISTRY_IMAGE:latest" - only: - - tags - -deploy-test: +.deploy: stage: deploy image: registry.esss.lu.se/ics-docker/awxkit - needs: - - build-image script: - > - awx job_templates launch deploy-ccce-test + awx job_templates launch deploy-ccce-${INSTANCE} --extra_vars "ce_deploy_ui_container_image_tag: $CI_COMMIT_REF_NAME" --job_tags ce-deploy-ui --monitor - environment: - name: test - url: https://ce-deploy-test.cslab.esss.lu.se/ - when: manual - -deploy-demo: - stage: deploy - image: registry.esss.lu.se/ics-docker/awxkit needs: - - build-image - script: - - > - awx job_templates launch deploy-ccce-demo - --extra_vars "ce_deploy_ui_container_image_tag: $CI_COMMIT_REF_NAME" - --job_tags ce-deploy-ui - --monitor + - build-container environment: - name: demo - url: https://ce-deploy-demo.cslab.esss.lu.se/ + name: ${INSTANCE} + url: https://ce-deploy-${INSTANCE}.cslab.esss.lu.se/ when: manual + +deploy-to-test: + extends: .deploy + variables: + INSTANCE: test + +deploy-to-demo: + extends: .deploy + variables: + INSTANCE: demo diff --git a/Dockerfile-serve b/Dockerfile-serve deleted file mode 100644 index 7eb11645198bd377de22b428c973c8ea7dd86cbf..0000000000000000000000000000000000000000 --- a/Dockerfile-serve +++ /dev/null @@ -1,11 +0,0 @@ -FROM node:alpine -MAINTAINER John Sparger - -RUN npm install -g serve -EXPOSE 80 -COPY . /work -WORKDIR /work -RUN /usr/bin/env ls -a -RUN npm install . -RUN npm run build -CMD node /usr/local/lib/node_modules/serve/bin/serve -s -l 80 ./build \ No newline at end of file diff --git a/src/components/IOC/IOCDeployDialog/IOCDeployDialog.js b/src/components/IOC/IOCDeployDialog/IOCDeployDialog.js index 61e31135d42a04dcb754e7333dbe95c3751bb466..0d77ad0a21993133978489b48d07001c51e33b40 100644 --- a/src/components/IOC/IOCDeployDialog/IOCDeployDialog.js +++ b/src/components/IOC/IOCDeployDialog/IOCDeployDialog.js @@ -96,8 +96,8 @@ export function IOCDeployDialog({ hostCSEntryId: host ? Number(host.csEntryHost.id) : init.csEntryHost - ? init.csEntryHost.id - : undefined + ? init.csEntryHost.id + : undefined } } );