ci: add deploy steps
authorPetr Štetiar <ynezz@true.cz>
Mon, 14 Sep 2020 05:08:51 +0000 (07:08 +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 ab97a9d61d255ea7f9b19a60ecfd71463ce0f1c4..fdbe77d1c6dae2084e1b8b457e594ae480926995 100644 (file)
@@ -5,6 +5,7 @@ include:
 stages:
   - pre-build
   - test
+  - deploy
 
 check HTML, JS, CSS with eslint and prettier:
   stage: pre-build
@@ -89,3 +90,28 @@ 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:
+    - apk update && apk add rsync
+  only:
+    - master
+  script:
+    - 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