.gitlab-ci.yml 6.11 KB
Newer Older
Tomasz Kucner's avatar
Tomasz Kucner committed
1 2 3
stages:
  - dev-build
  - night-build
Tomasz Kucner's avatar
Tomasz Kucner committed
4
  - night-build-publish
Tomasz Kucner's avatar
Tomasz Kucner committed
5
  - release-build
Tomasz Kucner's avatar
Tomasz Kucner committed
6
  - release-build-publish
Tomasz Kucner's avatar
Tomasz Kucner committed
7
###################################################################  
Tomasz Kucner's avatar
Tomasz Kucner committed
8 9 10 11 12 13
# Ubuntu 16.04
ubuntu-xenial-test:
  image: ubuntu:xenial
  variables:
    CI_ROS_DISTRO: kinetic
    UBUNTU_DISTRO: xenial
Tomasz Kucner's avatar
Tomasz Kucner committed
14 15
    GIT_STRATEGY: clone
    
Tomasz Kucner's avatar
Tomasz Kucner committed
16 17 18 19 20 21
  before_script:
    - echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
    - apt-get update
    - apt-get install -qq -y apt-transport-https sed wget unzip > /dev/null
    - source .gitlab-ci/prepare.sh
    - chmod +x setup.sh
Tomasz Kucner's avatar
Tomasz Kucner committed
22
    - ./setup.sh $UBUNTU_DISTRO $CI_ROS_DISTRO  > /dev/null
Tomasz Kucner's avatar
Tomasz Kucner committed
23
    - setup_apt ${UBUNTU_DISTRO}
Tomasz Kucner's avatar
Tomasz Kucner committed
24
    - apt-get install -qq -y python-catkin-tools > /dev/null
Tomasz Kucner's avatar
Tomasz Kucner committed
25
    - rosdep update 2> /dev/null
26
    - add_aass_yaml
Tomasz Kucner's avatar
Tomasz Kucner committed
27
    - rosdep install --from-paths . -i -y -r --rosdistro $CI_ROS_DISTRO 2> /dev/null
28

Tomasz Kucner's avatar
Tomasz Kucner committed
29 30 31 32 33 34 35 36 37 38 39 40 41

  stage: dev-build
  script:
    - old_dir=`pwd`
    - mkdir -p /tmp/src
    - cp  -r * /tmp/src/
    - cd /tmp/
    - source /opt/ros/${CI_ROS_DISTRO}/setup.sh
    - catkin init
    - catkin build
    - cd $old_dir
    - rm -rf /tmp/src

Tomasz Kucner's avatar
Tomasz Kucner committed
42
###################################################################
Tomasz Kucner's avatar
Tomasz Kucner committed
43 44 45 46 47 48
# Ubuntu 16.04 debian package generation
ubuntu-xenial-build-package-nightbuild:
  image: ubuntu:xenial
  variables:
    CI_ROS_DISTRO: kinetic
    UBUNTU_DISTRO: xenial
Tomasz Kucner's avatar
Tomasz Kucner committed
49 50
    GIT_STRATEGY: clone
    
Tomasz Kucner's avatar
Tomasz Kucner committed
51 52 53 54 55 56 57 58 59 60 61
  before_script:
    - echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
    - echo $CI_ROS_DISTRO
    - echo ${CI_ROS_DISTRO}
    - apt-get update
    - apt-get install -qq -y apt-transport-https sed wget unzip > /dev/null
    - source .gitlab-ci/prepare.sh
    - chmod +x setup.sh
    - ./setup.sh $UBUNTU_DISTRO $CI_ROS_DISTRO > /dev/null
    - setup_apt ${UBUNTU_DISTRO}
    - apt-get install -q -y python-bloom devscripts debhelper > /dev/null
Tomasz Kucner's avatar
Tomasz Kucner committed
62
    - apt-get install -f -y  > /dev/null
Tomasz Kucner's avatar
Tomasz Kucner committed
63
    - rosdep update 2> /dev/null
64
    - add_aass_yaml
Tomasz Kucner's avatar
Tomasz Kucner committed
65
    - rosdep install --from-paths . -i -y -r --rosdistro $CI_ROS_DISTRO  2> /dev/null
66

Tomasz Kucner's avatar
Tomasz Kucner committed
67 68 69 70 71 72 73 74 75 76

  stage: night-build
  script:
    - ls *
    - rm -rf build
    - source .gitlab-ci/release.sh
    - show_info
    - mkdir .build
    - release_package
    - mv .build build
Tomasz Kucner's avatar
Tomasz Kucner committed
77 78 79


  when: on_success
Tomasz Kucner's avatar
Tomasz Kucner committed
80 81 82
  except:
    - tags

Tomasz Kucner's avatar
Tomasz Kucner committed
83 84 85 86 87
  
# The files which are to be made available in GitLab
  artifacts:
    paths:
      - build/*
Tomasz Kucner's avatar
Tomasz Kucner committed
88
###################################################################
Tomasz Kucner's avatar
Tomasz Kucner committed
89
# put code to public reposiotry - night build
Tomasz Kucner's avatar
Tomasz Kucner committed
90 91 92 93 94
git-push-public-night-build:
  image: ubuntu:xenial
  variables:
    CI_ROS_DISTRO: kinetic
    UBUNTU_DISTRO: xenial
Tomasz Kucner's avatar
Tomasz Kucner committed
95
    GIT_STRATEGY: clone
Tomasz Kucner's avatar
Tomasz Kucner committed
96
    
Tomasz Kucner's avatar
Tomasz Kucner committed
97
  stage: night-build-publish
Tomasz Kucner's avatar
Tomasz Kucner committed
98
  
Tomasz Kucner's avatar
Tomasz Kucner committed
99
  when: on_success
Tomasz Kucner's avatar
Tomasz Kucner committed
100
  except:
Tomasz Kucner's avatar
Tomasz Kucner committed
101
    - tags
Tomasz Kucner's avatar
Tomasz Kucner committed
102 103
  only:
    - branches@software/ndt_tools
Tomasz Kucner's avatar
Tomasz Kucner committed
104 105
  before_script:
   - apt-get update
Tomasz Kucner's avatar
Tomasz Kucner committed
106
   - apt-get install -f -y  > /dev/null
Tomasz Kucner's avatar
Tomasz Kucner committed
107
   - apt-get install -y git > /dev/null
Tomasz Kucner's avatar
Tomasz Kucner committed
108 109


Tomasz Kucner's avatar
Tomasz Kucner committed
110
  script:
Tomasz Kucner's avatar
Tomasz Kucner committed
111 112 113 114 115 116 117 118 119 120 121
    # Install ssh-agent through openssh-client if not present
    - 'which ssh-agent || ( apt-get update -qy && apt-get install openssh-client -qqy )'
    # Add the private key to this user
    - eval $(ssh-agent -s) && ssh-add <(echo "$SSH_PRIVATE_KEY") && mkdir -p ~/.ssh
    # Docker specific settings
    - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
    # Config git to avoid first usage questions. Set the identity
    - git config --global user.email "gitlab-ci@oru.se" && git config --global user.name "gitlab-ci"
    #
    # Do Git stuff, for example:
    #
Tomasz Kucner's avatar
Tomasz Kucner committed
122
    - 'git config remote.public.url > /dev/null && echo "git public" || ( git remote add public git@gitsvn-nt.oru.se:software/ndt_tools_public.git )'
Tomasz Kucner's avatar
Tomasz Kucner committed
123
    - git push public master
Tomasz Kucner's avatar
Tomasz Kucner committed
124
    # - git push -u public --tags
Tomasz Kucner's avatar
Tomasz Kucner committed
125 126


Tomasz Kucner's avatar
Tomasz Kucner committed
127
###################################################################
Tomasz Kucner's avatar
Tomasz Kucner committed
128 129 130 131 132 133
# Ubuntu 16.04 debian package generation
ubuntu-xenial-build-package-release:
  image: ubuntu:xenial
  variables:
    CI_ROS_DISTRO: kinetic
    UBUNTU_DISTRO: xenial
Tomasz Kucner's avatar
Tomasz Kucner committed
134 135
    GIT_STRATEGY: clone
    
Tomasz Kucner's avatar
Tomasz Kucner committed
136 137 138 139 140 141 142 143 144 145 146
  before_script:
    - echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
    - echo $CI_ROS_DISTRO
    - echo ${CI_ROS_DISTRO}
    - apt-get update
    - apt-get install -qq -y apt-transport-https sed wget unzip > /dev/null
    - source .gitlab-ci/prepare.sh
    - chmod +x setup.sh
    - ./setup.sh $UBUNTU_DISTRO $CI_ROS_DISTRO > /dev/null
    - setup_apt ${UBUNTU_DISTRO}
    - apt-get install -q -y python-bloom devscripts debhelper > /dev/null
Tomasz Kucner's avatar
Tomasz Kucner committed
147
    - apt-get install -f -y > /dev/null
Tomasz Kucner's avatar
Tomasz Kucner committed
148
    - rosdep update 2> /dev/null
Tomasz Kucner's avatar
Tomasz Kucner committed
149
    - add_aass_yaml
Tomasz Kucner's avatar
Tomasz Kucner committed
150
    - rosdep install --from-paths . -i -y -r --rosdistro $CI_ROS_DISTRO  2> /dev/null
Tomasz Kucner's avatar
Tomasz Kucner committed
151
    
Tomasz Kucner's avatar
Tomasz Kucner committed
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170

  stage: release-build
  script:
    - ls *
    - rm -rf build
    - source .gitlab-ci/release.sh
    - show_info
    - mkdir .build
    - release_package
    - mv .build build
    
  only:
    - tags
  when: on_success
  
# The files which are to be made available in GitLab
  artifacts:
    paths:
      - build/*
Tomasz Kucner's avatar
Tomasz Kucner committed
171 172
###################################################################
# put code to public reposiotry - release build
Tomasz Kucner's avatar
Tomasz Kucner committed
173 174 175 176 177
git-push-public-release-build:
  image: ubuntu:xenial
  variables:
    CI_ROS_DISTRO: kinetic
    UBUNTU_DISTRO: xenial
Tomasz Kucner's avatar
Tomasz Kucner committed
178
    GIT_STRATEGY: clone
Tomasz Kucner's avatar
Tomasz Kucner committed
179
    
Tomasz Kucner's avatar
Tomasz Kucner committed
180
  stage: release-build-publish
Tomasz Kucner's avatar
Tomasz Kucner committed
181 182 183
  
  when: on_success
  only:
Tomasz Kucner's avatar
Tomasz Kucner committed
184
    - tags@software/ndt_tools
Tomasz Kucner's avatar
Tomasz Kucner committed
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203
  
  before_script:
   - apt-get update
   - apt-get install -f -y  > /dev/null
   - apt-get install -y git > /dev/null


  script:
    # Install ssh-agent through openssh-client if not present
    - 'which ssh-agent || ( apt-get update -qy && apt-get install openssh-client -qqy )'
    # Add the private key to this user
    - eval $(ssh-agent -s) && ssh-add <(echo "$SSH_PRIVATE_KEY") && mkdir -p ~/.ssh
    # Docker specific settings
    - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
    # Config git to avoid first usage questions. Set the identity
    - git config --global user.email "gitlab-ci@oru.se" && git config --global user.name "gitlab-ci"
    #
    # Do Git stuff, for example:
    #
Tomasz Kucner's avatar
Tomasz Kucner committed
204
    - ' git config remote.public.url > /dev/null && echo "git public" || ( git remote add public git@gitsvn-nt.oru.se:software/ndt_tools_public.git ) '
Tomasz Kucner's avatar
Tomasz Kucner committed
205
    # - git push -u public --all
Tomasz Kucner's avatar
Tomasz Kucner committed
206
    - git push public --tags