.gitlab-ci.yml 2.09 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'`
4
  - mkdir -p build || true
Carsten  Rose's avatar
Carsten Rose committed
5
  - echo "Host `hostname`, User `id`"
Marc Egger's avatar
Marc Egger committed
6
7
8

variables:
  SELENIUM_LOGS_PATH: "/scratch/tmp/7/"
9
  GIT_STRATEGY: clone
10

Marc Egger's avatar
Marc Egger committed
11
12
13
stages:
  - before
  - build
14
  - selenium
Marc Egger's avatar
Marc Egger committed
15

16
17
18
19
20
21
#documentation:
#  stage: before
#  script:
#    - docker pull t3docs/render-documentation
#    - source <(docker run --rm t3docs/render-documentation show-shell-commands)
#    - dockrun_t3rd makehtml
Marc Egger's avatar
Marc Egger committed
22

Benjamin Baer's avatar
Benjamin Baer committed
23
snapshot:
Marc Egger's avatar
Marc Egger committed
24
  stage: build
Benjamin Baer's avatar
Benjamin Baer committed
25
26
  except:
    - tags
Marc Egger's avatar
Marc Egger committed
27
28
29
30
  artifacts:
    expire_in: 1 week
    paths:
      - build/
31
  script:
Benjamin Baer's avatar
Benjamin Baer committed
32
33
34
35
36
37
    - 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
38
39

release:
Marc Egger's avatar
Marc Egger committed
40
  stage: build
Benjamin Baer's avatar
Benjamin Baer committed
41
42
  only:
    - tags
Marc Egger's avatar
Marc Egger committed
43
44
45
46
  artifacts:
    expire_in: 1 week
    paths:
      - build/
Benjamin Baer's avatar
Benjamin Baer committed
47
  script:
Benjamin Baer's avatar
Benjamin Baer committed
48
49
50
51
    - 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
52

53
54
55
56
57
selenium:
  stage: selenium
  script:
    - unzip -q build/qfq.zip -d qfq
    - cd docker/
Marc Egger's avatar
Marc Egger committed
58
    # Required docker images: https://systemvcs.math.uzh.ch/megger/qfq_docker.git
59
60
61
62
63
64
65
66
67
    - ./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
68
    - mkdir -p "$SELENIUM_LOGS_PATH/$CI_COMMIT_SHORT_SHA"
69
    - cp extension/Tests/selenium/selenium_logs/* "$SELENIUM_LOGS_PATH/$CI_COMMIT_SHORT_SHA/"
70
71
    - 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
72

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


80