forked from caseychu/spotify-backup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
48 lines (44 loc) · 1.53 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Official language image. Look for the different tagged releases at:
# https://hub.docker.com/r/library/python/tags/
image: python:latest
variables:
# https://docs.gitlab.com/ee/ci/pipelines/index.html#prefill-variables-in-manual-pipelines
SPOTIFY_REDIRECT_URL:
value: "http://127.0.0.1:43019/redirect#access_token=...."
description: "redirect uri from login on https://accounts.spotify.com/authorize?response_type=token&client_id=5c098bcc800e45d49e476265bc9b6934&scope=playlist-read-private+playlist-read-collaborative+user-library-read&redirect_uri=http%3A%2F%2F127.0.0.1%3A43019%2Fredirect"
stages:
- test
- deploy
before_script:
- python --version # For debugging
- pip install markdown
- pip install mkdocs mkdocs-material
- mkdir public docs docs/artists
test:
script:
- python -m py_compile *.py
pages:
stage: deploy
script:
- python spotify-backup.py --format=json --dump=liked --redirect-url=$SPOTIFY_REDIRECT_URL output.json
- python spotify-backup.py --format=md --dump=liked --redirect-url=$SPOTIFY_REDIRECT_URL output.md
- python -m markdown output.md -x extra -f output.html
- |
# hide navigation at homepage
cat <<EOF > docs/index.md
---
hide:
- toc
---
EOF
- cat output.md >> docs/index.md
- python parse-artists.py
- mkdocs build --strict --no-directory-urls --site-dir ./public
artifacts:
expire_in: 1 day
paths:
- output.html
- output.json
- public/
# trigger this job only "by-hand"
when: manual