From 62e29abc5b2919870b7474bd2b3e732eacc4287a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6=20=28skjnldsv=29?= Date: Wed, 6 Jun 2018 18:02:43 +0200 Subject: [PATCH] Add vue apps build tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- .drone.yml | 8 ++++++++ build/vue-builds.sh | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100755 build/vue-builds.sh diff --git a/.drone.yml b/.drone.yml index f31d948f66..94598121c8 100644 --- a/.drone.yml +++ b/.drone.yml @@ -14,6 +14,13 @@ pipeline: when: matrix: TESTS: jsunit + vue-builds: + image: node + commands: + - ./build/vue-builds.sh + when: + matrix: + TESTS: vue-builds checkers: image: nextcloudci/php7.0:php7.0-19 commands: @@ -662,6 +669,7 @@ pipeline: matrix: include: - TESTS: checkers + - TESTS: vue-builds - TESTS: nodb-codecov ENABLE_REDIS: true - TESTS: db-codecov diff --git a/build/vue-builds.sh b/build/vue-builds.sh new file mode 100755 index 0000000000..39331e9227 --- /dev/null +++ b/build/vue-builds.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +declare -a apps=("./settings/js/main.js" "./apps/updatenotification/js/merged.js") +root=$(pwd) + +for i in "${apps[@]}" +do + entryFile=$i + backupFile="$entryFile.orig" + path=$(dirname "$entryFile") + + # Backup original file + echo "Backing up $entryFile to $backupFile" + cp $entryFile $backupFile + + # Make the app + cd "$path/../" + make + + # Reset + cd $root + + # Compare build files + echo "Comparing $entryFile to the original" + if ! diff -q $entryFile $backupFile &>/dev/null + then + echo "$entryFile build is NOT up-to-date! Please send the proper production build within the pull request" + cat /root/.npm/_logs/*.log + exit 2 + else + echo "$entryFile build is up-to-date" + fi +done