From d193240e67e18ad9ac44e5f1d2d0913a5bc77601 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Mon, 15 Mar 2021 10:59:16 +0200 Subject: fix: obnam (use less disk space) --- ci-prod-obnam.ick | 153 ++++++++++++++++++++++++++++++++++++++++----------- ci-prod-programs.ick | 2 +- 2 files changed, 123 insertions(+), 32 deletions(-) diff --git a/ci-prod-obnam.ick b/ci-prod-obnam.ick index eb11c94..de31a5d 100644 --- a/ci-prod-obnam.ick +++ b/ci-prod-obnam.ick @@ -261,6 +261,92 @@ pipelines: - pipeline: build_obnam_deb actions: + # - where: container + # shell: | + # export HOME=/workspace + # export PATH="$HOME/.cargo/bin:$PATH" + # export TMPDIR=/workspace + + # cd /workspace/src + + # apt-get install -y sudo + # adduser --disabled-password --gecos worker worker + # chown -R worker:worker /workspace + # rustup show + + # if ! sudo -u worker bash -x ./check --save-on-failure=fail.tar.gz "unreadable file" + # then + # rustc --version + # cat test.log + # tar tvf fail.tar.gz + # exit 1 + # fi + + # name="$(dpkg-parsechangelog -S Source)" + # version="$(dpkg-parsechangelog -S Version)" + # distribution="$(dpkg-parsechangelog -S Distribution)" + + # case "$version" in + # *-*) + # upstream="$(echo "$version" | sed 's/-[^-]*$//')" + # debian="$(echo "$version" | sed 's/^.*-//')" + # ;; + # *) + # upstream="$version" + # debian=0 + # ;; + # esac + + # upstream="${upstream}.ci0.${BUILD_NUMBER}" + # civersion="${upstream}-${debian}" + + # rm -f ../*_*.* + # git clean -fdx -e target + # git archive HEAD | xz > "../${name}_${upstream}.orig.tar.xz" + + # dch --no-conf -v "$civersion" -D "${distribution}-ci" --force-distribution "CI build" + + # rustc --version + # rustup default stable + # sudo -u worker rustup default stable + # sudo -u worker rustc --version + # sudo -u worker env "PATH=$PATH" dpkg-buildpackage -us -uc -sa || cat /tmp/subplot_*.diff.* 2>&1 + + # apt-get update + # apt-get install -y subplot \ + # pandoc-citeproc \ + # texlive-latex-base \ + # texlive-latex-recommended \ + # texlive-fonts-recommended \ + # plantuml + + # rm -f obnam.html obnam.pdf + # sp-docgen obnam.md -o obnam.html + # sp-docgen obnam.md -o obnam.pdf + # install -d /workspace/examples + # install -m 0644 obnam.html obnam.pdf /workspace/examples/. + + # # Build new releases. + # echo ======================================== + # echo looking for new releases to + + # # TEMPORARILY get the latest release tag + # rm -f /workspace/built_tags # FIXME + # touch /workspace/built_tags # FIXME + # python3 ./list_new_release_tags /workspace/built_tags + # tac < /workspace/built_tags | tail +2 > foo + # mv foo /workspace/built_tags + + # python3 ./list_new_release_tags /workspace/built_tags | while read tag + # do + # echo ---------------------------------------- + # echo "New release tag: $tag" + # sudo -u worker env "PATH=$PATH" bash ./build_release_deb.sh /workspace "$tag" + # echo "Finished building tag $tag" + # done + # echo ======================================== + # echo "Finished building release debs (if any)" + - where: container shell: | export HOME=/workspace @@ -271,17 +357,16 @@ pipelines: apt-get install -y sudo adduser --disabled-password --gecos worker worker + chown -R worker:worker /workspace - rustup show - rustup default 1.48.0 + sudo -u worker env "PATH=$PATH" rustup default stable + sudo -u worker env "PATH=$PATH" rustup show - if ! sudo -u worker bash -x ./check --save-on-failure=fail.tar.gz "unreadable file" - then - rustc --version - cat test.log - tar tvf fail.tar.gz - exit 1 - fi + sudo -u worker env "PATH=$PATH" rustc --version + df -h + sudo du -xhd1 / + + sudo -u worker env "PATH=$PATH" bash -x ./check name="$(dpkg-parsechangelog -S Source)" version="$(dpkg-parsechangelog -S Version)" @@ -301,13 +386,19 @@ pipelines: upstream="${upstream}.ci0.${BUILD_NUMBER}" civersion="${upstream}-${debian}" - rm -f ../*_* + rm -f ../*_*.* git clean -fdx -e target + ls -l /workspace + git archive HEAD | xz > "../${name}_${upstream}.orig.tar.xz" dch --no-conf -v "$civersion" -D "${distribution}-ci" --force-distribution "CI build" - sudo -u worker dpkg-buildpackage -us -uc -sa || cat /tmp/subplot_*.diff.* 2>&1 + rustc --version + rustup default stable + sudo -u worker env "PATH=$PATH" rustup default stable + sudo -u worker env "PATH=$PATH" rustc --version + sudo -u worker env "PATH=$PATH" dpkg-buildpackage -us -uc -sa || cat /tmp/subplot_*.diff.* 2>&1 apt-get update apt-get install -y subplot \ @@ -323,26 +414,26 @@ pipelines: install -d /workspace/examples install -m 0644 obnam.html obnam.pdf /workspace/examples/. - # Build new releases. - echo ======================================== - echo looking for new releases to - - # TEMPORARILY get the latest release tag - #rm -f /workspace/built_tags # FIXME - #touch /workspace/built_tags # FIXME - #python3 ./list_new_release_tags /workspace/built_tags - #tac < /workspace/built_tags | tail +2 > foo - #mv foo /workspace/built_tags - - python3 ./list_new_release_tags /workspace/built_tags | while read tag - do - echo ---------------------------------------- - echo "New release tag: $tag" - sudo -u worker bash ./build_release_deb.sh /workspace "$tag" - echo "Finished building tag $tag" - done - echo ======================================== - echo "Finished building release debs (if any)" + # # Build new releases. + # echo ======================================== + # echo looking for new releases to build + + # # TEMPORARILY get the latest release tag + # rm -f /workspace/built_tags # FIXME + # touch /workspace/built_tags # FIXME + # python3 ./list_new_release_tags /workspace/built_tags + # tac < /workspace/built_tags | tail +2 > foo + # mv foo /workspace/built_tags + + # python3 ./list_new_release_tags /workspace/built_tags | while read tag + # do + # echo ---------------------------------------- + # echo "New release tag: $tag" + # sudo -u worker env "PATH=$PATH" bash ./build_release_deb.sh /workspace "$tag" + # echo "Finished building tag $tag" + # done + # echo ======================================== + # echo "Finished building release debs (if any)" - action: rsync where: host diff --git a/ci-prod-programs.ick b/ci-prod-programs.ick index 8c4a751..7bb9aeb 100644 --- a/ci-prod-programs.ick +++ b/ci-prod-programs.ick @@ -600,7 +600,7 @@ projects: sources: &liw_automation_sources - name: code repo: git://git.liw.fi/liw-automation - ref: master + ref: main location: src pipelines: *deb_ci_pipelines -- cgit v1.2.1