stages:
- pre-build
- test
+ - deploy
check HTML, JS, CSS with eslint and prettier:
stage: pre-build
stage: pre-build
image: cyb3rjak3/html5validator:latest
script:
- - html5validator --root www --also-check-css --also-check-svg --show-warnings --log INFO
+ - html5validator --root www --also-check-css --show-warnings --log INFO
.build python:
stage: pre-build
variables:
CI_PYTHON_VERSION: "3.8"
-test site with selenium:
+.build site:
+ stage: pre-build
+ image: debian:9
+ before_script:
+ - apt-get update; apt-get install -y make python3 ca-certificates git
+ artifacts:
+ expire_in: 1 week
+ when: always
+ paths:
+ - build
+
+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:
stage: test
image: selenium/standalone-firefox:latest
script:
- (cd build; python3 -m http.server &)
- pytest-3 tests
-build site for target environment:
- stage: test
- image: debian:9
+test scraped site with selenium:
+ extends: .test site
+ dependencies:
+ - build site for target environment using scrape method
+
+test scaned site with selenium:
+ extends: .test site
+ dependencies:
+ - build site for target environment using scan method
+
+.deploy:
+ stage: deploy
+ image: alpine
+ dependencies:
+ - build site for target environment using scrape method
before_script:
- - apt-get update; apt-get install -y make python3
+ - apk update && apk add rsync
+ only:
+ - master
script:
- - cp -R ./www ./build
- - misc/collect.py scrape https://downloads.openwrt.org build
+ - rsync -rlptvz build/ "rsync://firmware_selector@mirror-02.infra.openwrt.org/$RSYNC_TARGET/www/"
+
+deploy to firmware-selector.staging.openwrt.org:
+ extends: .deploy
+ variables:
+ RSYNC_TARGET: firmware-selector-staging-upload
+
+deploy to firmware-selector.openwrt.org:
+ extends: .deploy
+ variables:
+ RSYNC_TARGET: firmware-selector-upload
+ when: manual
+ before_script:
+ - apk update && apk add rsync