diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b586ebc..b6a2991 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,75 +10,25 @@ variables: stages: - prepare - build + - torrent services: - docker:dind +before_script: + - docker info + - apk add --no-cache make openssh-client + dockerimage: stage: prepare - before_script: - - docker info - - apk add --no-cache make openssh-client script: - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY - - docker pull $DOCKER_IMAGE || true - make dockerimg - docker push $DOCKER_IMAGE tags: - fablab -aria2c: - stage: prepare - image: debian:stretch-slim - script: - - apt-get update - - apt-get -y install clang automake autoconf git make autopoint libtool pkg-config ccache wget jq - - aria2_tag="$(wget -q -O- https://api.github.com/repos/aria2/aria2/releases/latest|jq -r '.tag_name')" - - git clone -q -b "$aria2_tag" --depth 1 https://github.com/aria2/aria2 aria2 - - export CCACHE_DIR=${PWD}/ccache - - cd aria2 - - mkdir -p ccache - - export CCACHE_BASEDIR=${PWD} - - autoreconf -i - - automake - - autoconf - - export CXX="clang++ -Qunused-arguments -Wl,-s" CC="clang -Qunused-arguments -Wl,-s" - - > - ./configure - --disable-ssl - --disable-metalink - --disable-websocket - --disable-epoll - --disable-largefile - --disable-nls - --disable-rpath - --without-libnettle - --without-libgmp - --without-libgcrypt - --without-openssl - --without-sqlite3 - --without-libxml3 - --without-libexpat - --without-libcares - --without-libz - --without-libssh2 - ARIA2_STATIC=yes - - make CC="ccache $CC" CXX="ccache $CXX" - - mv src/aria2c .. - cache: - paths: - - ccache - artifacts: - paths: - - aria2c - expire_in: 2 weeks - tags: - - fablab - .squashfs_template: &squashfs_template - before_script: - - docker info - - apk add --no-cache make openssh-client stage: build script: - make images/debian-stretch.squashfs diff --git a/packer/debian-stretch.json b/packer/debian-stretch.json index 90d6df7..2587fa6 100644 --- a/packer/debian-stretch.json +++ b/packer/debian-stretch.json @@ -34,11 +34,6 @@ } ], "provisioners": [ - { - "type": "file", - "source": "aria2c", - "destination": "/usr/local/bin/aria2c" - }, { "type": "shell", "inline": [ "mkdir -p /etc/initramfs-tools/scripts/local-premount/" ] @@ -48,11 +43,6 @@ "source": "initramfs/labsync", "destination": "/etc/initramfs-tools/scripts/" }, - { - "type": "file", - "source": "initramfs/labsync-prereqs", - "destination": "/etc/initramfs-tools/scripts/local-premount/" - }, { "type": "shell", "inline": [ @@ -62,10 +52,18 @@ "echo \"LABSYNC_COMMIT_REF_NAME='{{user `ci_commit_ref_name`}}'\" >> /etc/environment", "echo \"LABSYNC_COMMIT_REF_SLUG='{{user `ci_commit_ref_slug`}}'\" >> /etc/environment", "echo \"LABSYNC_PROJECT_URL='{{user `ci_project_url`}}'\" >> /etc/environment", + "sed -i 's#@@PROJECT_URL@@#{{user `ci_project_url`}}#' /etc/initramfs-tools/scripts/labsync" + ] + }, + { + "type": "file", + "source": "initramfs/labsync-prereqs", + "destination": "/etc/initramfs-tools/scripts/local-premount/" + }, + { + "type": "shell", + "inline": [ "set -x", - "sed -i 's#@@PROJECT_URL@@#{{user `ci_project_url`}}#' /etc/initramfs-tools/scripts/labsync", - "if ! [ -d /usr/local/bin/aria2c ]; then aria2c=/usr/local/bin/aria2c; else aria2c=/usr/bin/aria2c; fi", - "sed -i \"s#@@ARIA2C@@#$aria2c#\" /etc/initramfs-tools/scripts/local-premount/labsync-prereqs", "apt-get update", "apt-get -y dist-upgrade", "rmdir /boot && ln -s /usr/local/boot /boot", @@ -101,7 +99,6 @@ "echo '/etc/resolv.conf' >> /tmp/ignore_files", "echo '/etc/hostname' >> /tmp/ignore_files", "echo '/etc/hosts' >> /tmp/ignore_files", - "echo '/usr/local/bin/aria2c' >> /tmp/ignore_files", "mkdir -p /tmp/extra/tmp /tmp/extra/proc /tmp/extra/sys /tmp/extra/etc" ] }, diff --git a/packer/initramfs/labsync-prereqs b/packer/initramfs/labsync-prereqs index c981f00..120cd77 100755 --- a/packer/initramfs/labsync-prereqs +++ b/packer/initramfs/labsync-prereqs @@ -8,7 +8,7 @@ case $1 in . /usr/share/initramfs-tools/hook-functions copy_exec /sbin/mke2fs copy_exec /sbin/e2fsck - copy_exec @@ARIA2C@@ + copy_exec /usr/bin/aria2c copy_exec /sbin/sfdisk copy_file cert /etc/ssl/certs/ca-certificates.crt exit 0