@cryptotaxi247 / netdata-1 / commits / 07e67c4b6

Fix Travis CI builds and skip Fedora 31 i386 build/test cycles (#9781)

* Fix Travis CI builds and skip Fedora 31 i386 build/test cycles * Fix lint and address @Ferroin's feedback

James Mills committed Aug 20, 2020 at 08:47 UTC 07e67c4b62b100ab048070f1a0291fe904ff7513
1 file changed +61 -56
.travis/package_management/create_lxc_for_build.sh
+61 -56
@@ -2,7 +2,7 @@
2 #
3 # This script generates an LXC container and starts it up
4 # Once the script completes successfully, a container has become available for usage
5 -# The container image to be used and the container name to be set, are part of variables
5 +# The container image to be used and the container name to be set, are part of variables
6 # that must be present for the script to work
7 #
8 # Copyright: SPDX-License-Identifier: GPL-3.0-or-later
@@ -17,85 +17,90 @@ source .travis/package_management/functions.sh || (echo "Failed to load packagin
17 TOP_LEVEL=$(basename "$(git rev-parse --show-toplevel)")
18 CWD=$(git rev-parse --show-cdup)
19 if [ -n "$CWD" ] || [ ! "${TOP_LEVEL}" == "netdata" ]; then
20 - echo "Run as .travis/package_management/$(basename "$0") from top level directory of netdata git repository"
21 - echo "LXC Container creation aborted"
22 - exit 1
20 + echo "Run as .travis/package_management/$(basename "$0") from top level directory of netdata git repository"
21 + echo "LXC Container creation aborted"
22 + exit 1
23 fi
24
25 # Check for presence of mandatory environment variables
26 if [ -z "${BUILD_STRING}" ]; then
27 - echo "No Distribution was defined. Make sure BUILD_STRING is set on the environment before running this script"
28 - exit 1
27 + echo "No Distribution was defined. Make sure BUILD_STRING is set on the environment before running this script"
28 + exit 1
29 fi
30
31 if [ -z "${BUILDER_NAME}" ]; then
32 - echo "No builder account and container name defined. Make sure BUILDER_NAME is set on the environment before running this script"
33 - exit 1
32 + echo "No builder account and container name defined. Make sure BUILDER_NAME is set on the environment before running this script"
33 + exit 1
34 fi
35
36 if [ -z "${BUILD_DISTRO}" ]; then
37 - echo "No build distro information defined. Make sure BUILD_DISTRO is set on the environment before running this script"
38 - exit 1
37 + echo "No build distro information defined. Make sure BUILD_DISTRO is set on the environment before running this script"
38 + exit 1
39 fi
40
41 if [ -z "${BUILD_RELEASE}" ]; then
42 - echo "No build release information defined. Make sure BUILD_RELEASE is set on the environment before running this script"
43 - exit 1
42 + echo "No build release information defined. Make sure BUILD_RELEASE is set on the environment before running this script"
43 + exit 1
44 fi
45
46 if [ -z "${PACKAGE_TYPE}" ]; then
47 - echo "No build release information defined. Make sure PACKAGE_TYPE is set on the environment before running this script"
48 - exit 1
47 + echo "No build release information defined. Make sure PACKAGE_TYPE is set on the environment before running this script"
48 + exit 1
49 fi
50
51 # Detect architecture and load extra variables needed
52 detect_arch_from_commit
53
54 +if [ x"${BUILDER_NAME}/${BUILD_STRING}/${BUILD_ARCH}" = x"builder/fedora/31/i386" ]; then
55 + echo " Skipping Fedora 31 i386 build (non-existent upstream) ..."
56 + exit 0
57 +fi
58 +
59 echo "Creating LXC container ${BUILDER_NAME}/${BUILD_STRING}/${BUILD_ARCH}...."
60
61 case "${BUILD_ARCH}" in
57 -"all")
58 - # i386
59 - echo "Creating LXC Container for i386.."
60 - export CONTAINER_NAME="${BUILDER_NAME}-${BUILD_DISTRO}${BUILD_RELEASE}-i386"
61 - export LXC_CONTAINER_ROOT="/var/lib/lxc/${CONTAINER_NAME}/rootfs"
62 - lxc-create -n "${CONTAINER_NAME}" -t "download" -- --dist "${BUILD_DISTRO}" --release "${BUILD_RELEASE}" --arch "i386" --no-validate
63 -
64 - echo "Container(s) ready. Configuring container(s).."
65 - .travis/package_management/configure_${PACKAGE_TYPE}_lxc_environment.py "${CONTAINER_NAME}"
66 -
67 - # amd64
68 - echo "Creating LXC Container for amd64.."
69 - export CONTAINER_NAME="${BUILDER_NAME}-${BUILD_DISTRO}${BUILD_RELEASE}-amd64"
70 - export LXC_CONTAINER_ROOT="/var/lib/lxc/${CONTAINER_NAME}/rootfs"
71 - lxc-create -n "${CONTAINER_NAME}" -t "download" -- --dist "${BUILD_DISTRO}" --release "${BUILD_RELEASE}" --arch "amd64" --no-validate
72 -
73 - echo "Container(s) ready. Configuring container(s).."
74 - .travis/package_management/configure_${PACKAGE_TYPE}_lxc_environment.py "${CONTAINER_NAME}"
75 -
76 - # arm64
77 - echo "Creating LXC Container for arm64.."
78 - export CONTAINER_NAME="${BUILDER_NAME}-${BUILD_DISTRO}${BUILD_RELEASE}-arm64"
79 - export LXC_CONTAINER_ROOT="/var/lib/lxc/${CONTAINER_NAME}/rootfs"
80 - lxc-create -n "${CONTAINER_NAME}" -t "download" -- --dist "${BUILD_DISTRO}" --release "${BUILD_RELEASE}" --arch "arm64" --no-validate
81 -
82 - echo "Container(s) ready. Configuring container(s).."
83 - .travis/package_management/configure_${PACKAGE_TYPE}_lxc_environment.py "${CONTAINER_NAME}"
84 - ;;
85 -"i386"|"amd64"|"arm64")
86 - # amd64 or i386
87 - echo "Creating LXC Container for ${BUILD_ARCH}.."
88 - export CONTAINER_NAME="${BUILDER_NAME}-${BUILD_DISTRO}${BUILD_RELEASE}-${BUILD_ARCH}"
89 - export LXC_CONTAINER_ROOT="/var/lib/lxc/${CONTAINER_NAME}/rootfs"
90 - lxc-create -n "${CONTAINER_NAME}" -t "download" -- --dist "${BUILD_DISTRO}" --release "${BUILD_RELEASE}" --arch "${BUILD_ARCH}" --no-validate
91 -
92 - echo "Container(s) ready. Configuring container(s).."
93 - .travis/package_management/configure_${PACKAGE_TYPE}_lxc_environment.py "${CONTAINER_NAME}"
94 - ;;
95 -*)
96 - echo "Unknown BUILD_ARCH value '${BUILD_ARCH}' given, process failed"
97 - exit 1
98 - ;;
62 + "all")
63 + # i386
64 + echo "Creating LXC Container for i386.."
65 + export CONTAINER_NAME="${BUILDER_NAME}-${BUILD_DISTRO}${BUILD_RELEASE}-i386"
66 + export LXC_CONTAINER_ROOT="/var/lib/lxc/${CONTAINER_NAME}/rootfs"
67 + lxc-create -n "${CONTAINER_NAME}" -t "download" -- --dist "${BUILD_DISTRO}" --release "${BUILD_RELEASE}" --arch "i386" --no-validate
68 +
69 + echo "Container(s) ready. Configuring container(s).."
70 + .travis/package_management/configure_${PACKAGE_TYPE}_lxc_environment.py "${CONTAINER_NAME}"
71 +
72 + # amd64
73 + echo "Creating LXC Container for amd64.."
74 + export CONTAINER_NAME="${BUILDER_NAME}-${BUILD_DISTRO}${BUILD_RELEASE}-amd64"
75 + export LXC_CONTAINER_ROOT="/var/lib/lxc/${CONTAINER_NAME}/rootfs"
76 + lxc-create -n "${CONTAINER_NAME}" -t "download" -- --dist "${BUILD_DISTRO}" --release "${BUILD_RELEASE}" --arch "amd64" --no-validate
77 +
78 + echo "Container(s) ready. Configuring container(s).."
79 + .travis/package_management/configure_${PACKAGE_TYPE}_lxc_environment.py "${CONTAINER_NAME}"
80 +
81 + # arm64
82 + echo "Creating LXC Container for arm64.."
83 + export CONTAINER_NAME="${BUILDER_NAME}-${BUILD_DISTRO}${BUILD_RELEASE}-arm64"
84 + export LXC_CONTAINER_ROOT="/var/lib/lxc/${CONTAINER_NAME}/rootfs"
85 + lxc-create -n "${CONTAINER_NAME}" -t "download" -- --dist "${BUILD_DISTRO}" --release "${BUILD_RELEASE}" --arch "arm64" --no-validate
86 +
87 + echo "Container(s) ready. Configuring container(s).."
88 + .travis/package_management/configure_${PACKAGE_TYPE}_lxc_environment.py "${CONTAINER_NAME}"
89 + ;;
90 + "i386" | "amd64" | "arm64")
91 + # amd64 or i386
92 + echo "Creating LXC Container for ${BUILD_ARCH}.."
93 + export CONTAINER_NAME="${BUILDER_NAME}-${BUILD_DISTRO}${BUILD_RELEASE}-${BUILD_ARCH}"
94 + export LXC_CONTAINER_ROOT="/var/lib/lxc/${CONTAINER_NAME}/rootfs"
95 + lxc-create -n "${CONTAINER_NAME}" -t "download" -- --dist "${BUILD_DISTRO}" --release "${BUILD_RELEASE}" --arch "${BUILD_ARCH}" --no-validate
96 +
97 + echo "Container(s) ready. Configuring container(s).."
98 + .travis/package_management/configure_${PACKAGE_TYPE}_lxc_environment.py "${CONTAINER_NAME}"
99 + ;;
100 + *)
101 + echo "Unknown BUILD_ARCH value '${BUILD_ARCH}' given, process failed"
102 + exit 1
103 + ;;
104 esac
105
106 echo "..LXC creation complete!"