Skip to content

Commit

Permalink
Merge pull request #558 from Dronecode/pr-557-follow-up
Browse files Browse the repository at this point in the history
Jenkinsfile: update to latest docker tag
  • Loading branch information
JonasVautherin authored Sep 29, 2018
2 parents 4465537 + 1cdf2ce commit 3744602
Show file tree
Hide file tree
Showing 9 changed files with 88 additions and 56 deletions.
16 changes: 8 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,20 +105,20 @@ script:
make BUILD_TYPE=Coverage run_unit_tests -j4;
fi
- if [[ "${BUILD_TARGET}" = "docker_build_ubuntu_16.04" ]]; then
docker run -it --rm -v $TRAVIS_BUILD_DIR:/root/DronecodeSDK:rw dronecode/dronecode-sdk-ubuntu-16.04 ./travis-docker-build.sh;
docker run -it --rm -v $TRAVIS_BUILD_DIR:/root/DronecodeSDK:rw dronecode/dronecode-sdk-ubuntu-16.04 ./create_packages.sh;
docker run -it --rm -v $TRAVIS_BUILD_DIR:/home/user/DronecodeSDK:rw -e LOCAL_USER_ID=`id -u` dronecode/dronecode-sdk-ubuntu-16.04 ./travis-docker-build.sh;
docker run -it --rm -v $TRAVIS_BUILD_DIR:/home/user/DronecodeSDK:rw -e LOCAL_USER_ID=`id -u` dronecode/dronecode-sdk-ubuntu-16.04 ./create_packages.sh;
fi
- if [[ "${BUILD_TARGET}" = "docker_build_ubuntu_18.04" ]]; then
docker run -it --rm -v $TRAVIS_BUILD_DIR:/root/DronecodeSDK:rw dronecode/dronecode-sdk-ubuntu-18.04 ./travis-docker-build.sh;
docker run -it --rm -v $TRAVIS_BUILD_DIR:/root/DronecodeSDK:rw dronecode/dronecode-sdk-ubuntu-18.04 ./create_packages.sh;
docker run -it --rm -v $TRAVIS_BUILD_DIR:/home/user/DronecodeSDK:rw -e LOCAL_USER_ID=`id -u` dronecode/dronecode-sdk-ubuntu-18.04 ./travis-docker-build.sh;
docker run -it --rm -v $TRAVIS_BUILD_DIR:/home/user/DronecodeSDK:rw -e LOCAL_USER_ID=`id -u` dronecode/dronecode-sdk-ubuntu-18.04 ./create_packages.sh;
fi
- if [[ "${BUILD_TARGET}" = "docker_build_fedora_27" ]]; then
docker run -it --rm -v $TRAVIS_BUILD_DIR:/root/DronecodeSDK:rw dronecode/dronecode-sdk-fedora-27 ./travis-docker-build.sh;
docker run -it --rm -v $TRAVIS_BUILD_DIR:/root/DronecodeSDK:rw dronecode/dronecode-sdk-fedora-27 ./create_packages.sh;
docker run -it --rm -v $TRAVIS_BUILD_DIR:/home/user/DronecodeSDK:rw -e LOCAL_USER_ID=`id -u` dronecode/dronecode-sdk-fedora-27 ./travis-docker-build.sh;
docker run -it --rm -v $TRAVIS_BUILD_DIR:/home/user/DronecodeSDK:rw -e LOCAL_USER_ID=`id -u` dronecode/dronecode-sdk-fedora-27 ./create_packages.sh;
fi
- if [[ "${BUILD_TARGET}" = "docker_build_fedora_28" ]]; then
docker run -it --rm -v $TRAVIS_BUILD_DIR:/root/DronecodeSDK:rw dronecode/dronecode-sdk-fedora-28 ./travis-docker-build.sh;
docker run -it --rm -v $TRAVIS_BUILD_DIR:/root/DronecodeSDK:rw dronecode/dronecode-sdk-fedora-28 ./create_packages.sh;
docker run -it --rm -v $TRAVIS_BUILD_DIR:/home/user/DronecodeSDK:rw -e LOCAL_USER_ID=`id -u` dronecode/dronecode-sdk-fedora-28 ./travis-docker-build.sh;
docker run -it --rm -v $TRAVIS_BUILD_DIR:/home/user/DronecodeSDK:rw -e LOCAL_USER_ID=`id -u` dronecode/dronecode-sdk-fedora-28 ./create_packages.sh;
fi
- if [[ "${BUILD_TARGET}" = "osx_build" ]]; then
make;
Expand Down
64 changes: 45 additions & 19 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
#!/usr/bin/env groovy

pipeline {
agent any
agent none

stages {

stage('Build') {
parallel {

stage('Ubuntu 16.04 Debug') {
agent {
docker {
image 'dronecode/dronecode-sdk-ubuntu-16.04:2018-09-18'
image 'dronecode/dronecode-sdk-ubuntu-16.04:2018-09-28'
}
}
steps {
Expand All @@ -18,10 +23,11 @@ pipeline {
sh 'build/default/backend/test/unit_tests_backend'
}
}

stage('Ubuntu 16.04 Release') {
agent {
docker {
image 'dronecode/dronecode-sdk-ubuntu-16.04:2018-09-18'
image 'dronecode/dronecode-sdk-ubuntu-16.04:2018-09-28'
}
}
steps {
Expand All @@ -33,10 +39,11 @@ pipeline {
sh 'build/default/backend/test/unit_tests_backend'
}
}

stage('Ubuntu 18.04 Debug') {
agent {
docker {
image 'dronecode/dronecode-sdk-ubuntu-18.04:2018-09-18'
image 'dronecode/dronecode-sdk-ubuntu-18.04:2018-09-28'
}
}
steps {
Expand All @@ -48,10 +55,11 @@ pipeline {
sh 'build/default/backend/test/unit_tests_backend'
}
}

stage('Ubuntu 18.04 Release') {
agent {
docker {
image 'dronecode/dronecode-sdk-ubuntu-18.04:2018-09-18'
image 'dronecode/dronecode-sdk-ubuntu-18.04:2018-09-28'
}
}
steps {
Expand All @@ -63,10 +71,11 @@ pipeline {
sh 'build/default/backend/test/unit_tests_backend'
}
}

stage('Fedora 27 Debug') {
agent {
docker {
image 'dronecode/dronecode-sdk-fedora-27:2018-09-18'
image 'dronecode/dronecode-sdk-fedora-27:2018-09-28'
}
}
steps {
Expand All @@ -78,10 +87,11 @@ pipeline {
sh 'build/default/backend/test/unit_tests_backend'
}
}

stage('Fedora 27 Release') {
agent {
docker {
image 'dronecode/dronecode-sdk-fedora-27:2018-09-18'
image 'dronecode/dronecode-sdk-fedora-27:2018-09-28'
}
}
steps {
Expand All @@ -93,10 +103,11 @@ pipeline {
sh 'build/default/backend/test/unit_tests_backend'
}
}

stage('Fedora 28 Debug') {
agent {
docker {
image 'dronecode/dronecode-sdk-fedora-28:2018-09-18'
image 'dronecode/dronecode-sdk-fedora-28:2018-09-28'
}
}
steps {
Expand All @@ -108,10 +119,11 @@ pipeline {
sh 'build/default/backend/test/unit_tests_backend'
}
}

stage('Fedora 28 Release') {
agent {
docker {
image 'dronecode/dronecode-sdk-fedora-28:2018-09-18'
image 'dronecode/dronecode-sdk-fedora-28:2018-09-28'
}
}
steps {
Expand All @@ -123,24 +135,28 @@ pipeline {
sh 'build/default/backend/test/unit_tests_backend'
}
}
}
}

} // parallel
} // Build

stage('Test') {
parallel {

stage('check style') {
agent {
docker {
image 'dronecode/dronecode-sdk-ubuntu-16.04:2018-09-18'
image 'dronecode/dronecode-sdk-ubuntu-16.04:2018-09-28'
}
}
steps {
sh 'make fix_style'
}
}

stage('example/takeoff_land') {
agent {
docker {
image 'dronecode/dronecode-sdk-ubuntu-16.04:2018-09-18'
image 'dronecode/dronecode-sdk-ubuntu-16.04:2018-09-28'
}
}
steps {
Expand All @@ -152,10 +168,11 @@ pipeline {
// FIXME sh 'make -C example/takeoff_land/build'
}
}

stage('example/fly_mission') {
agent {
docker {
image 'dronecode/dronecode-sdk-ubuntu-16.04:2018-09-18'
image 'dronecode/dronecode-sdk-ubuntu-16.04:2018-09-28'
}
}
steps {
Expand All @@ -167,10 +184,11 @@ pipeline {
// FIXME sh 'make -C example/fly_mission/build'
}
}

stage('example/offboard_velocity') {
agent {
docker {
image 'dronecode/dronecode-sdk-ubuntu-16.04:2018-09-18'
image 'dronecode/dronecode-sdk-ubuntu-16.04:2018-09-28'
}
}
steps {
Expand All @@ -182,12 +200,14 @@ pipeline {
// FIXME sh 'make -C example/offboard_velocity/build'
}
}
}
}

} // parallel
} // stage Test

stage('Generate Docs') {
agent {
docker {
image 'dronecode/dronecode-sdk-ubuntu-16.04:2018-09-18'
image 'dronecode/dronecode-sdk-ubuntu-16.04:2018-09-28'
}
}
steps {
Expand All @@ -196,6 +216,12 @@ pipeline {
sh 'git submodule update --init --recursive --force'
sh './generate_docs.sh'
}
}
} // stage Generate Docs

} // stages

options {
buildDiscarder(logRotator(numToKeepStr: '10', artifactDaysToKeepStr: '30'))
timeout(time: 60, unit: 'MINUTES')
}
}
8 changes: 3 additions & 5 deletions docker/Dockerfile-Fedora-27
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,11 @@ RUN wget http://releases.llvm.org/6.0.0/clang+llvm-6.0.0-x86_64-linux-gnu-Fedora

RUN gem install --no-ri --no-rdoc fpm;

RUN useradd -d /home/dronecode -m -s /bin/bash dronecode

ADD /sudoers.txt /etc/sudoers
RUN chmod 440 /etc/sudoers

USER dronecode
COPY entrypoint.sh /usr/local/bin/entrypoint.sh

CMD ["/bin/bash"]
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]

WORKDIR "/home/dronecode/DronecodeSDK"
WORKDIR "/home/user/DronecodeSDK"
8 changes: 3 additions & 5 deletions docker/Dockerfile-Fedora-28
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,11 @@ RUN dnf -y install \

RUN gem install --no-ri --no-rdoc fpm;

RUN useradd -d /home/dronecode -m -s /bin/bash dronecode

ADD /sudoers.txt /etc/sudoers
RUN chmod 440 /etc/sudoers

USER dronecode
COPY entrypoint.sh /usr/local/bin/entrypoint.sh

CMD ["/bin/bash"]
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]

WORKDIR "/home/dronecode/DronecodeSDK"
WORKDIR "/home/user/DronecodeSDK"
8 changes: 3 additions & 5 deletions docker/Dockerfile-Ubuntu-16.04
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,11 @@ RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - \

RUN gem install --no-ri --no-rdoc fpm;

RUN useradd -d /home/dronecode -m -s /bin/bash dronecode

ADD /sudoers.txt /etc/sudoers
RUN chmod 440 /etc/sudoers

USER dronecode
COPY entrypoint.sh /usr/local/bin/entrypoint.sh

CMD ["/bin/bash"]
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]

WORKDIR "/home/dronecode/DronecodeSDK"
WORKDIR "/home/user/DronecodeSDK"
8 changes: 3 additions & 5 deletions docker/Dockerfile-Ubuntu-18.04
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,11 @@ RUN update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/cl

RUN gem install --no-ri --no-rdoc fpm;

RUN useradd -d /home/dronecode -m -s /bin/bash dronecode

ADD /sudoers.txt /etc/sudoers
RUN chmod 440 /etc/sudoers

USER dronecode
COPY entrypoint.sh /usr/local/bin/entrypoint.sh

CMD ["/bin/bash"]
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]

WORKDIR "/home/dronecode/DronecodeSDK"
WORKDIR "/home/user/DronecodeSDK"
16 changes: 16 additions & 0 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

# Utility to use local user, taken from:
# https://denibertovic.com/posts/handling-permissions-with-docker-volumes/

# Add local user
# Either use the LOCAL_USER_ID if passed in at runtime or
# make educated guess to default of first user.

USER_ID=${LOCAL_USER_ID:-1000}

echo "Starting with UID : $USER_ID"
useradd --shell /bin/bash -u $USER_ID -o -c "" -m user
export HOME=/home/user

exec /bin/su user -c "$@"
2 changes: 1 addition & 1 deletion docker/sudoers.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
root ALL=(ALL) ALL
dronecode ALL=(ALL) NOPASSWD: ALL
user ALL=(ALL) NOPASSWD: ALL
14 changes: 6 additions & 8 deletions travis-docker-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,18 @@
set -e

make BUILD_TYPE=Debug run_unit_tests_offline -j4
make default install
#make default install
make fix_style
(cd example/takeoff_land && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Debug .. && make)
(cd example/fly_mission && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Debug .. && make)
(cd example/offboard_velocity && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Debug .. && make)
#(cd example/takeoff_land && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Debug .. && make)
#(cd example/fly_mission && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Debug .. && make)
#(cd example/offboard_velocity && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Debug .. && make)
make clean
git clean -dfx

make BUILD_TYPE=Release run_unit_tests_offline -j4
make default install
#make default install
make fix_style
(cd example/takeoff_land && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. && make)
(cd example/fly_mission && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. && make)
(cd example/offboard_velocity && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. && make)
#(cd example/takeoff_land && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. && make) (cd example/fly_mission && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. && make) (cd example/offboard_velocity && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. && make)
make clean
git clean -dfx

Expand Down

0 comments on commit 3744602

Please sign in to comment.