Add vue apps build tests

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
John Molakvoæ (skjnldsv) 2018-06-06 18:02:43 +02:00
parent 4618f17654
commit 62e29abc5b
No known key found for this signature in database
GPG Key ID: 60C25B8C072916CF
2 changed files with 41 additions and 0 deletions

View File

@ -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

33
build/vue-builds.sh Executable file
View File

@ -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