Update project / gitlab ci settings
This commit is contained in:
parent
e495d7c188
commit
7d86cea6ec
12 changed files with 162 additions and 99 deletions
7
gitlab-ci/build.yml
Normal file
7
gitlab-ci/build.yml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
static:
|
||||
stage: build
|
||||
image: node:12
|
||||
before_script:
|
||||
- npm install
|
||||
script:
|
||||
- npm run build
|
||||
16
gitlab-ci/deploy.yml
Normal file
16
gitlab-ci/deploy.yml
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
deploy:
|
||||
stage: deploy
|
||||
image: debian:buster
|
||||
environment:
|
||||
name: production
|
||||
url: rss.fudiggity.nl
|
||||
before_script:
|
||||
- apt-get update && apt-get install -y ansible git
|
||||
- git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@git.fudiggity.nl/sonny/ansible-playbooks.git deployment
|
||||
- mkdir /root/.ssh
|
||||
- echo "192.168.178.63 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILbtcdgJBhVCKsO88cV19EYefDTopdYejEQCp1pYr1Ga" > /root/.ssh/known_hosts
|
||||
- echo "$DEPLOY_KEY" > deployment/deploy_key && chmod 0600 deployment/deploy_key
|
||||
script:
|
||||
- ansible-playbook deployment/playbook.yml --inventory deployment/apps.yml --limit newsreader --user ansible --private-key deployment/deploy_key
|
||||
only:
|
||||
- master
|
||||
22
gitlab-ci/lint.yml
Normal file
22
gitlab-ci/lint.yml
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
python-linting:
|
||||
stage: lint
|
||||
allow_failure: true
|
||||
image: python:3.7.4-slim-stretch
|
||||
before_script:
|
||||
- pip install poetry
|
||||
- poetry config cache-dir ~/.cache/poetry
|
||||
- poetry config virtualenvs.in-project true
|
||||
- poetry install --no-interaction
|
||||
script:
|
||||
- poetry run isort src/ --check-only --recursive
|
||||
- poetry run black src/ --line-length 88 --check
|
||||
- poetry run autoflake src/ --check --recursive --remove-all-unused-imports --ignore-init-module-imports
|
||||
|
||||
javascript-linting:
|
||||
stage: lint
|
||||
allow_failure: true
|
||||
image: node:12
|
||||
before_script:
|
||||
- npm install
|
||||
script:
|
||||
- npm run lint
|
||||
23
gitlab-ci/test.yml
Normal file
23
gitlab-ci/test.yml
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
python-tests:
|
||||
stage: test
|
||||
coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/'
|
||||
services:
|
||||
- postgres:11
|
||||
- memcached:1.5.22
|
||||
image: python:3.7.4-slim-stretch
|
||||
before_script:
|
||||
- pip install poetry
|
||||
- poetry config cache-dir .cache/poetry
|
||||
- poetry config virtualenvs.in-project true
|
||||
- poetry install --no-interaction
|
||||
script:
|
||||
- poetry run coverage run src/manage.py test newsreader
|
||||
- poetry run coverage report
|
||||
|
||||
javascript-tests:
|
||||
stage: test
|
||||
image: node:12
|
||||
before_script:
|
||||
- npm install
|
||||
script:
|
||||
- npm test
|
||||
Loading…
Add table
Add a link
Reference in a new issue