File: .travis.yml

package info (click to toggle)
votca-csg 1.5.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 26,580 kB
  • sloc: cpp: 14,043; xml: 6,098; sh: 4,491; perl: 2,126; python: 209; tcl: 83; makefile: 54; ansic: 26
file content (126 lines) | stat: -rw-r--r-- 4,767 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# the original source of this file can be found in votca/votca repository
# add changes there!
# To update:
# wget -O .travis.yml https://raw.githubusercontent.com/votca/votca/master/.travis.yml
language: cpp

sudo: required

services:
- docker

env:
  matrix:
    - ENV=1
    - ENV=2
    - ENV=3
    - ENV=4
    - ENV=5
    - ENV=6
    - ENV=7
    - ENV=8
    - ENV=9
    - ENV=10
    - ENV=11
    - ENV=12
    - ENV=13
    - ENV=14
    - ENV=15
    - ENV=16
    - ENV=17
    - ENV=18
    - ENV=19
    - ENV=20

before_script:
 - git checkout -b current_commit
 - cd ../../
 - if [[ ${TRAVIS_REPO_SLUG} = */votca ]]; then
     if [[ ${TRAVIS_BRANCH} = next ]]; then
       git -C ${TRAVIS_REPO_SLUG} submodule foreach git checkout master;
       git -C ${TRAVIS_REPO_SLUG} submodule foreach git pull;
     fi;
     cp -vr ${TRAVIS_REPO_SLUG}/docker ${HOME};
     mv -v ${TRAVIS_REPO_SLUG} $HOME/docker;
   else
     git clone --recursive https://github.com/votca/votca.git $HOME/docker/votca;
     if [[ ${TRAVIS_BRANCH} != master ]]; then
       git -C ${HOME}/docker/votca checkout -b ${TRAVIS_BRANCH} ${TRAVIS_TAG:-origin/${TRAVIS_BRANCH}} && git -C ${HOME}/docker/votca submodule update --recursive --init;
     fi;
     git -C ${HOME}/docker/votca/${TRAVIS_REPO_SLUG#*/} fetch ${PWD}/${TRAVIS_REPO_SLUG} current_commit;
     git -C ${HOME}/docker/votca/${TRAVIS_REPO_SLUG#*/} checkout -f FETCH_HEAD;
     cp -vr ${HOME}/docker/votca/docker/* ${HOME}/docker;
     if [[ -d ${TRAVIS_REPO_SLUG}/docker ]]; then cp -vr ${TRAVIS_REPO_SLUG}/docker/* ${HOME}/docker; fi;
   fi
 - source ${HOME}/docker/set_env.sh
 - cp -r $HOME/.ccache ${HOME}/docker/ccache
 - sed -i "1s/latest/${DISTRO:-latest}/" ${HOME}/docker/Dockerfile
 - if [[ ! ${SKIP} ]]; then 
     travis_retry timeout 540 docker pull $(sed -n '1s/FROM //p' ${HOME}/docker/Dockerfile);
   fi

script:
 - if [[ ! ${SKIP} ]]; then
     travis_retry docker build "${docker_opts[@]}"
                 --build-arg CC=${CC} --build-arg CXX=${CXX} --build-arg CXXFLAGS="-Wall ${WERROR:+-Werror}"
                 --build-arg CI=${CI} --build-arg TRAVIS=${TRAVIS} --build-arg TRAVIS_OS_NAME=${DISTRO:-fedora}
                 --build-arg TRAVIS_BRANCH=${TRAVIS_BRANCH} --build-arg TRAVIS_JOB_NUMBER=${TRAVIS_JOB_NUMBER}
                 --build-arg TRAVIS_PULL_REQUEST=${TRAVIS_PULL_REQUEST} --build-arg TRAVIS_JOB_ID=${TRAVIS_JOB_ID}
                 --build-arg TRAVIS_TAG=${TRAVIS_TAG} --build-arg TRAVIS_REPO_SLUG=${TRAVIS_REPO_SLUG}
                 --build-arg TRAVIS_COMMIT=${TRAVIS_COMMIT}
                 ${TRAVIS_TAG:+-t votca/votca:${TRAVIS_TAG}}
                 -t votca/votca:latest -t votca/votca:${TRAVIS_BRANCH} ${HOME}/docker/ &&
     rm -rf $HOME/.ccache &&
     CON=$(docker run -d votca/votca:${TRAVIS_BRANCH} /bin/bash) &&
     docker cp ${CON}:/home/votca/.ccache ${HOME}/;
   fi

after_success:
  - shopt -s extglob && [[ ${TRAVIS_BRANCH} = @(master|stable|v1.*) && ${CC} = *gcc* && ${DOCKERHUB} = yes && ! ${SKIP} ]] && DEPLOY=yes
  - if [[ ${TRAVIS_BRANCH} = master ]]; then DOCKER_TAG=latest; else DOCKER_TAG="${TRAVIS_BRANCH}"; fi
  - if [[ ${DOCKER_USERNAME} && ${DOCKER_PASSWORD} && ${TRAVIS_PULL_REQUEST} == false && ${DEPLOY} ]]; then
        docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
        docker push "${TRAVIS_REPO_SLUG}:${DOCKER_TAG}";
    fi
  - if [[ ${DOXYGEN} = yes && ! ${SKIP} ]]; then
      git clone --depth=1 https://github.com/votca/doxygen.git "$HOME/devdoc";
      cd $HOME/devdoc;
      rm -f *;
      git checkout -- CNAME;
      docker cp ${CON}:/home/votca/votca/build/share/doc/html . ;
      mv html/* .; rmdir html;
      docker cp ${CON}:/home/votca/votca/build/csg-manual/manual.pdf . ;
      docker cp ${CON}:/home/votca/votca/build/ctp/manual/ctp-manual.pdf . ;
      docker cp ${CON}:/home/votca/votca/build/xtp/manual/xtp-manual.pdf . ;
      git add --all .;
      if [[ ${TRAVIS_BRANCH} = master && ${encrypted_7abbb71c3ba6_key} && ${encrypted_7abbb71c3ba6_iv} && ${TRAVIS_PULL_REQUEST} == false ]]; then
        git config --global user.name "Automatic Deployment (Travis CI)";
        git config --global user.email "votca-commits@googlegroups.com";
        git commit -m "Documentation Update";
        openssl aes-256-cbc -K $encrypted_7abbb71c3ba6_key -iv $encrypted_7abbb71c3ba6_iv -in keys/deploy3.enc -out ~/.ssh/id_rsa -d;
        chmod 600 ~/.ssh/id_rsa;
        git push git@github.com:votca/doxygen.git gh-pages;
      else
        git status;
        git diff --cached --no-color | head -c 1k;
      fi;
    fi

branches:
  only:
  - master
  - development
  - stable
  - next
  - /^v\d+\.\d+(\.\d+|_rc\d+)?$/

cache:
  - ccache

compiler:
  - gcc
  - clang

notifications:
  email:
    - votca-commits@googlegroups.com