TD-222: Reuse valitydev/action-deploy-docker@v2 (#16)

* Drop merchstat leftovers
* Cut out some unused includes
This commit is contained in:
Andrew Mayorov 2022-07-18 19:20:03 +03:00 committed by GitHub
parent 289a0e9903
commit 9e3f8eb930
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 20 additions and 133 deletions

View File

@ -1,4 +1,4 @@
name: Build Docker image name: Build and publish Docker image
on: on:
push: push:
@ -12,42 +12,10 @@ env:
REGISTRY: ghcr.io REGISTRY: ghcr.io
jobs: jobs:
build: build-push:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout code - uses: valitydev/action-deploy-docker@v2
uses: actions/checkout@v2
- name: Setup Buildx
uses: docker/setup-buildx-action@v1
# https://docs.github.com/en/actions/learn-github-actions/workflow-commands-for-github-actions#setting-an-environment-variable
- name: Update environment variables
run: grep -v '^#' .env >> $GITHUB_ENV
- name: Log in to the Container registry
uses: docker/login-action@v1.12.0
with: with:
registry: ${{ env.REGISTRY }} registry-username: ${{ github.actor }}
username: ${{ github.actor }} registry-access-token: ${{ secrets.GITHUB_TOKEN }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Construct tags / labels for an image
id: meta
uses: docker/metadata-action@v3.6.2
with:
images: |
${{ env.REGISTRY }}/${{ github.repository }}
tags: |
type=sha
- name: Build and push Docker image
uses: docker/build-push-action@v2.9.0
with:
push: ${{ github.event_name == 'push' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
SERVICE_NAME=${{ env.SERVICE_NAME }}
OTP_VERSION=${{ env.OTP_VERSION }}
THRIFT_VERSION=${{ env.THRIFT_VERSION }}

28
.gitignore vendored
View File

@ -1,21 +1,13 @@
# general # Build artifacts
log
/_build/ /_build/
*~ *.o
erl_crash.dump
.tags*
*.sublime-*
.DS_Store
# rebar
/_checkouts/
# generated
*.beam *.beam
.image.dev *.plt
# containerization # Run artifacts
\#* erl_crash.dump
.\#* log
tags
# make stuff
/.image.*
Makefile.env

View File

@ -3,7 +3,6 @@
-include_lib("damsel/include/dmsl_payproc_thrift.hrl"). -include_lib("damsel/include/dmsl_payproc_thrift.hrl").
-include_lib("damsel/include/dmsl_domain_thrift.hrl"). -include_lib("damsel/include/dmsl_domain_thrift.hrl").
-include_lib("damsel/include/dmsl_base_thrift.hrl"). -include_lib("damsel/include/dmsl_base_thrift.hrl").
-include_lib("damsel/include/dmsl_merchstat_thrift.hrl").
-include_lib("damsel/include/dmsl_user_interaction_thrift.hrl"). -include_lib("damsel/include/dmsl_user_interaction_thrift.hrl").
-export([decode_user_interaction_form/1]). -export([decode_user_interaction_form/1]).
@ -286,11 +285,6 @@ decode_make_recurrent(Value) when is_boolean(Value) ->
-spec decode_recurrent_parent(capi_handler_encoder:encode_data()) -> decode_data(). -spec decode_recurrent_parent(capi_handler_encoder:encode_data()) -> decode_data().
decode_recurrent_parent(#domain_RecurrentParentPayment{invoice_id = InvoiceID, payment_id = PaymentID}) -> decode_recurrent_parent(#domain_RecurrentParentPayment{invoice_id = InvoiceID, payment_id = PaymentID}) ->
#{
<<"invoiceID">> => InvoiceID,
<<"paymentID">> => PaymentID
};
decode_recurrent_parent(#merchstat_RecurrentParentPayment{invoice_id = InvoiceID, payment_id = PaymentID}) ->
#{ #{
<<"invoiceID">> => InvoiceID, <<"invoiceID">> => InvoiceID,
<<"paymentID">> => PaymentID <<"paymentID">> => PaymentID

View File

@ -1,9 +1,6 @@
-module(capi_handler_decoder_party). -module(capi_handler_decoder_party).
-include_lib("damsel/include/dmsl_payproc_thrift.hrl").
-include_lib("damsel/include/dmsl_domain_thrift.hrl"). -include_lib("damsel/include/dmsl_domain_thrift.hrl").
-include_lib("damsel/include/dmsl_base_thrift.hrl").
-include_lib("damsel/include/dmsl_merchstat_thrift.hrl").
-export([decode_shop_location/1]). -export([decode_shop_location/1]).
-export([decode_shop_details/1]). -export([decode_shop_details/1]).

View File

@ -1,7 +1,5 @@
-module(capi_handler_encoder). -module(capi_handler_encoder).
-include_lib("damsel/include/dmsl_payproc_thrift.hrl").
-include_lib("damsel/include/dmsl_merchstat_thrift.hrl").
-include_lib("damsel/include/dmsl_domain_thrift.hrl"). -include_lib("damsel/include/dmsl_domain_thrift.hrl").
-include_lib("damsel/include/dmsl_base_thrift.hrl"). -include_lib("damsel/include/dmsl_base_thrift.hrl").

View File

@ -6,7 +6,6 @@
-include_lib("damsel/include/dmsl_payproc_thrift.hrl"). -include_lib("damsel/include/dmsl_payproc_thrift.hrl").
-include_lib("damsel/include/dmsl_payproc_error_thrift.hrl"). -include_lib("damsel/include/dmsl_payproc_error_thrift.hrl").
-include_lib("damsel/include/dmsl_webhooker_thrift.hrl"). -include_lib("damsel/include/dmsl_webhooker_thrift.hrl").
-include_lib("damsel/include/dmsl_merchstat_thrift.hrl").
-include_lib("damsel/include/dmsl_base_thrift.hrl"). -include_lib("damsel/include/dmsl_base_thrift.hrl").
-include_lib("damsel/include/dmsl_domain_thrift.hrl"). -include_lib("damsel/include/dmsl_domain_thrift.hrl").
-include_lib("reporter_proto/include/reporter_reports_thrift.hrl"). -include_lib("reporter_proto/include/reporter_reports_thrift.hrl").

View File

@ -1,3 +1,6 @@
-ifndef(__CAPI_DUMMY_DATA_HRL__).
-define(__CAPI_DUMMY_DATA_HRL__, 42).
-define(STRING, <<"TEST">>). -define(STRING, <<"TEST">>).
-define(RUB, <<"RUB">>). -define(RUB, <<"RUB">>).
-define(USD, <<"USD">>). -define(USD, <<"USD">>).
@ -912,19 +915,6 @@
approval_code = <<"808080">> approval_code = <<"808080">>
}). }).
-define(STAT_PAYER(PaymentTool), ?STAT_PAYER(PaymentTool, ?STRING)).
-define(STAT_PAYER(PaymentTool, SessionId),
{payment_resource, #merchstat_PaymentResourcePayer{
payment_tool = PaymentTool,
ip_address = ?STRING,
fingerprint = ?STRING,
phone_number = ?STRING,
email = <<"test@test.ru">>,
session_id = SessionId
}}
).
-define(STAT_CUSTOMER_PAYER(PaymentTool), -define(STAT_CUSTOMER_PAYER(PaymentTool),
{customer, #magista_CustomerPayer{ {customer, #magista_CustomerPayer{
customer_id = ?STRING, customer_id = ?STRING,
@ -933,16 +923,6 @@
}} }}
). ).
-define(STAT_RECURRENT_PAYER(PaymentTool),
{recurrent, #merchstat_RecurrentPayer{
payment_tool = PaymentTool,
recurrent_parent = ?RECURRENT_PARENT,
phone_number = ?STRING
}}
).
-define(RECURRENT_PARENT, #merchstat_RecurrentParentPayment{invoice_id = ?STRING, payment_id = ?STRING}).
-define(STAT_PAYMENT_STATUS_PENDING, {pending, #domain_InvoicePaymentPending{}}). -define(STAT_PAYMENT_STATUS_PENDING, {pending, #domain_InvoicePaymentPending{}}).
-define(STAT_PAYMENT_STATUS_CAPTURED, {captured, #domain_InvoicePaymentCaptured{}}). -define(STAT_PAYMENT_STATUS_CAPTURED, {captured, #domain_InvoicePaymentCaptured{}}).
@ -964,48 +944,6 @@
<<"payment_system">> => <<"visa">> <<"payment_system">> => <<"visa">>
}). }).
-define(STAT_REFUND, #merchstat_StatRefund{
id = ?STRING,
payment_id = ?STRING,
invoice_id = ?STRING,
owner_id = ?STRING,
shop_id = ?STRING,
status = {succeeded, #merchstat_InvoicePaymentRefundSucceeded{at = ?TIMESTAMP}},
created_at = ?TIMESTAMP,
amount = ?INTEGER,
fee = ?INTEGER,
currency_symbolic_code = ?RUB,
external_id = ?STRING,
allocation = ?ALLOCATION
}).
-define(STAT_PAYOUT(Type), #merchstat_StatPayout{
id = ?STRING,
party_id = ?STRING,
shop_id = ?STRING,
created_at = ?TIMESTAMP,
status = {paid, #merchstat_PayoutPaid{}},
amount = ?INTEGER,
fee = ?INTEGER,
currency_symbolic_code = ?RUB,
payout_tool_info = Type
}).
-define(STAT_BANK_CARD, #merchstat_BankCard{
token = ?STRING,
payment_system = #domain_PaymentSystemRef{id = <<"visa">>},
bin = <<"411111">>,
masked_pan = <<"411111******1111">>
}).
-define(STAT_BANK_CARD_WITH_TP, #merchstat_BankCard{
token = ?STRING,
payment_system = #domain_PaymentSystemRef{id = <<"visa">>},
bin = <<"411111">>,
masked_pan = <<"411111******1111">>,
payment_token = #domain_BankCardTokenServiceRef{id = <<"APPLE PAY">>}
}).
-define(REPORT_TYPE, <<"paymentRegistry">>). -define(REPORT_TYPE, <<"paymentRegistry">>).
-define(REPORT, #reports_Report{ -define(REPORT, #reports_Report{
@ -1410,3 +1348,5 @@
#{<<"product">> => ?STRING, <<"quantity">> => ?INTEGER, <<"price">> => ?INTEGER} #{<<"product">> => ?STRING, <<"quantity">> => ?INTEGER, <<"price">> => ?INTEGER}
] ]
}). }).
-endif.

View File

@ -3,7 +3,6 @@
-include_lib("common_test/include/ct.hrl"). -include_lib("common_test/include/ct.hrl").
-include_lib("damsel/include/dmsl_payproc_thrift.hrl"). -include_lib("damsel/include/dmsl_payproc_thrift.hrl").
-include_lib("damsel/include/dmsl_merchstat_thrift.hrl").
-include_lib("damsel/include/dmsl_base_thrift.hrl"). -include_lib("damsel/include/dmsl_base_thrift.hrl").
-include_lib("damsel/include/dmsl_domain_thrift.hrl"). -include_lib("damsel/include/dmsl_domain_thrift.hrl").