diff options
author | Daniel Firth <dan.firth@codethink.co.uk> | 2016-10-10 16:43:11 +0100 |
---|---|---|
committer | Daniel Firth <dan.firth@codethink.co.uk> | 2016-11-29 15:22:35 +0000 |
commit | fdfcc3022ea6de5cc400c0fbf81aa1b2e81b3283 (patch) | |
tree | bd7ae0839c1e178e1be7f74a9d533087f4dcede3 | |
parent | 12f1dddd2e05aba96423f1e8dba391619bc58a2e (diff) | |
download | ybd-lc/staging/py3.5.2/future.tar.gz |
Update ci to py3 with onbuild docker, guard against 3.5.2 or lower.lc/staging/py3.5.2/future
-rw-r--r-- | .gitlab-ci.yml | 9 | ||||
-rwxr-xr-x | install_dependencies.sh | 25 | ||||
-rwxr-xr-x | ybd/__main__.py | 5 |
3 files changed, 29 insertions, 10 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 10dec18..b8fb352 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ -image: devcurmudgeon/foo +image: python:3.6-onbuild before_script: - sh ./install_dependencies.sh @@ -24,11 +24,10 @@ cache_keys_v1: YBD_artifact_version: "1" YBD_mode: "keys-only" script: - - cd .. - git clone git://git.baserock.org/baserock/baserock/definitions - cd definitions - git checkout baserock-14.40 - - ../ybd/ybd.py ci x86_64 + - python3 ../ybd.py ci x86_64 - echo ci.b9de86669ce182e60e3f9445e6394b478b67a2c73b4c0764491c158c5f2569e9 > expected.result - diff expected.result ybd.result @@ -52,7 +51,7 @@ check_build: YBD_check_definitions: "exit" script: - git clone git://git.baserock.org/baserock/baserock/definitions - - ./ybd.py definitions/systems/minimal-system-x86_64-generic.morph x86_64 + - python3 ./ybd.py definitions/systems/minimal-system-x86_64-generic.morph x86_64 check_build_no_kbas: stage: build @@ -61,4 +60,4 @@ check_build_no_kbas: YBD_kbas_url: "false-url" script: - git clone git://git.baserock.org/baserock/baserock/definitions - - ./ybd.py definitions/strata/build-essential.morph x86_64 + - python3 ./ybd.py definitions/systems/minimal-system-x86_64-generic.morph x86_64 diff --git a/install_dependencies.sh b/install_dependencies.sh index 1a4c6a2..af92859 100755 --- a/install_dependencies.sh +++ b/install_dependencies.sh @@ -32,7 +32,7 @@ installed=false which apt-get 2>&1 > /dev/null if [ $? -eq 0 ]; then $SUDO apt-get -qq update - $SUDO apt-get -qq install build-essential gawk git m4 wget + $SUDO apt-get -qq install build-essential gawk git m4 wget python3 if [ $? -ne 0 ]; then echo "Install failed" exit 1 @@ -43,7 +43,7 @@ fi # install for fedora which dnf 2>&1 > /dev/null if [ $? -eq 0 ] && [ $installed = false ]; then - $SUDO dnf install -y which make automake gcc gcc-c++ gawk git m4 wget python + $SUDO dnf install -y which make automake gcc gcc-c++ gawk git m4 wget python3 if [ $? -ne 0 ]; then echo "Install failed" exit 1 @@ -54,7 +54,7 @@ fi # install for aws which yum 2>&1 > /dev/null if [ $? -eq 0 ] && [ $installed = false ]; then - $SUDO yum install -y which make automake gcc gcc-c++ gawk git m4 wget python + $SUDO yum install -y which make automake gcc gcc-c++ gawk git m4 wget python3 if [ $? -ne 0 ]; then echo "Install failed" exit 1 @@ -65,7 +65,22 @@ fi # install for Arch which pacman 2>&1 > /dev/null if [ $? -eq 0 ] && [ $installed = false ]; then - $SUDO pacman -S --noconfirm which make automake gcc gawk git m4 wget python2 + $SUDO pacman -S --noconfirm which make automake gcc gawk git m4 wget python3 + if [ $? -ne 0 ]; then + echo "Install failed" + exit 1 + fi + installed=true +fi + +# install for Alpine +which apk 2>&1 > /dev/null +if [ $? -eq 0 ] && [ $installed = false ]; then + $SUDO apk add --update gcc gawk git m4 wget which make + $SUDO apk --no-cache add ca-certificates + $SUDO wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://raw.githubusercontent.com/sgerrand/alpine-pkg-glibc/master/sgerrand.rsa.pub + $SUDO wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.23-r3/glibc-2.23-r3.apk + $SUDO apk add glibc-2.23-r3.apk if [ $? -ne 0 ]; then echo "Install failed" exit 1 @@ -78,7 +93,7 @@ if [ $installed = false ]; then exit 1 fi -pip --version 2>&1 > /dev/null +pip3 --version 2>&1 > /dev/null if [ $? -ne 0 ]; then wget https://bootstrap.pypa.io/get-pip.py chmod +x get-pip.py diff --git a/ybd/__main__.py b/ybd/__main__.py index 59d5f83..a5a3e0f 100755 --- a/ybd/__main__.py +++ b/ybd/__main__.py @@ -31,6 +31,11 @@ import sandboxlib import yaml +if sys.version_info < (3, 5, 2): + log("ERROR", "Due to a bug in shutil.make_archive(), YBD requires " + "Python 3.5.2 or above to continue.", exit=True) + + def write_cache_key(): with open(config['result-file'], 'w') as f: f.write(target['cache'] + '\n') |