image: registry.gitlab.com/openstapps/projectmanagement/node stages: - build - test - audit - publish - deploy build: stage: build script: - npm install - npm run build artifacts: untracked: true paths: - node_modules/ unit: stage: test dependencies: - build script: - npm run test-unit integration: image: registry.gitlab.com/openstapps/projectmanagement/builder stage: test dependencies: - build variables: DOCKER_DRIVER: overlay2 services: - docker:dind script: - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY - docker-compose -f integration-test.yml pull && docker-compose -f integration-test.yml up --abort-on-container-exit --exit-code-from apicli tags: - gitlab-org-docker audit: stage: audit dependencies: - build script: - npm audit allow_failure: true except: - schedules pages: stage: deploy script: - npm run documentation - mv docs/openapi public only: - master artifacts: paths: - public scheduled-audit: stage: audit script: - npm audit --audit-level=high only: - schedules ci: stage: test dependencies: - build script: - .gitlab/ci/testCIScripts.sh # Anchor templates for publishing the image in the docker registry # Automatically publishing for versions in tags (eg v1.0.0 as 1.0.0), master and develop # Manual publishing for all other branches .publish_template_auto: &publish_template_auto image: registry.gitlab.com/openstapps/projectmanagement/builder stage: publish dependencies: - build artifacts: untracked: true variables: DOCKER_DRIVER: overlay2 services: - docker:dind script: - export CORE_VERSION=$(openstapps-projectmanagement get-used-version @openstapps/core) - export VERSION=$(echo -n "$CI_BUILD_REF_NAME" | cut -c 2-) - export IMAGETAG_BASE=$CI_REGISTRY_IMAGE - export IMAGETAG_CORE_VERSION=$IMAGETAG_BASE:core-$CORE_VERSION - export IMAGETAG_VERSION=$IMAGETAG_BASE:$VERSION - export IMAGETAG_LATEST=$IMAGETAG_BASE:latest - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY - docker build -t $IMAGETAG_LATEST -t $IMAGETAG_VERSION -t $IMAGETAG_CORE_VERSION . - docker push $IMAGETAG_BASE only: - /(^v[0-9]+\.[0-9]+\.[0-9]+$|^master$|^develop$)/ tags: - gitlab-org-docker .publish_template_manual: &publish_template_manual image: registry.gitlab.com/openstapps/projectmanagement/builder stage: publish dependencies: - build artifacts: untracked: true variables: DOCKER_DRIVER: overlay2 services: - docker:dind script: - export CORE_VERSION=$(openstapps-projectmanagement get-used-version @openstapps/core) - export IMAGETAG_BASE=$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_NAME - export IMAGETAG_CORE_VERSION=$IMAGETAG_BASE:core-$CORE_VERSION - export IMAGETAG_LATEST=$IMAGETAG_BASE:latest - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY - docker build -t $IMAGETAG_LATEST -t $IMAGETAG_CORE_VERSION . - docker push $IMAGETAG_BASE except: - /(^v[0-9]+\.[0-9]+\.[0-9]+$|^master$|^develop$)/ only: - branches when: manual tags: - gitlab-org-docker #.build_template_f-u: &build_template_f-u # before_script: # - Do what you gotta do # tags: # - gitlab-org-docker # Jobs joining anchor templates with automatic publishing behaviour # ! The jobname must end with ":" followed by the name for the registry branch publish:generic: <<: *publish_template_auto #publish:f-u: # <<: *publish_template_auto # <<: *build_template_f-u # Jobs joining anchor templates with manual publishing behaviour custom:generic: <<: *publish_template_manual #custom:f-u: # <<: *publish_template_manual # <<: *build_template_f-u