-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
60 lines (60 loc) · 1.81 KB
/
.travis.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
49
50
51
52
53
54
55
56
57
58
59
60
---
os: linux
dist: jammy
services:
- docker
language: python
python:
- '3.10'
before_install:
- pip install --upgrade pip setuptools
branches:
only:
- main
- Ka-hapsing
jobs:
include:
- name: Check YAML format
install:
- pip install tox
script:
- tox -e yamllint
- name: pymarkdown
install:
- pip install tox
script:
- tox -e pymarkdown
- name: flake8
install:
- pip install tox
script:
- tox -e flake8
- name: Check Bash format
install:
- pip install tox
script:
- tox -e shellcheck
- stage: deploy
name: deploy
if: (type = push or type = cron) and (branch = main or branch = Ka-hapsing)
install:
- pip install ansible
before_script:
- mkdir -p "${HOME}/.ssh/"
- TRAVIS_TSUKI_SSH_KEY_PATH="${HOME}/.ssh/id_ed25519_travis"
- echo "${DEPLOY_HOST} ssh-ed25519 ${DEPLOY_HOST_SSH_PUBLICKEY}" >> ${HOME}/.ssh/known_hosts
- echo "${DEPLOY_HOST_USER_SSH_KEY}" | base64 --decode > "${TRAVIS_TSUKI_SSH_KEY_PATH}"
# Recreate the certificate from the secure environment variable
- chmod 400 "${TRAVIS_TSUKI_SSH_KEY_PATH}"
script:
- '
ansible-playbook -i deploy/inventory_travis deploy/deploy.yaml
--extra-vars "tsuanan_repo=`basename ${TRAVIS_REPO_SLUG}`"
--extra-vars "branch=${TRAVIS_BRANCH}"
--extra-vars "DEPLOY_HOST=${DEPLOY_HOST}"
--extra-vars "DEPLOY_HOST_USER=${DEPLOY_HOST_USER}"
--extra-vars "TRAVIS_TSUKI_SSH_KEY_PATH=${TRAVIS_TSUKI_SSH_KEY_PATH}"
--extra-vars "ASR_VIRTUAL_HOST=${ASR_VIRTUAL_HOST}"
--extra-vars "TTS_VIRTUAL_HOST=${TTS_VIRTUAL_HOST}"
--extra-vars "SENTRY_DSN=${SENTRY_DSN}"
'