.gitlab-ci.yml 2.23 KB
Newer Older
1 2 3 4 5 6 7
# isisscripts CI jobs

# build creates isisscripts.sl
# test runs tests from Makefile
# deploy code to master (and non-gitlab repo?)
# how to trigger merge request from cmdln?
before_script:
Jakob Stierhof's avatar
Jakob Stierhof committed
8
  - source /data/software/profile.in
Philipp Weber's avatar
Philipp Weber committed
9 10 11
  - module load heasoft
  - module load jed
  - module load isis
12
  - TARGET=/data/software/Science/isisscripts
13 14 15 16 17

stages:
  - build
  - test
  - deploy
18
#  - wiki
19 20 21 22 23 24

build:
  stage: build
  script:
    - make isisscripts
    - make help
Jakob Stierhof's avatar
Jakob Stierhof committed
25
    - make wiki
26
  only:
27
    - merge_requests
Thomas Dauser's avatar
Thomas Dauser committed
28
    - master
29 30 31 32 33 34 35 36 37 38 39 40
  artifacts:
    expire_in: 5 min
    paths:
      - isisscripts.sl
      - share/

# how to trigger only on merge request?
test:
  stage: test
  script:
    - make test
  only:
Jakob Stierhof's avatar
Jakob Stierhof committed
41
    - merge_requests
42 43 44 45

provide:
  stage: deploy
  script:
Thomas Dauser's avatar
Thomas Dauser committed
46
    - git push /data/git/isisscripts.git HEAD:master
Philipp Weber's avatar
Philipp Weber committed
47 48 49 50
    - tar cfzv /data/www/isis/download/isisscripts.tgz share/isisscripts.sl share/isisscripts.txt --owner=1000 --group=1000
    - tar cfzv /data/www/isis/download/refdata.tgz refdata --owner=1000 --group=1000
    - cp share/isisscripts.sl /data/www/isis/download
    - cp share/isisscripts.txt /data/www/isis/download
Philipp Weber's avatar
Philipp Weber committed
51 52 53 54 55 56
    - tar cfzv ${TARGET}/isisscripts.tgz share/isisscripts.sl share/isisscripts.txt
    - tar cfzv ${TARGET}/refdata.tgz refdata
    - tar xfzv ${TARGET}/isisscripts.tgz -C ${TARGET}
    - tar xfzv ${TARGET}/refdata.tgz -C ${TARGET}
    - rm -f ${TARGET}/isisscripts.sl && ln -s share/isisscripts.sl ${TARGET}/isisscripts.sl
    - rm -f ${TARGET}/isisscripts.txt && ln -s share/isisscripts.txt ${TARGET}/isisscripts.txt
57 58
  only:
    - master
Jakob Stierhof's avatar
Jakob Stierhof committed
59 60 61

# clone wiki with pipeline and add tm expanded help files
# the markdown translation is defined in doc/doc/ISISscripts_md.tm
62 63 64 65 66 67 68 69 70 71 72
# wiki:
#  stage: wiki
#  script:
#    - git clone https://stierhof:${WIKI_ACCESS}@www.sternwarte.uni-erlangen.de/gitlab/remeis/isisscripts.wiki.git
#    - ./bin/collect_functions src | ./bin/software_structure share/Function-reference 1 share/isisscripts.md
#    - rsync -r share/Function-reference isisscripts.wiki
#    - mv share/Function-reference.md isisscripts.wiki
#    - cd isisscripts.wiki
#    - if ! [ -z "$(git status --porcelain)" ]; then git add -A; git commit -m "[AUTO] wiki update"; git push origin master; fi
#    - cd ../ && rm -rf isisscripts.wiki
#  only:
Philipp Weber's avatar
Philipp Weber committed
73
#    - master