Skip to content
Snippets Groups Projects
.gitlab-ci.yml 1.51 KiB
Newer Older
  • Learn to ignore specific revisions
  • default:
    
      image: node:12
    
    
    stages:
    
      - build
    
      - test
    
    submodule_fetch:
      stage: deps
      script:
        - chmod 600 .drawing-app-deploy.rsa
        - git submodule sync --recursive
        - GIT_SSH_COMMAND='ssh -i .drawing-app-deploy.rsa -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' git submodule update --init
      artifacts:
        paths:
          - src/liowebrtc
          - src/rtcpeerconnection
          - src/signalbuddy
    
    
      dependencies:
        - submodule_fetch
    
      script:
        - npm ci --only=prod
      artifacts:
        paths:
          - node_modules
    
    
    dev_node_install:
      stage: deps
    
      dependencies:
        - submodule_fetch
    
      script:
        - npm ci
      artifacts:
        paths:
          - node_modules
    
    
    check_format:
    
      dependencies:
        - dev_node_install
    
      script:
    
    Nayeem Rahman's avatar
    Nayeem Rahman committed
        - npx prettier --ignore-path .gitignore --check "**/*.{html,js,json,md}"
    
    lint:
    
      dependencies:
        - dev_node_install
    
    Nayeem Rahman's avatar
    Nayeem Rahman committed
      script:
        - npx eslint --ignore-path .gitignore "**/*.js"
    
    backend_build:
      stage: build
    
      script:
    
    Nayeem Rahman's avatar
    Nayeem Rahman committed
        - npm run build
    
    
    backend_test:
      stage: test
    
      dependencies:
        - dev_node_install
    
      script:
        - npm test
    
      dependencies:
        - node_install
        - backend_build
    
      only:
        - master
    
      script:
        - apt-get update -qq && apt-get install -qq zip
        - zip -r application.zip * .[^.]*
        - curl -X POST -u "$DEPLOYMENT_USERNAME:$DEPLOYMENT_PASSWORD" $DEPLOYMENT_ENDPOINT -T application.zip