From 2231735593a98a1216c1e9bf9e09ccddb1100e42 Mon Sep 17 00:00:00 2001 From: nrb <freifunk@nicoboehr.de> Date: Sun, 23 May 2021 23:34:42 +0200 Subject: [PATCH] ci: move setup of download cache to default This will enable the download cache in the package stage, which currently spends a lot of time with downloading things. --- .gitlab-ci.yml | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6c404f68c..d03e045a1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,8 +10,27 @@ stages: - build - package +defaults: + before_script: + - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )' + - eval $(ssh-agent -s) + - ssh-add <(echo "$GIT_SSH_PRIV_KEY") + - git config --global user.email "firmware@freifunk-stuttgart.de" + - git config --global user.name "FFS Buildbot" + - mkdir -p ~/.ssh + - cat gitlab-known-hosts >> ~/.ssh/known_hosts + - test -d ffs-openwrt-dl-cache || git clone ssh://git@gitlab.freifunk-stuttgart.de:22220/firmware/ffs-openwrt-dl-cache.git + - git -C ffs-openwrt-dl-cache pull + - rm -rf gluon/openwrt/dl && mkdir -p gluon/openwrt && ln -s ../../ffs-openwrt-dl-cache gluon/openwrt/dl + - rm -rf gluon/openwrt/staging_dir && mkdir -p staging_dir && ln -s ../../staging_dir gluon/openwrt/staging_dir + script: + - make -C gluon GLUON_SITEDIR="$CI_PROJECT_DIR" GLUON_TARGET="$GLUON_TARGET" GLUON_BRANCH=stable FFS_BUILD_DATE=$(cat build.date) BROKEN="$BROKEN" V=1 -j`nproc` + - cd gluon/openwrt/dl && git add . && git commit -m "update DL cache" && git push || true + generate_date: stage: generate_date + before_script: + - echo dummy script: - date '+%Y-%m-%d' > build.date artifacts: @@ -34,21 +53,6 @@ update: .target: stage: build - before_script: - - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )' - - eval $(ssh-agent -s) - - ssh-add <(echo "$GIT_SSH_PRIV_KEY") - - git config --global user.email "firmware@freifunk-stuttgart.de" - - git config --global user.name "FFS Buildbot" - - mkdir -p ~/.ssh - - cat gitlab-known-hosts >> ~/.ssh/known_hosts - - test -d ffs-openwrt-dl-cache || git clone ssh://git@gitlab.freifunk-stuttgart.de:22220/firmware/ffs-openwrt-dl-cache.git - - git -C ffs-openwrt-dl-cache pull - - rm -rf gluon/openwrt/dl && mkdir -p gluon/openwrt && ln -s ../../ffs-openwrt-dl-cache gluon/openwrt/dl - - rm -rf gluon/openwrt/staging_dir && mkdir -p staging_dir && ln -s ../../staging_dir gluon/openwrt/staging_dir - script: - - make -C gluon GLUON_SITEDIR="$CI_PROJECT_DIR" GLUON_TARGET="$GLUON_TARGET" GLUON_BRANCH=stable FFS_BUILD_DATE=$(cat build.date) BROKEN="$BROKEN" V=1 -j`nproc` - - cd gluon/openwrt/dl && git add . && git commit -m "update DL cache" && git push || true except: - tags artifacts: -- GitLab