.gitlab-ci.yml 1.94 KB
Newer Older
1 2
before_script:
  - VERSION=`cat ./version`
Benjamin Baer's avatar
Benjamin Baer committed
3
  - RELDATE=`date '+%Y%m%d%H%M'`
Marc Egger's avatar
Marc Egger committed
4 5 6 7
  - mkdir build || true

variables:
  SELENIUM_LOGS_PATH: "/scratch/tmp/7/"
8

Marc Egger's avatar
Marc Egger committed
9 10 11
stages:
  - before
  - build
12
  - selenium
Marc Egger's avatar
Marc Egger committed
13 14 15 16 17 18 19 20

documentation:
  stage: before
  script:
    - docker pull t3docs/render-documentation
    - source <(docker run --rm t3docs/render-documentation show-shell-commands)
    - dockrun_t3rd makehtml

Benjamin Baer's avatar
Benjamin Baer committed
21
snapshot:
Marc Egger's avatar
Marc Egger committed
22
  stage: build
Benjamin Baer's avatar
Benjamin Baer committed
23 24
  except:
    - tags
Marc Egger's avatar
Marc Egger committed
25 26 27 28
  artifacts:
    expire_in: 1 week
    paths:
      - build/
29
  script:
30 31 32 33 34 35
    - make VERSION=${VERSION} phpunit_snapshot
    - chmod a+r qfq_${VERSION}_*.zip
    - echo "mv qfq_${VERSION}_*.zip qfq_${VERSION}_${RELDATE}-${CI_BUILD_REF_NAME}.zip"
    - mv qfq_${VERSION}_*.zip qfq_${VERSION}_${RELDATE}-${CI_BUILD_REF_NAME}.zip
    - scp qfq_${VERSION}_*.zip w16:qfq/snapshots/
    - mv qfq_${VERSION}_*.zip build/qfq.zip
Benjamin Baer's avatar
Benjamin Baer committed
36 37

release:
Marc Egger's avatar
Marc Egger committed
38
  stage: build
Benjamin Baer's avatar
Benjamin Baer committed
39 40
  only:
    - tags
Marc Egger's avatar
Marc Egger committed
41 42 43 44
  artifacts:
    expire_in: 1 week
    paths:
      - build/
Benjamin Baer's avatar
Benjamin Baer committed
45
  script:
46 47 48 49
    - make VERSION=${VERSION} phpunit_release
    - chmod a+r qfq_${VERSION}_*.zip
    - scp qfq_${VERSION}_*.zip w16:qfq/releases/
    - mv qfq_${VERSION}_*.zip build/qfq.zip
Marc Egger's avatar
Marc Egger committed
50

51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
selenium:
  stage: selenium
  script:
    - unzip -q build/qfq.zip -d qfq
    - cd docker/
    - ./run_qfq_docker.sh -no-deploy
    - ./deploy_to_container.sh ../qfq
    - ./run_selenium_tests_docker.sh
    - echo "hello"
  after_script:
    #   remove containers and move logs to persistent location
    - cd docker; ./remove-containers.sh <<< "y"
    - cd ..
    - umask 002
    - mkdir "$SELENIUM_LOGS_PATH/$CI_COMMIT_SHORT_SHA"
    - cp extension/Tests/selenium/selenium_logs/* "$SELENIUM_LOGS_PATH/$CI_COMMIT_SHORT_SHA/"
    - echo "Selenium Logs copied to $SELENIUM_LOGS_PATH/$CI_COMMIT_SHORT_SHA/"
    - echo "Or download result (log/screenshot) in gitlab under CI/CD > Pipelines  <job> > right side 'Artifacts'"
Marc Egger's avatar
Marc Egger committed
69

70 71 72 73 74
  artifacts:
    expire_in: 1 week
    when: on_failure
    paths:
      - extension/Tests/selenium/selenium_logs/
Marc Egger's avatar
Marc Egger committed
75 76


77