---
version: 2
plan:
  project-key: ADGEXT
  key: DATESTSPECS
  name: disable-amp - test
variables:
  dockerNode: adguard/node-ssh:14.18--2

stages:
  - Test:
      manual: 'false'
      final: 'false'
      jobs:
        - Test

Test:
  key: TEST
  docker:
    image: ${bamboo.dockerNode}
    volumes:
      ${system.YARN_DIR}: "${bamboo.cacheYarn}"
  tasks:
    - checkout:
        force-clean-build: 'true'
    - script:
        interpreter: SHELL
        scripts:
          - |-
            set -x
            set -e
            ls -alt
            yarn install ${bamboo.varsYarn}
            yarn lint
            yarn dev
  final-tasks:
    - script:
        interpreter: SHELL
        scripts:
          - |-
            set -x
            set -e

            # Fix mixed logs
            exec 2>&1

            ls -la

            echo "Size before cleanup:" && du -h | tail -n 1
            rm -rf node_modules
            echo "Size after cleanup:" && du -h | tail -n 1
  artifacts:
    - name: disable-amp.meta.js
      location: build/dev
      pattern: disable-amp.meta.js
      shared: 'true'
      required: 'true'
    - name: disable-amp.user.js
      location: build/dev
      pattern: disable-amp.user.js
      shared: 'true'
      required: 'true'
  requirements:
    - adg-docker: 'true'

branches:
  create: for-pull-request
  delete:
    after-deleted-days: '1'
    after-inactive-days: '5'
  link-to-jira: 'true'

notifications: []
labels: []
other:
  concurrent-build-plugin: system-default
