77 lines
1.7 KiB
YAML
77 lines
1.7 KiB
YAML
image: registry.gitlab.com/librespacefoundation/satnogs/satnogs-network:latest
|
|
|
|
stages:
|
|
- static
|
|
- build
|
|
- test
|
|
- deploy
|
|
static_js_css:
|
|
stage: static
|
|
image: node
|
|
script:
|
|
- npm install -g eslint stylelint
|
|
- eslint 'network/static/js/*.js'
|
|
- stylelint 'network/static/css/*.css' 'network/static/css/*.scss'
|
|
static_python:
|
|
stage: static
|
|
image: python:2.7
|
|
before_script:
|
|
- pip install tox
|
|
script:
|
|
- tox -e flake8
|
|
build:
|
|
stage: build
|
|
image: python:2.7
|
|
script:
|
|
- rm -rf dist
|
|
- python setup.py sdist bdist_wheel
|
|
artifacts:
|
|
expire_in: 1 week
|
|
when: always
|
|
paths:
|
|
- dist
|
|
build3:
|
|
stage: build
|
|
image: python:3.6
|
|
script:
|
|
- rm -rf dist
|
|
- python setup.py sdist bdist_wheel
|
|
artifacts:
|
|
expire_in: 1 week
|
|
when: always
|
|
paths:
|
|
- dist
|
|
|
|
test:
|
|
stage: test
|
|
script:
|
|
- pip install --no-cache-dir -r requirements/dev.txt
|
|
- cp env-dist .env
|
|
- pytest
|
|
|
|
stage:
|
|
stage: deploy
|
|
environment: stage
|
|
only:
|
|
- dev@librespacefoundation/satnogs/satnogs-network
|
|
script:
|
|
- mkdir -p ~/.ssh
|
|
- echo "$SSH_PRIVATE_KEY" >> ~/.ssh/id_rsa
|
|
- chmod -R u=rwX,o=,g= ~/.ssh/
|
|
- echo "$SSH_SERVER_HOSTKEY" > ~/.ssh/known_hosts
|
|
- git checkout dev
|
|
- git push -u ssh://$SERVER_USER@$SERVER_HOST$SERVER_PATH dev
|
|
|
|
production:
|
|
stage: deploy
|
|
environment: production
|
|
only:
|
|
- master@librespacefoundation/satnogs/satnogs-network
|
|
script:
|
|
- mkdir -p ~/.ssh
|
|
- echo "$SSH_PRIVATE_KEY" >> ~/.ssh/id_rsa
|
|
- chmod -R u=rwX,o=,g= ~/.ssh/
|
|
- echo "$SSH_SERVER_HOSTKEY" > ~/.ssh/known_hosts
|
|
- git checkout master
|
|
- git push -u ssh://$SERVER_USER@$SERVER_HOST$SERVER_PATH master
|