mirror of
https://github.com/heyarne/airsonic-ui.git
synced 2026-05-06 10:23:39 +02:00
Set up continuous deployment (#70)
* Add build step to circleci config * Add deploy job to circleci * Configure test → build → deploy as a cascade and ensure `public` exists when building * Add deploy key * Deploy only on master * Remove ssh keys from build step * Remove travis-ci * Move build-report into task and update README.md
This commit is contained in:
parent
c3d97e3235
commit
6e17c254c7
5 changed files with 81 additions and 865 deletions
|
|
@ -1,4 +1,5 @@
|
|||
version: 2
|
||||
|
||||
jobs:
|
||||
test:
|
||||
working_directory: ~/repo
|
||||
|
|
@ -11,19 +12,86 @@ jobs:
|
|||
- restore_cache:
|
||||
keys:
|
||||
- build_cache-{{ checksum "package.json" }}-{{ checksum "shadow-cljs.edn" }}
|
||||
- run: npm install
|
||||
- run: npm run test
|
||||
- run:
|
||||
name: Install dependencies
|
||||
command: npm install
|
||||
- run:
|
||||
name: Test
|
||||
command: npm test
|
||||
- save_cache:
|
||||
paths:
|
||||
- node_modules
|
||||
- ~/.m2
|
||||
- ~/.npm
|
||||
key: build_cache-{{ checksum "package.json" }}-{{ checksum "shadow-cljs.edn" }}
|
||||
build:
|
||||
working_directory: ~/repo
|
||||
docker:
|
||||
- image: circleci/openjdk:11-jdk-stretch-node-browsers
|
||||
steps:
|
||||
- checkout
|
||||
- restore_cache:
|
||||
keys:
|
||||
- build_cache-{{ checksum "package.json" }}-{{ checksum "shadow-cljs.edn" }}
|
||||
- run:
|
||||
name: Install dependencies
|
||||
command: npm install
|
||||
- run:
|
||||
name: Build SPA
|
||||
command: npm run build
|
||||
- save_cache:
|
||||
paths:
|
||||
- node_modules
|
||||
- ~/.m2
|
||||
- ~/.npm
|
||||
key: build_cache-{{ checksum "package.json" }}-{{ checksum "shadow-cljs.edn" }}
|
||||
- persist_to_workspace:
|
||||
root: /home/circleci/repo/public
|
||||
paths:
|
||||
- "*"
|
||||
deploy:
|
||||
working_directory: ~/repo
|
||||
docker:
|
||||
- image: circleci/openjdk:11-jdk-stretch-node-browsers
|
||||
steps:
|
||||
- add_ssh_keys:
|
||||
fingerprints:
|
||||
- "85:2f:28:0f:b9:45:b8:f1:0f:c2:0a:1c:5e:4d:a2:06"
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: /home/circleci/repo/public
|
||||
- restore_cache:
|
||||
keys:
|
||||
- build_cache-{{ checksum "package.json" }}-{{ checksum "shadow-cljs.edn" }}
|
||||
- run:
|
||||
name: Install dependencies
|
||||
command: npm install
|
||||
- run:
|
||||
name: Deploy to gh-pages branch
|
||||
command: |
|
||||
git config user.email "build@circleci.com"
|
||||
git config user.name "ci-build"
|
||||
npm run deploy
|
||||
|
||||
workflows:
|
||||
version: 2
|
||||
test:
|
||||
test-build-deploy:
|
||||
jobs:
|
||||
- test:
|
||||
filters:
|
||||
branches:
|
||||
ignore:
|
||||
- gh-pages
|
||||
- build:
|
||||
filters:
|
||||
branches:
|
||||
ignore:
|
||||
- gh-pages
|
||||
requires:
|
||||
- test
|
||||
- deploy:
|
||||
requires:
|
||||
- build
|
||||
filters:
|
||||
branches:
|
||||
only: master
|
||||
|
|
|
|||
11
.travis.yml
11
.travis.yml
|
|
@ -1,11 +0,0 @@
|
|||
language: node_js
|
||||
node_js:
|
||||
- "10"
|
||||
- "8"
|
||||
addons:
|
||||
chrome: stable
|
||||
cache:
|
||||
directories:
|
||||
- node_modules
|
||||
- .shadow-cljs
|
||||
- $HOME/.m2
|
||||
10
README.md
10
README.md
|
|
@ -1,4 +1,4 @@
|
|||
# Airsonic Web Client [](https://travis-ci.org/heyarne/airsonic-ui) [](https://circleci.com/gh/heyarne/airsonic-ui) [](https://greenkeeper.io/)
|
||||
# Airsonic Web Client [](https://circleci.com/gh/heyarne/airsonic-ui) [](https://greenkeeper.io/)
|
||||
|
||||
This repository contains an alternative web frontend for [airsonic](https://github.com/airsonic/airsonic). The goal is to eventually be able to fully replace the current web interface.
|
||||
|
||||
|
|
@ -37,9 +37,11 @@ $ npm install
|
|||
$ npm run dev
|
||||
```
|
||||
|
||||
All other build tasks are defined in the `package.json` (more below).
|
||||
|
||||
### Editor integration
|
||||
|
||||
Integrating shadow-cljs with your editor helps tremendously with development. After having run `npm run dev` as described above you can connect to the REPL and get features like in-editor code execution and code completion / documentation lookup. For further information see [this part of the shadow-cljs user guide](https://shadow-cljs.github.io/docs/UsersGuide.html#_editor_integration), which contains instructions for Emacs, Atom, VSCode and other editors. Make sure to open `localhost:8080` in the browser to execute ClojureScript code.
|
||||
Integrating shadow-cljs with your editor helps tremendously with development. After having run `npm run dev` as described above you can connect to the REPL and get features like in-editor code execution and code completion / documentation lookup. For further information see [this part of the shadow-cljs user guide](https://shadow-cljs.github.io/docs/UsersGuide.html#_editor_integration). Recommended editors and plugins are Calva for VSCode and CIDER for Emacs (comes with Spacemacs). Make sure to open `localhost:8080` in the browser after starting the `dev:cljs` task to execute ClojureScript code in a live REPL.
|
||||
|
||||
### re-frame-10x
|
||||
|
||||
|
|
@ -66,10 +68,12 @@ $ npm test
|
|||
# build and optimize the code once for production
|
||||
$ npm run build
|
||||
|
||||
# runs npm run build and publishes everything via gh-pages
|
||||
# publishes everything via gh-pages
|
||||
$ npm run deploy
|
||||
```
|
||||
|
||||
There is continuous deployment set up on [circleci](https://circleci.com/gh/heyarne/airsonic-ui) that builds and deploys to `gh-pages` after a commit to the `master` branch.
|
||||
|
||||
**Note:** If you have a continuous build running and run `npm run build` or `npm run deploy`, it will delete the compiled tests, causing the continuous tests to not run anymore. This can be fixed by running `npm test` again.
|
||||
|
||||
All build artifacts land in `/public`. Don't change anything in there as changes will be overwritten.
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -5,11 +5,12 @@
|
|||
"main": "index.js",
|
||||
"scripts": {
|
||||
"build:cljs": "shadow-cljs release app",
|
||||
"build:cljs-report": "shadow-cljs run shadow.cljs.build-report app public/build-report.html",
|
||||
"build:sass": "node-sass --output-style compressed src/sass/app.sass | postcss -o public/app/app.css",
|
||||
"build": "rm -r public/*; run-p copy:* build:*",
|
||||
"build": "mkdir -p public; rm -r public/*; run-p copy:* build:*",
|
||||
"copy:assets": "cp -R src/assets/* public/",
|
||||
"copy:icons": "cp -R node_modules/open-iconic/font/fonts public",
|
||||
"deploy": "npm run build && gh-pages -d public -m \"Deploying $(git rev-parse --short HEAD)\"",
|
||||
"deploy": "gh-pages -d public -m \"Deploying $(git rev-parse --short HEAD)\"",
|
||||
"dev:cljs": "shadow-cljs watch app test",
|
||||
"dev:sass": "node-sass -w src/sass/app.sass -o public/app",
|
||||
"dev:test": "karma start --reporters notify,progress --auto-watch",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue