Merge branch 'dev' into 'master'

Dev

See merge request !465
remotes/origin/HEAD
Andrey 8 years ago
commit 741793ceeb
  1. 2
      .gitlab-ci.yml
  2. 23
      Envoy.blade.php
  3. 5
      finance/views.py

@ -15,7 +15,7 @@ deploy_branch:
- ssh-add <(echo "$SSH_PRIVATE_KEY") - ssh-add <(echo "$SSH_PRIVATE_KEY")
- mkdir -p ~/.ssh - mkdir -p ~/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
- ~/.composer/vendor/bin/envoy run deploy --cleanup --branch="$CI_BUILD_REF_SLUG" - ~/.composer/vendor/bin/envoy run deploydev --cleanup --branch="$CI_BUILD_REF_SLUG"
environment: environment:
name: production name: production
url: https://go.skillbox.ru url: https://go.skillbox.ru

@ -1,4 +1,5 @@
@servers(['localhost' => 'deployer@192.168.0.13']) @servers(['localhost' => 'deployer@192.168.0.13'])
@servers(['dev' => 'deployer@192.168.0.5'])
@setup @setup
$repository = 'ssh://git@g.skillbox.ru:22004/kor_a_m/skill-back.git'; $repository = 'ssh://git@g.skillbox.ru:22004/kor_a_m/skill-back.git';
@ -18,7 +19,17 @@
deployment_option_cleanup deployment_option_cleanup
@endstory @endstory
@task('clone_repository', ['on' => 'localhost']) @story('deploydev', ['on' => 'dev'])
clone_repository
create_symlinks
install_req
run_tests
run_migrate
update_symlinks
deployment_option_cleanup
@endstory
@task('clone_repository')
echo '>> Клонируем репозиторий' echo '>> Клонируем репозиторий'
echo '{{ $new_release_dir }}' echo '{{ $new_release_dir }}'
@ -28,7 +39,7 @@ echo '{{ $new_release_dir }}'
@endif @endif
@endtask @endtask
@task('create_symlinks', ['on' => 'localhost']) @task('create_symlinks')
echo '>> Создание симлинков' echo '>> Создание симлинков'
ln -s {{ $app_dir }}/configs/master/ssl {{ $new_release_dir }}/ssl ln -s {{ $app_dir }}/configs/master/ssl {{ $new_release_dir }}/ssl
@if ($branch == 'master') @if ($branch == 'master')
@ -42,7 +53,7 @@ ln -s {{ $app_dir }}/configs/master/ssl {{ $new_release_dir }}/ssl
ln -nfs {{ $app_dir }}/logs/{{ $branch }} {{ $new_release_dir }}/logs ln -nfs {{ $app_dir }}/logs/{{ $branch }} {{ $new_release_dir }}/logs
@endtask @endtask
@task('install_req', ['on' => 'localhost']) @task('install_req')
echo '>> Подтягиваем зависимости' echo '>> Подтягиваем зависимости'
@if ($branch) @if ($branch)
cd {{ $new_release_dir }} cd {{ $new_release_dir }}
@ -50,7 +61,7 @@ echo '>> Подтягиваем зависимости'
@endif @endif
@endtask @endtask
@task('run_tests', ['on' => 'localhost']) @task('run_tests')
echo '>> Запускаем тесты' echo '>> Запускаем тесты'
@if ($branch) @if ($branch)
cd {{ $new_release_dir }} cd {{ $new_release_dir }}
@ -58,7 +69,7 @@ echo '>> Запускаем тесты'
@endif @endif
@endtask @endtask
@task('run_migrate', ['on' => 'localhost']) @task('run_migrate')
echo '>> Запускаем миграции' echo '>> Запускаем миграции'
@if ($branch) @if ($branch)
cd {{ $new_release_dir }} cd {{ $new_release_dir }}
@ -66,7 +77,7 @@ echo '>> Запускаем миграции'
@endif @endif
@endtask @endtask
@task('update_symlinks', ['on' => 'localhost']) @task('update_symlinks')
@if ($branch) @if ($branch)
ln -nfs {{ $app_dir }}/configs/{{ $branch }}/wsgi.py {{ $new_release_dir }}/lms/wsgi.py ln -nfs {{ $app_dir }}/configs/{{ $branch }}/wsgi.py {{ $new_release_dir }}/lms/wsgi.py
echo '>> Создаем симлинк на папку текущего релиза' echo '>> Создаем симлинк на папку текущего релиза'

@ -140,8 +140,11 @@ class InvoiceDetailView(APIView):
price = request.JSON.get('price', None) price = request.JSON.get('price', None)
comment = request.JSON.get('comment', None) comment = request.JSON.get('comment', None)
real_price = request.JSON.get('real_price', None) real_price = request.JSON.get('real_price', None)
key = request.JSON.get('key', None)
pay_count = int(request.JSON.get('pay_count', '1')) pay_count = int(request.JSON.get('pay_count', '1'))
print(key)
if bill_id is None: if bill_id is None:
return Response("Не передан id счёта", status=400) return Response("Не передан id счёта", status=400)
@ -189,8 +192,10 @@ class InvoiceDetailView(APIView):
invoice.real_price = invoice.real_price if real_price is None else real_price invoice.real_price = invoice.real_price if real_price is None else real_price
return Response(InvoiceSerializer(invoice).data, status=200) return Response(InvoiceSerializer(invoice).data, status=200)
invoice.real_price = real_price
invoice.method = method invoice.method = method
invoice.status = status invoice.status = status
invoice.key = key
if bill.check_pay() and (invoice.price < price): if bill.check_pay() and (invoice.price < price):
return Response("""Нельзя менять стоимость по счёту в большую сторону, return Response("""Нельзя менять стоимость по счёту в большую сторону,

Loading…
Cancel
Save