Skip to content
Snippets Groups Projects
Commit 6ba673f2 authored by Nico's avatar Nico
Browse files

ci: cache openwrt staging_dir outside openwrt directory

Previously, we've cached staging_dir in the gluon/openwrt subdirectory.
But this doesn't really work properly because of gitlab's submodule
behaviour. It will first extract the cache and then update the
submodules.

Because the cached directory resides inside the gluon submodule, it will
be deleted upon submodule checkout. By putting the cache in a directory
outside the submodule we can avoid this. We will then simply symlink the
cached directory to the desired destination such that it is found during
the build.
parent 09ac18ea
No related branches found
No related tags found
No related merge requests found
...@@ -41,6 +41,7 @@ update: ...@@ -41,6 +41,7 @@ update:
- test -d ffs-openwrt-dl-cache || git clone ssh://git@gitlab.freifunk-stuttgart.de:22220/firmware/ffs-openwrt-dl-cache.git - 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 - 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/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: script:
- make -C gluon GLUON_SITEDIR="$CI_PROJECT_DIR" GLUON_TARGET="$GLUON_TARGET" GLUON_BRANCH=stable FFS_BUILD_DATE=$(cat build.date) V=1 -j`nproc` - make -C gluon GLUON_SITEDIR="$CI_PROJECT_DIR" GLUON_TARGET="$GLUON_TARGET" GLUON_BRANCH=stable FFS_BUILD_DATE=$(cat build.date) V=1 -j`nproc`
- cd gluon/openwrt/dl && git add . && git commit -m "update DL cache" && git push || true - cd gluon/openwrt/dl && git add . && git commit -m "update DL cache" && git push || true
...@@ -53,7 +54,7 @@ update: ...@@ -53,7 +54,7 @@ update:
cache: cache:
paths: paths:
- ffs-openwrt-dl-cache - ffs-openwrt-dl-cache
- gluon/openwrt/staging_dir - staging_dir
key: "build-$CI_COMMIT_REF_SLUG" key: "build-$CI_COMMIT_REF_SLUG"
target:ar71xx-generic: target:ar71xx-generic:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment