Changes to propagate errors in package build.
This commit is contained in:
parent
f67a247252
commit
c2d04d51b1
6 changed files with 49 additions and 14 deletions
|
@ -6,6 +6,8 @@
|
|||
# Debian Packaging Script
|
||||
# Currently Intended to build on ubuntu14.04
|
||||
|
||||
set -e
|
||||
|
||||
SOURCE="${BASH_SOURCE[0]}"
|
||||
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
|
||||
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
|
||||
|
@ -21,21 +23,25 @@ if [ "$UNAME" != "Linux" ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
REPO_ROOT=$(readlink -f $DIR/../..)
|
||||
PACKAGING_ROOT=$REPO_ROOT/packaging/debian
|
||||
PACKAGING_ROOT=$REPOROOT/packaging/debian
|
||||
|
||||
OUTPUT_DIR="$REPO_ROOT/artifacts"
|
||||
OUTPUT_DIR="$REPOROOT/artifacts"
|
||||
PACKAGE_LAYOUT_DIR="$OUTPUT_DIR/deb_intermediate"
|
||||
PACKAGE_OUTPUT_DIR="$OUTPUT_DIR/packages/debian"
|
||||
REPO_BINARIES_DIR="$REPO_ROOT/artifacts/ubuntu.14.04-x64/stage2"
|
||||
TEST_STAGE_DIR="$PACKAGE_OUTPUT_DIR/test"
|
||||
REPO_BINARIES_DIR="$REPOROOT/artifacts/ubuntu.14.04-x64/stage2"
|
||||
|
||||
execute(){
|
||||
execute_build(){
|
||||
create_empty_debian_layout
|
||||
copy_files_to_debian_layout
|
||||
create_debian_package
|
||||
test_debian_package
|
||||
}
|
||||
|
||||
execute_test(){
|
||||
test_debian_package
|
||||
}
|
||||
|
||||
create_empty_debian_layout(){
|
||||
header "Creating empty debian package layout"
|
||||
|
||||
|
@ -69,15 +75,30 @@ create_debian_package(){
|
|||
test_debian_package(){
|
||||
header "Testing debian package"
|
||||
|
||||
git clone https://github.com/sstephenson/bats.git /tmp/bats
|
||||
pushd /tmp/bats
|
||||
./install.sh /usr/local
|
||||
popd
|
||||
git clone https://github.com/sstephenson/bats.git $TEST_STAGE_DIR
|
||||
|
||||
$TEST_STAGE_DIR/bin/bats $PACKAGE_OUTPUT_DIR/test_package.bats
|
||||
|
||||
bats $PACKAGE_OUTPUT_DIR/test_package.bats
|
||||
# E2E Testing of package surface area
|
||||
run_e2e_test
|
||||
}
|
||||
|
||||
execute
|
||||
run_e2e_test(){
|
||||
set +e
|
||||
sudo dpkg -i $DEBIAN_FILE
|
||||
$REPOROOT/scripts/test/e2e-test.sh
|
||||
result=$?
|
||||
sudo dpkg -r dotnet
|
||||
set -e
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
execute_build
|
||||
|
||||
DEBIAN_FILE=$(find $PACKAGE_OUTPUT_DIR -iname "*.deb")
|
||||
$DIR/../publish/publish.sh $DEBIAN_FILE
|
||||
|
||||
execute_test
|
||||
|
||||
# Publish
|
||||
$REPOROOT/scripts/publish/publish.sh $DEBIAN_FILE
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
#
|
||||
|
||||
set -e
|
||||
|
||||
SOURCE="${BASH_SOURCE[0]}"
|
||||
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
|
||||
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue