Skip to content
This repository has been archived by the owner on May 21, 2024. It is now read-only.

Commit

Permalink
Merge pull request #799 from advancedtelematic/fix/PRO-5458/garage-de…
Browse files Browse the repository at this point in the history
…ploy-on-ubuntu

Build garage_deploy.deb on Ubuntu Xenial
  • Loading branch information
pattivacek authored May 31, 2018
2 parents ab0fcff + 34d0251 commit e48e061
Show file tree
Hide file tree
Showing 16 changed files with 24 additions and 135 deletions.
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ env:
DARGS="-eTEST_TESTSUITE_ONLY=crypto"
- DOCKERFILE=Dockerfile.deb-testing CACHE=latest-deb-unstable SCRIPT=src/scripts/test.sh
DARGS="-eTEST_WITH_LOAD_TESTS=1 -eTEST_WITH_TESTSUITE=0 -eTEST_WITH_STATICTESTS=1"
- DOCKERFILE=Dockerfile.deb-stable CACHE=latest-deb-stable SCRIPT=src/scripts/build_garage_deploy.sh
- DOCKERFILE=Dockerfile.noostree CACHE=latest SCRIPT=src/scripts/build_ubuntu.sh
services:
- docker
Expand All @@ -23,7 +22,7 @@ script:
- ci_env=`bash <(curl -s https://codecov.io/env)`
- docker run -v /persistent:/persistent $ci_env $DARGS --name "$CACHE" -it advancedtelematic/aktualizr
${SCRIPT}
- if [ $DOCKERFILE = Dockerfile.deb-stable ]; then ./scripts/test_garage_deploy_deb.sh; fi
- if [ $DOCKERFILE = Dockerfile.noostree ]; then ./scripts/test_garage_deploy_deb.sh; fi
- if [ $DOCKERFILE = Dockerfile.noostree ]; then ./scripts/test_aktualizr_deb_ubuntu.sh; fi
deploy:
- provider: releases
Expand All @@ -33,7 +32,7 @@ deploy:
tags: true
all_branches: true
repo: advancedtelematic/aktualizr
condition: $DOCKERFILE = Dockerfile.deb-stable
condition: $DOCKERFILE = Dockerfile.noostree

api_key:
secure: "Z9IEs+GbPW+pxxfYofmeT4Jwjz4OpXJ6WZbv8nyN0MOZV146QExKhZA64mJ7nuXRepS7M5wFgVd0QVlmE7lLa8oNVTKujn+DmQ6701HeP9bITwv6wcDyhNOULLRBwRD2YN5lR29vHGWsjMUm8R13Wtgr/XyOG4L8fcg021B0BMtvepO9HJD4kHSNqB8pJXWVSMd5+d77BRz8Yr72oP98iBMAm94XNd5Gd2RB77YBRKlR7XEV2DxW346C9xI48crMRAKAyp/35vTCTMT04In4FpSexSue0q5dGqfQZf2I5fpGtSbwwJIb3ct/T0CUcW8mDQL01LtG3Hm2qNXKn8aCse6MrVoktUWBTA+tn7DMGq6zY4XXkyC7OisBYg9eel8HacSPrCXDB9C80aJht9a7AZIHehLC4yUomhYmnQDotvHoc3JrJXMSq4HE31WwIBn0xmOpr4ts0nnAprl3bRCQcv10J4MU4zK+BEYET+sLs1stqeION/AYTr0OxWVfbUhRdVepAjDh/mNLYO7raDb/PTZb4upunjS5a1RK+U+aW8ct85RPamZ+8+ZTo8Ofj5VGQiVJmmmrlVkDyBzXwJL3WonnZwuU6QDaaYCFUuzyVqmEuYZNc3i6jNUs0Yptw2YjKww6ayV5msyGaA0QZ3vdGWRk9K7JQQhE7CII2N4yzvI="
Expand Down
60 changes: 0 additions & 60 deletions Dockerfile.deb-stable

This file was deleted.

20 changes: 0 additions & 20 deletions Dockerfile.garage-deploy.deb-stable

This file was deleted.

7 changes: 4 additions & 3 deletions Dockerfile.test-install.xenial
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM ubuntu:xenial
LABEL Description="Aktualizr deb package testing dockerfile"
LABEL Description="Deb package testing dockerfile"

ENV DEBIAN_FRONTEND noninteractive

Expand All @@ -8,12 +8,13 @@ RUN apt-get update && apt-get install -y \
libarchive13 \
libc6 \
libcurl3 \
libgcc1 \
libglib2.0-0 \
libsodium18 \
libsqlite3-0 \
libssl1.0.0 \
libstdc++6 \
lshw \
openjdk-8-jre \
python3

ENTRYPOINT /persistent/test_aktualizr_deb_and_update.sh
ADD . /
28 changes: 3 additions & 25 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -99,29 +99,6 @@ pipeline {
sh 'scripts/test.sh'
}
}
// build garage_deploy.deb
stage('garage_deploy') {
agent any
environment {
TEST_INSTALL_DESTDIR = "${env.WORKSPACE}/build-debstable/pkg"
}
steps {
// build package inside docker
sh '''
IMG_TAG=deb-$(cat /proc/sys/kernel/random/uuid)
mkdir -p ${TEST_INSTALL_DESTDIR}
docker build -t ${IMG_TAG} -f Dockerfile.deb-stable .
docker run -u $(id -u):$(id -g) -v $PWD:$PWD -v ${TEST_INSTALL_DESTDIR}:/persistent -w $PWD --rm ${IMG_TAG} $PWD/scripts/build_garage_deploy.sh
'''
// test package installation in another docker
sh 'scripts/test_garage_deploy_deb.sh ${TEST_INSTALL_DESTDIR}'
}
post {
always {
archiveArtifacts artifacts: "build-debstable/pkg/*garage_deploy.deb", fingerprint: true
}
}
}
// run crypto tests with Openssl 1.1
stage('openssl11') {
agent {
Expand Down Expand Up @@ -153,7 +130,7 @@ pipeline {
}
}
}
// build and test aktualizr.deb
// build and test aktualizr.deb and garage_deploy.deb
stage('debian_pkg') {
agent any
environment {
Expand All @@ -168,11 +145,12 @@ pipeline {
docker run -u $(id -u):$(id -g) -v $PWD:$PWD -v ${TEST_INSTALL_DESTDIR}:/persistent -w $PWD --rm ${IMG_TAG} $PWD/scripts/build_ubuntu.sh
'''
// test package installation in another docker
sh 'scripts/test_garage_deploy_deb.sh ${TEST_INSTALL_DESTDIR}'
sh 'scripts/test_aktualizr_deb_ubuntu.sh ${TEST_INSTALL_DESTDIR}'
}
post {
always {
archiveArtifacts artifacts: "build-ubuntu/pkg/*aktualizr.deb", fingerprint: true
archiveArtifacts artifacts: "build-ubuntu/pkg/*.deb", fingerprint: true
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ docker build -t advancedtelematic/aktualizr .
While the default Dockerfile image is usually the best one to use, you can select another one with the `-f <Dockerfile>` flag, e.g.:

----
docker build -t advancedtelematic/aktualizr -f Dockerfile.deb-stable .
docker build -t advancedtelematic/aktualizr -f Dockerfile.noostree .
----

Once your docker image is built, Aktualizr can be built and tested with:
Expand Down
14 changes: 0 additions & 14 deletions scripts/build_garage_deploy.sh

This file was deleted.

3 changes: 1 addition & 2 deletions scripts/build_ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@ export TEST_WITH_INSTALL_DEB_PACKAGES=1
export TEST_WITH_OSTREE=0
export TEST_WITH_TESTSUITE=0

# build and copy aktualizr.deb to $TEST_INSTALL_DESTDIR
# build and copy aktualizr.deb and garage_deploy.deb to $TEST_INSTALL_DESTDIR
"${GITREPO_ROOT}/scripts/test.sh"

# copy provisioning data and scripts
cp -rf "${GITREPO_ROOT}/tests/test_data/prov_selfupdate" "${TEST_INSTALL_DESTDIR}"
cp -rf "${GITREPO_ROOT}/tests/config/selfupdate.toml" "${TEST_INSTALL_DESTDIR}"
cp -rf "${GITREPO_ROOT}/scripts/selfupdate_server.py" "${TEST_INSTALL_DESTDIR}"
cp -f "${GITREPO_ROOT}/scripts/test_aktualizr_deb_and_update.sh" "${TEST_INSTALL_DESTDIR}/test_aktualizr_deb_and_update.sh"
cp -rf "${GITREPO_ROOT}/tests/test_data/fake_root" "${TEST_INSTALL_DESTDIR}"

git -C "${GITREPO_ROOT}" fetch --unshallow || true
Expand Down
2 changes: 1 addition & 1 deletion scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ if [[ $TEST_WITH_INSTALL_DEB_PACKAGES = 1 ]]; then
make package -j8 || add_failure "make package"

# install garage-deploy
cp ./*garage_deploy.deb "${TEST_INSTALL_DESTDIR}"
cp ./*garage_deploy.deb "${TEST_INSTALL_DESTDIR}/garage_deploy.deb"

# install aktualizr.deb
cp ./*aktualizr.deb "${TEST_INSTALL_DESTDIR}/aktualizr.deb"
Expand Down
2 changes: 1 addition & 1 deletion scripts/test_aktualizr_deb_ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ IMG_TAG=aktualizr-deb-$(cat /proc/sys/kernel/random/uuid)
echo "Building docker for testing aktualizr deb package inside it."
docker build -t "${IMG_TAG}" -f Dockerfile.test-install.xenial .
echo "Running docker container with aktualizr debian package inside."
docker run --rm -v "${PKG_SRCDIR}":/persistent -t "${IMG_TAG}"
docker run --rm -v "${PKG_SRCDIR}":/persistent -t "${IMG_TAG}" /scripts/test_install_aktualizr_and_update.sh
4 changes: 2 additions & 2 deletions scripts/test_garage_deploy_deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ PKG_SRCDIR="${1:-/persistent}"
IMG_TAG=garage-deploy-$(cat /proc/sys/kernel/random/uuid)

echo "Building docker for testing garage-deploy deb package inside it."
docker build -t "${IMG_TAG}" -f Dockerfile.garage-deploy.deb-stable .
docker build -t "${IMG_TAG}" -f Dockerfile.test-install.xenial .
echo "Running docker container with garage-deploy debian package inside."
docker run --rm -v "${PKG_SRCDIR}":/persistent -t "${IMG_TAG}"
docker run --rm -v "${PKG_SRCDIR}":/persistent -t "${IMG_TAG}" /scripts/test_install_garage_deploy.sh
7 changes: 7 additions & 0 deletions scripts/test_install_garage_deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#! /bin/bash

set -exuo pipefail

dpkg -i /persistent/garage_deploy.deb
garage-deploy --version
garage-sign --help
2 changes: 1 addition & 1 deletion src/libaktualizr/crypto/crypto_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
#include <boost/filesystem.hpp>

#include "crypto/crypto.h"
#include "crypto/p11engine.h"
#include "storage/fsstorage.h"
#include "utilities/utils.h"

#ifdef BUILD_P11
#include "crypto/p11engine.h"
#ifndef TEST_PKCS11_MODULE_PATH
#define TEST_PKCS11_MODULE_PATH "/usr/local/softhsm/libsofthsm2.so"
#endif
Expand Down
1 change: 0 additions & 1 deletion src/libaktualizr/crypto/keymanager_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include "utilities/utils.h"

#ifdef BUILD_P11
#include "crypto/p11engine.h"
#ifndef TEST_PKCS11_MODULE_PATH
#define TEST_PKCS11_MODULE_PATH "/usr/local/softhsm/libsofthsm2.so"
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/libaktualizr/uptane/uptane_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include <boost/filesystem.hpp>

#include "crypto/p11engine.h"
#include "httpfake.h"
#include "logging/logging.h"
#include "primary/initializer.h"
Expand All @@ -20,7 +21,6 @@
#include "utilities/utils.h"

#ifdef BUILD_P11
#include "crypto/p11engine.h"
#ifndef TEST_PKCS11_MODULE_PATH
#define TEST_PKCS11_MODULE_PATH "/usr/local/softhsm/libsofthsm2.so"
#endif
Expand Down

0 comments on commit e48e061

Please sign in to comment.