diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..b28bd93 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,28 @@ +before_script: + - export VERSION=1.0.0 + - chmod +x packaging/build-package.sh packaging/package-upload.sh + +stages: + - build + - package + +build: + image: node:latest + script: + - npm install + - npm run build + artifacts: + paths: + - dist + +package: + stage: package + only: + - master + image: tystuyfzand/fpm + script: + - packaging/build-package.sh + - packaging/package-upload.sh + artifacts: + paths: + - build diff --git a/package.json b/package.json index 655dedf..eee01e5 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "bootstrap": "^4.0.0-beta.2", "bootstrap-vue": "^1.3.0", "event-emitter": "^0.3.5", + "jquery": "^3.2.1", "tiny-emitter": "^2.0.2", "util.inherits": "^1.0.3", "vue": "^2.4.2", diff --git a/packaging/arm.conf b/packaging/arm.conf new file mode 100644 index 0000000..dc4f77c --- /dev/null +++ b/packaging/arm.conf @@ -0,0 +1,7 @@ +server { + root /var/www/arm-web; + + location / { + try_files $uri $uri/ =404; + } +} diff --git a/packaging/build-package.sh b/packaging/build-package.sh new file mode 100644 index 0000000..6b3fcf0 --- /dev/null +++ b/packaging/build-package.sh @@ -0,0 +1,10 @@ +fpm -s dir -t deb -p build/arm-web_$VERSION.deb \ + -n arm-web -v $VERSION \ + --deb-priority optional --force \ + --deb-compression bzip2 \ + --description "Automatic Ripping Machine Web Interface" \ + -m "cats " --vendor "Meow.tf" \ + --depends nginx \ + --url "https://meow.tf" \ + packaging/arm.conf=/etc/nginx/conf.d/arm.conf \ + dist/=/var/www/arm-web diff --git a/packaging/package-upload.sh b/packaging/package-upload.sh new file mode 100644 index 0000000..05a46f5 --- /dev/null +++ b/packaging/package-upload.sh @@ -0,0 +1 @@ +curl -X POST "$UPLOAD_URL" -F "file=@build/arm-web_$VERSION.deb"