Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 749cfeb8f4 | |||
| 6f573c0a29 | |||
| 9b82b45e46 |
@@ -6,15 +6,15 @@ on:
|
|||||||
- kub-stage
|
- kub-stage
|
||||||
|
|
||||||
env:
|
env:
|
||||||
REGISTRY: 194.5.195.53:30080
|
REGISTRY: 185.252.31.44:30080
|
||||||
IMAGE_NAME: admin/cms
|
IMAGE_NAME: admin/cms
|
||||||
K8S_SERVER: 194.5.195.53
|
K8S_SERVER: 185.252.31.44
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-deploy:
|
build-and-deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: 194.5.195.53:32082/docker-sshpass:latest
|
image: 185.252.31.44:32082/docker-sshpass:latest
|
||||||
options: --privileged
|
options: --privileged
|
||||||
steps:
|
steps:
|
||||||
- name: Start Docker daemon
|
- name: Start Docker daemon
|
||||||
@@ -22,7 +22,7 @@ jobs:
|
|||||||
mkdir -p /etc/docker
|
mkdir -p /etc/docker
|
||||||
cat > /etc/docker/daemon.json << 'DAEMON'
|
cat > /etc/docker/daemon.json << 'DAEMON'
|
||||||
{
|
{
|
||||||
"insecure-registries": ["194.5.195.53:30080", "194.5.195.53:32500", "194.5.195.53:32082"]
|
"insecure-registries": ["185.252.31.44:30080", "185.252.31.44:32500", "185.252.31.44:32082"]
|
||||||
}
|
}
|
||||||
DAEMON
|
DAEMON
|
||||||
echo "🚀 Starting Docker daemon..."
|
echo "🚀 Starting Docker daemon..."
|
||||||
@@ -52,14 +52,14 @@ jobs:
|
|||||||
|
|
||||||
- name: Login to Docker registries
|
- name: Login to Docker registries
|
||||||
run: |
|
run: |
|
||||||
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login 194.5.195.53:32082 -u admin --password-stdin
|
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login 185.252.31.44:32082 -u admin --password-stdin
|
||||||
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login ${{ env.REGISTRY }} -u admin --password-stdin
|
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login ${{ env.REGISTRY }} -u admin --password-stdin
|
||||||
|
|
||||||
- name: Publish Protobuf packages
|
- name: Publish Protobuf packages
|
||||||
run: |
|
run: |
|
||||||
echo "📦 Publishing Protobuf packages..."
|
echo "📦 Publishing Protobuf packages..."
|
||||||
docker run --rm --network host -e CI=true -v $(pwd):/src -w /src \
|
docker run --rm --network host -e CI=true -v $(pwd):/src -w /src \
|
||||||
194.5.195.53:32082/dotnet/sdk:9.0 sh -c '
|
185.252.31.44:32082/dotnet/sdk:9.0 sh -c '
|
||||||
for proj in $(find . -name "*Protobuf*.csproj" -type f); do
|
for proj in $(find . -name "*Protobuf*.csproj" -type f); do
|
||||||
echo "📦 $proj"
|
echo "📦 $proj"
|
||||||
dotnet restore "$proj" --configfile src/NuGet.config
|
dotnet restore "$proj" --configfile src/NuGet.config
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ on:
|
|||||||
- production
|
- production
|
||||||
|
|
||||||
env:
|
env:
|
||||||
REGISTRY: 194.5.195.53:30080
|
REGISTRY: 185.252.31.44:30080
|
||||||
IMAGE_NAME: admin/cms
|
IMAGE_NAME: admin/cms
|
||||||
K8S_SERVER: 45.149.79.127
|
K8S_SERVER: 45.149.79.127
|
||||||
|
|
||||||
@@ -14,7 +14,7 @@ jobs:
|
|||||||
build-and-deploy:
|
build-and-deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: 194.5.195.53:32082/docker-sshpass:latest
|
image: 185.252.31.44:32082/docker-sshpass:latest
|
||||||
options: --privileged
|
options: --privileged
|
||||||
steps:
|
steps:
|
||||||
- name: Start Docker daemon
|
- name: Start Docker daemon
|
||||||
@@ -22,7 +22,7 @@ jobs:
|
|||||||
mkdir -p /etc/docker
|
mkdir -p /etc/docker
|
||||||
cat > /etc/docker/daemon.json << 'DAEMON'
|
cat > /etc/docker/daemon.json << 'DAEMON'
|
||||||
{
|
{
|
||||||
"insecure-registries": ["194.5.195.53:30080", "194.5.195.53:32500", "194.5.195.53:32082"]
|
"insecure-registries": ["185.252.31.44:30080", "185.252.31.44:32500", "185.252.31.44:32082"]
|
||||||
}
|
}
|
||||||
DAEMON
|
DAEMON
|
||||||
echo "🚀 Starting Docker daemon..."
|
echo "🚀 Starting Docker daemon..."
|
||||||
@@ -50,14 +50,14 @@ jobs:
|
|||||||
|
|
||||||
- name: Login to Docker registries
|
- name: Login to Docker registries
|
||||||
run: |
|
run: |
|
||||||
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login 194.5.195.53:32082 -u admin --password-stdin
|
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login 185.252.31.44:32082 -u admin --password-stdin
|
||||||
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login ${{ env.REGISTRY }} -u admin --password-stdin
|
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login ${{ env.REGISTRY }} -u admin --password-stdin
|
||||||
|
|
||||||
- name: Publish Protobuf packages
|
- name: Publish Protobuf packages
|
||||||
run: |
|
run: |
|
||||||
echo "📦 Publishing Protobuf packages..."
|
echo "📦 Publishing Protobuf packages..."
|
||||||
docker run --rm --network host -v $(pwd):/src -w /src \
|
docker run --rm --network host -v $(pwd):/src -w /src \
|
||||||
194.5.195.53:32082/dotnet/sdk:9.0 sh -c '
|
185.252.31.44:32082/dotnet/sdk:9.0 sh -c '
|
||||||
for proj in $(find . -name "*Protobuf*.csproj" -type f); do
|
for proj in $(find . -name "*Protobuf*.csproj" -type f); do
|
||||||
echo "📦 $proj"
|
echo "📦 $proj"
|
||||||
dotnet restore "$proj" --configfile src/NuGet.config
|
dotnet restore "$proj" --configfile src/NuGet.config
|
||||||
@@ -65,7 +65,7 @@ jobs:
|
|||||||
dotnet pack "$proj" -c Release --no-build -o "$(dirname $proj)/nupkg"
|
dotnet pack "$proj" -c Release --no-build -o "$(dirname $proj)/nupkg"
|
||||||
for nupkg in $(dirname $proj)/nupkg/*.nupkg; do
|
for nupkg in $(dirname $proj)/nupkg/*.nupkg; do
|
||||||
[ -f "$nupkg" ] && dotnet nuget push "$nupkg" \
|
[ -f "$nupkg" ] && dotnet nuget push "$nupkg" \
|
||||||
--source "http://194.5.195.53:32081/repository/foursat-nuget-hosted/index.json" \
|
--source "http://185.252.31.44:32081/repository/foursat-nuget-hosted/index.json" \
|
||||||
--api-key "admin:87zH26nbqT" \
|
--api-key "admin:87zH26nbqT" \
|
||||||
--skip-duplicate --allow-insecure-connections || true
|
--skip-duplicate --allow-insecure-connections || true
|
||||||
done
|
done
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
FROM 194.5.195.53:32082/dotnet/sdk:9.0 AS build
|
FROM 185.252.31.44:32082/dotnet/sdk:9.0 AS build
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
|
|
||||||
# Copy NuGet config first
|
# Copy NuGet config first
|
||||||
@@ -11,7 +11,7 @@ COPY src/ ./
|
|||||||
RUN dotnet restore "CMSMicroservice.WebApi/CMSMicroservice.WebApi.csproj" --configfile NuGet.config
|
RUN dotnet restore "CMSMicroservice.WebApi/CMSMicroservice.WebApi.csproj" --configfile NuGet.config
|
||||||
RUN dotnet publish "CMSMicroservice.WebApi/CMSMicroservice.WebApi.csproj" -c Release -o /app/publish --no-restore
|
RUN dotnet publish "CMSMicroservice.WebApi/CMSMicroservice.WebApi.csproj" -c Release -o /app/publish --no-restore
|
||||||
|
|
||||||
FROM 194.5.195.53:32082/dotnet/aspnet:9.0 AS runtime
|
FROM 185.252.31.44:32082/dotnet/aspnet:9.0 AS runtime
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=build /app/publish .
|
COPY --from=build /app/publish .
|
||||||
ENV ASPNETCORE_URLS=http://+:8080
|
ENV ASPNETCORE_URLS=http://+:8080
|
||||||
|
|||||||
@@ -33,12 +33,12 @@ stringData:
|
|||||||
"DefaultEmail": "info@kbs2.ir",
|
"DefaultEmail": "info@kbs2.ir",
|
||||||
"Packages": {
|
"Packages": {
|
||||||
"4": {
|
"4": {
|
||||||
"GatewayAmountToman": 9700000,
|
"GatewayAmountToman": 11200000,
|
||||||
"WalletCreditToman": 13000000
|
"WalletCreditToman": 12656000
|
||||||
},
|
},
|
||||||
"1": {
|
"1": {
|
||||||
"GatewayAmountToman": 97000000,
|
"GatewayAmountToman": 11200000,
|
||||||
"WalletCreditToman": 130000000
|
"WalletCreditToman": 12656000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: cms
|
- name: cms
|
||||||
image: 194.5.195.53:30080/admin/cms:prod
|
image: 185.252.31.44:30080/admin/cms:prod
|
||||||
imagePullPolicy: Always
|
imagePullPolicy: Always
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 8080
|
- containerPort: 8080
|
||||||
|
|||||||
@@ -34,12 +34,12 @@ stringData:
|
|||||||
"DefaultEmail": "info@kbs2.ir",
|
"DefaultEmail": "info@kbs2.ir",
|
||||||
"Packages": {
|
"Packages": {
|
||||||
"4": {
|
"4": {
|
||||||
"GatewayAmountToman": 1000,
|
"GatewayAmountToman": 11200000,
|
||||||
"WalletCreditToman": 13000000
|
"WalletCreditToman": 12656000
|
||||||
},
|
},
|
||||||
"1": {
|
"1": {
|
||||||
"GatewayAmountToman": 1000,
|
"GatewayAmountToman": 11200000,
|
||||||
"WalletCreditToman": 130000000
|
"WalletCreditToman": 12656000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -53,7 +53,7 @@ stringData:
|
|||||||
"JwtAudience": "https://localhost",
|
"JwtAudience": "https://localhost",
|
||||||
"JwtExpiryInDays": 5,
|
"JwtExpiryInDays": 5,
|
||||||
"ConnectionStrings": {
|
"ConnectionStrings": {
|
||||||
"DefaultConnection": "Data Source=194.5.195.53,31433; Initial Catalog=Foursat;User ID=sa;Password=87zH26nbqT;Connection Timeout=300000;MultipleActiveResultSets=True;Encrypt=False",
|
"DefaultConnection": "Data Source=185.252.31.44,31433; Initial Catalog=Foursat;User ID=sa;Password=87zH26nbqT;Connection Timeout=300000;MultipleActiveResultSets=True;Encrypt=False",
|
||||||
"providerName": "System.Data.SqlClient"
|
"providerName": "System.Data.SqlClient"
|
||||||
},
|
},
|
||||||
"Otp": {
|
"Otp": {
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: cms
|
- name: cms
|
||||||
image: 194.5.195.53:30080/admin/cms:latest
|
image: 185.252.31.44:30080/admin/cms:latest
|
||||||
imagePullPolicy: Always
|
imagePullPolicy: Always
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 8080
|
- containerPort: 8080
|
||||||
|
|||||||
@@ -58,7 +58,9 @@ public class TwentyCardPaymentService : IPaymentGatewayService
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var amount = ((long)request.Amount).ToString();
|
// ۲۰کارت amount را به ریال میگیرد (تومان × ۱۰)
|
||||||
|
var amountRial = ((long)request.Amount) * 10L;
|
||||||
|
var amount = amountRial.ToString();
|
||||||
var payerName = string.IsNullOrWhiteSpace(request.Name)
|
var payerName = string.IsNullOrWhiteSpace(request.Name)
|
||||||
? (string.IsNullOrWhiteSpace(request.Mobile) ? "کاربر" : request.Mobile)
|
? (string.IsNullOrWhiteSpace(request.Mobile) ? "کاربر" : request.Mobile)
|
||||||
: request.Name.Trim();
|
: request.Name.Trim();
|
||||||
@@ -85,8 +87,8 @@ public class TwentyCardPaymentService : IPaymentGatewayService
|
|||||||
AddFormField(content, "national_id", request.NationalId);
|
AddFormField(content, "national_id", request.NationalId);
|
||||||
|
|
||||||
_logger.LogInformation(
|
_logger.LogInformation(
|
||||||
"TwentyCard payment request: Amount={Amount} Toman, User={UserId}, Invoice={Invoice}",
|
"TwentyCard payment request: Amount={AmountToman} Toman ({AmountRial} Rial), User={UserId}, Invoice={Invoice}",
|
||||||
amount, request.UserId, invoice);
|
(long)request.Amount, amountRial, request.UserId, invoice);
|
||||||
|
|
||||||
var response = await _httpClient.PostAsync("api/pgw/merchant/request", content, cancellationToken);
|
var response = await _httpClient.PostAsync("api/pgw/merchant/request", content, cancellationToken);
|
||||||
var responseBody = await response.Content.ReadAsStringAsync(cancellationToken);
|
var responseBody = await response.Content.ReadAsStringAsync(cancellationToken);
|
||||||
@@ -169,7 +171,7 @@ public class TwentyCardPaymentService : IPaymentGatewayService
|
|||||||
["terminal_username"] = _terminalUsername,
|
["terminal_username"] = _terminalUsername,
|
||||||
["terminal_password"] = _terminalPassword,
|
["terminal_password"] = _terminalPassword,
|
||||||
["authority"] = refId,
|
["authority"] = refId,
|
||||||
["amount"] = ((long)amountInToman).ToString()
|
["amount"] = (((long)amountInToman) * 10L).ToString()
|
||||||
});
|
});
|
||||||
|
|
||||||
var response = await _httpClient.PostAsync("api/pgw/merchant/verify", content, cancellationToken);
|
var response = await _httpClient.PostAsync("api/pgw/merchant/verify", content, cancellationToken);
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
|
|
||||||
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
|
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
|
||||||
|
|
||||||
FROM 194.5.195.53:32082/dotnet/aspnet:9.0 AS base
|
FROM 185.252.31.44:32082/dotnet/aspnet:9.0 AS base
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
EXPOSE 443
|
EXPOSE 443
|
||||||
|
|
||||||
FROM 194.5.195.53:32082/dotnet/sdk:9.0 AS build
|
FROM 185.252.31.44:32082/dotnet/sdk:9.0 AS build
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
COPY ["CMSMicroservice.WebApi/CMSMicroservice.WebApi.csproj", "CMSMicroservice.WebApi/"]
|
COPY ["CMSMicroservice.WebApi/CMSMicroservice.WebApi.csproj", "CMSMicroservice.WebApi/"]
|
||||||
COPY ["CMSMicroservice.Application/CMSMicroservice.Application.csproj", "CMSMicroservice.Application/"]
|
COPY ["CMSMicroservice.Application/CMSMicroservice.Application.csproj", "CMSMicroservice.Application/"]
|
||||||
|
|||||||
@@ -14,12 +14,12 @@
|
|||||||
"DefaultEmail": "info@kbs2.ir",
|
"DefaultEmail": "info@kbs2.ir",
|
||||||
"Packages": {
|
"Packages": {
|
||||||
"4": {
|
"4": {
|
||||||
"GatewayAmountToman": 1000,
|
"GatewayAmountToman": 11200000,
|
||||||
"WalletCreditToman": 13000000
|
"WalletCreditToman": 12656000
|
||||||
},
|
},
|
||||||
"1": {
|
"1": {
|
||||||
"GatewayAmountToman": 1000,
|
"GatewayAmountToman": 11200000,
|
||||||
"WalletCreditToman": 130000000
|
"WalletCreditToman": 12656000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
"JwtAudience": "https://localhost",
|
"JwtAudience": "https://localhost",
|
||||||
"JwtExpiryInDays": 5,
|
"JwtExpiryInDays": 5,
|
||||||
"ConnectionStrings": {
|
"ConnectionStrings": {
|
||||||
"DefaultConnection": "Data Source=194.5.195.53,31433; Initial Catalog=Foursat;User ID=sa;Password=87zH26nbqT;Connection Timeout=300000;MultipleActiveResultSets=True;Encrypt=False",
|
"DefaultConnection": "Data Source=185.252.31.44,31433; Initial Catalog=Foursat;User ID=sa;Password=87zH26nbqT;Connection Timeout=300000;MultipleActiveResultSets=True;Encrypt=False",
|
||||||
"providerName": "System.Data.SqlClient"
|
"providerName": "System.Data.SqlClient"
|
||||||
},
|
},
|
||||||
"Otp": {
|
"Otp": {
|
||||||
|
|||||||
@@ -13,12 +13,12 @@
|
|||||||
"DefaultEmail": "info@kbs2.ir",
|
"DefaultEmail": "info@kbs2.ir",
|
||||||
"Packages": {
|
"Packages": {
|
||||||
"4": {
|
"4": {
|
||||||
"GatewayAmountToman": 9700000,
|
"GatewayAmountToman": 11200000,
|
||||||
"WalletCreditToman": 13000000
|
"WalletCreditToman": 12656000
|
||||||
},
|
},
|
||||||
"1": {
|
"1": {
|
||||||
"GatewayAmountToman": 97000000,
|
"GatewayAmountToman": 11200000,
|
||||||
"WalletCreditToman": 130000000
|
"WalletCreditToman": 12656000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
+2
-2
@@ -3,8 +3,8 @@
|
|||||||
<packageSources>
|
<packageSources>
|
||||||
<clear />
|
<clear />
|
||||||
<!-- Nexus (hosts FourSat packages + proxies nuget.org) -->
|
<!-- Nexus (hosts FourSat packages + proxies nuget.org) -->
|
||||||
<add key="Nexus" value="http://194.5.195.53:32081/repository/nuget-all/index.json" allowInsecureConnections="true" />
|
<add key="Nexus" value="http://185.252.31.44:32081/repository/nuget-all/index.json" allowInsecureConnections="true" />
|
||||||
<add key="foursat-hosted" value="http://194.5.195.53:32081/repository/foursat-nuget-hosted/index.json" allowInsecureConnections="true" />
|
<add key="foursat-hosted" value="http://185.252.31.44:32081/repository/foursat-nuget-hosted/index.json" allowInsecureConnections="true" />
|
||||||
</packageSources>
|
</packageSources>
|
||||||
<packageSourceCredentials>
|
<packageSourceCredentials>
|
||||||
<Nexus>
|
<Nexus>
|
||||||
|
|||||||
Reference in New Issue
Block a user