.gitlab-ci.yml 6.1 KB
Newer Older
daniel's avatar
daniel committed
1 2 3
stages:
  - dev-build
  - night-build
Tomasz Kucner's avatar
Tomasz Kucner committed
4
  - night-build-publish
daniel's avatar
daniel committed
5
  - release-build
Tomasz Kucner's avatar
Tomasz Kucner committed
6 7 8
  - release-build-publish

###################################################################      
daniel's avatar
daniel committed
9 10 11 12 13 14
# Ubuntu 16.04
ubuntu-xenial-test:
  image: ubuntu:xenial
  variables:
    CI_ROS_DISTRO: kinetic
    UBUNTU_DISTRO: xenial
Tomasz Kucner's avatar
Tomasz Kucner committed
15
    GIT_STRATEGY: clone
daniel's avatar
daniel committed
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

  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
    - ./setup.sh $UBUNTU_DISTRO $CI_ROS_DISTRO  > /dev/null
    - setup_apt ${UBUNTU_DISTRO}
    - apt-get install -qq -y python-catkin-tools > /dev/null
    - rosdep update 2> /dev/null
    - add_aass_yaml
    - rosdep install --from-paths . -i -y -r --rosdistro $CI_ROS_DISTRO 2> /dev/null


  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
43
###################################################################
daniel's avatar
daniel committed
44 45 46 47 48 49
# 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
50
    GIT_STRATEGY: clone
daniel's avatar
daniel committed
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

  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
    - apt-get install -f -y > /dev/null
    - rosdep update 2> /dev/null
    - add_aass_yaml
    - rosdep install --from-paths . -i -y -r --rosdistro $CI_ROS_DISTRO  2> /dev/null


  stage: night-build
  script:
    - ls *
    - rm -rf build
    - source .gitlab-ci/release.sh
    - show_info
    - mkdir .build
    - release_package
    - mv .build build
    
  when: on_success
Tomasz Kucner's avatar
Tomasz Kucner committed
80
  # The files which are to be made available in GitLab
daniel's avatar
daniel committed
81 82 83 84
  artifacts:
    paths:
      - build/*

Tomasz Kucner's avatar
Tomasz Kucner committed
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


###################################################################
# put code to public reposiotry - night build
git-push-public-night-build:
  image: ubuntu:xenial
  variables:
    CI_ROS_DISTRO: kinetic
    UBUNTU_DISTRO: xenial
    GIT_STRATEGY: clone
    
  stage: night-build-publish
  
  when: on_success
  except:
    - tags
  only:
    - branches@iliad/software/graph_map
  
  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:
    #
    - 'git config remote.public.url > /dev/null && echo "git public" || ( git remote add public git@gitsvn-nt.oru.se:software/graph_map_public.git )'
    - git push public master
    # - git push -u public --tags


###################################################################
daniel's avatar
daniel committed
127 128 129 130 131 132
# 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
133
    GIT_STRATEGY: clone
daniel's avatar
daniel committed
134 135 136 137 138 139 140 141 142 143 144 145 146 147

  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
    - apt-get install -f -y  > /dev/null
    - rosdep update 2> /dev/null
Tomasz Kucner's avatar
Tomasz Kucner committed
148
    - add_aass_yaml
daniel's avatar
daniel committed
149
    - rosdep install --from-paths . -i -y -r --rosdistro $CI_ROS_DISTRO  2> /dev/null
Tomasz Kucner's avatar
Tomasz Kucner committed
150

daniel's avatar
daniel committed
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169

  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
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205
###################################################################
# put code to public reposiotry - release build
git-push-public-release-build:
  image: ubuntu:xenial
  variables:
    CI_ROS_DISTRO: kinetic
    UBUNTU_DISTRO: xenial
    GIT_STRATEGY: clone
    
  stage: release-build-publish
  
  when: on_success
  only:
    - tags@iliad/software/graph_map
  
  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:
    #
    - ' git config remote.public.url > /dev/null && echo "git public" || ( git remote add public git@gitsvn-nt.oru.se:iliad/software/graph_map_public.git ) '
    # - git push -u public --all
    - git push public --tags
daniel's avatar
daniel committed
206