ci: populate GIT_VERSION variable in index.html v3.0.0
authorPetr Štetiar <ynezz@true.cz>
Mon, 14 Sep 2020 06:06:25 +0000 (08:06 +0200)
committerPetr Štetiar <ynezz@true.cz>
Mon, 14 Sep 2020 07:41:25 +0000 (09:41 +0200)
Signed-off-by: Petr Štetiar <ynezz@true.cz>
.gitlab-ci.yml

index fdbe77d1c6dae2084e1b8b457e594ae480926995..a9537fb042991e3fe8d071cc253d5002688daf3d 100644 (file)
@@ -52,7 +52,7 @@ build site on Python 3.8:
   stage: pre-build
   image: debian:9
   before_script:
-    - apt-get update; apt-get install -y make python3 ca-certificates
+    - apt-get update; apt-get install -y make python3 ca-certificates git
   artifacts:
     expire_in: 1 week
     when: always
@@ -63,12 +63,14 @@ build site for target environment using scrape method:
   extends: .build site
   script:
     - cp -R ./www ./build
+    - sed -i "s;%GIT_VERSION%;$(git describe --tags);" build/index.html
     - misc/collect.py scrape https://downloads.openwrt.org build
 
 build site for target environment using scan method:
   extends: .build site
   script:
     - cp -R ./www ./build
+    - sed -i "s;%GIT_VERSION%;$(git describe --tags);" build/index.html
     - misc/collect.py scan downloads.openwrt.org tests/profiles build
 
 .test site: