Compare commits
10 Commits
72c3ab8b86
...
1c59fe6107
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1c59fe6107 | ||
|
|
be7f604651 | ||
|
|
34e68197d1 | ||
|
|
52b0df4aa0 | ||
|
|
4988950e6b | ||
|
|
4db8c8a908 | ||
|
|
81c8d9f2b4 | ||
|
|
982589d17c | ||
|
|
4d7afc000a | ||
|
|
f22298ed96 |
@@ -6,11 +6,8 @@ on:
|
|||||||
- kub-stage
|
- kub-stage
|
||||||
|
|
||||||
env:
|
env:
|
||||||
REGISTRY: 194.5.195.53:30080
|
REGISTRY: gitea-svc:3000
|
||||||
IMAGE_NAME: admin/backoffice-bff
|
IMAGE_NAME: admin/backoffice-bff
|
||||||
HTTP_PROXY: http://proxyuser:87zH26nbqT2@46.249.98.211:3128
|
|
||||||
HTTPS_PROXY: http://proxyuser:87zH26nbqT2@46.249.98.211:3128
|
|
||||||
NO_PROXY: 127.0.0.1,localhost,194.5.195.53,.svc,.cluster.local
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@@ -18,38 +15,76 @@ jobs:
|
|||||||
container:
|
container:
|
||||||
image: docker:latest
|
image: docker:latest
|
||||||
options: --privileged
|
options: --privileged
|
||||||
|
env:
|
||||||
|
HTTP_PROXY: http://proxyuser:87zH26nbqT2@46.249.98.211:3128
|
||||||
|
HTTPS_PROXY: http://proxyuser:87zH26nbqT2@46.249.98.211:3128
|
||||||
|
NO_PROXY: localhost,127.0.0.1,gitea-svc,194.5.195.53,10.0.0.0/8
|
||||||
steps:
|
steps:
|
||||||
- name: Install git
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
apk add --no-cache git
|
apk add --no-cache git curl
|
||||||
|
|
||||||
- name: Checkout code
|
# Install kubectl
|
||||||
run: |
|
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
|
||||||
git config --global http.proxy ""
|
chmod +x kubectl
|
||||||
git config --global https.proxy ""
|
mv kubectl /usr/local/bin/
|
||||||
git clone --depth 1 --branch kub-stage http://194.5.195.53:30080/admin/BackOffice.BFF.git .
|
|
||||||
git log -1 --format="%H %s"
|
|
||||||
|
|
||||||
- name: Start Docker daemon
|
- name: Start Docker daemon with insecure registry
|
||||||
run: |
|
run: |
|
||||||
|
mkdir -p /etc/docker
|
||||||
|
cat > /etc/docker/daemon.json << 'DAEMON'
|
||||||
|
{
|
||||||
|
"insecure-registries": ["194.5.195.53:30080", "gitea-svc:3000"]
|
||||||
|
}
|
||||||
|
DAEMON
|
||||||
|
mkdir -p ~/.docker
|
||||||
|
cat > ~/.docker/config.json << 'CONF'
|
||||||
|
{
|
||||||
|
"proxies": {
|
||||||
|
"default": {
|
||||||
|
"httpProxy": "http://proxyuser:87zH26nbqT2@46.249.98.211:3128",
|
||||||
|
"httpsProxy": "http://proxyuser:87zH26nbqT2@46.249.98.211:3128",
|
||||||
|
"noProxy": "localhost,127.0.0.1,gitea-svc,194.5.195.53,10.0.0.0/8"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CONF
|
||||||
dockerd &
|
dockerd &
|
||||||
for i in $(seq 1 30); do
|
for i in $(seq 1 30); do
|
||||||
docker info >/dev/null 2>&1 && break || sleep 2
|
docker info >/dev/null 2>&1 && break || sleep 2
|
||||||
done
|
done
|
||||||
docker info
|
docker info
|
||||||
|
|
||||||
|
- name: Checkout code
|
||||||
|
run: |
|
||||||
|
git clone --depth 1 --branch kub-stage http://gitea-svc:3000/admin/BackOffice.BFF.git .
|
||||||
|
git log -1 --format="%H %s"
|
||||||
|
|
||||||
- name: Build Docker Image
|
- name: Build Docker Image
|
||||||
run: |
|
run: |
|
||||||
cd src
|
cd src
|
||||||
docker build -f BackOffice.BFF.WebApi/Dockerfile \
|
docker build -f BackOffice.BFF.WebApi/Dockerfile \
|
||||||
-t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }} \
|
-t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }} \
|
||||||
-t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest \
|
-t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest \
|
||||||
--build-arg HTTP_PROXY=${{ env.HTTP_PROXY }} \
|
--build-arg HTTP_PROXY=http://proxyuser:87zH26nbqT2@46.249.98.211:3128 \
|
||||||
--build-arg HTTPS_PROXY=${{ env.HTTPS_PROXY }} \
|
--build-arg HTTPS_PROXY=http://proxyuser:87zH26nbqT2@46.249.98.211:3128 \
|
||||||
.
|
.
|
||||||
|
|
||||||
|
|
||||||
- name: Push to Registry
|
- name: Push to Registry
|
||||||
run: |
|
run: |
|
||||||
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login ${{ env.REGISTRY }} -u admin --password-stdin
|
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login ${{ env.REGISTRY }} -u admin --password-stdin
|
||||||
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
|
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
|
||||||
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
|
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
|
||||||
|
|
||||||
|
- name: Deploy to Kubernetes
|
||||||
|
run: |
|
||||||
|
# Setup kubeconfig
|
||||||
|
mkdir -p ~/.kube
|
||||||
|
echo "${{ secrets.KUBECONFIG }}" | base64 -d > ~/.kube/config
|
||||||
|
|
||||||
|
# Restart deployment to pull new image
|
||||||
|
kubectl rollout restart deployment/backoffice-bff || echo "Deployment doesn't exist yet"
|
||||||
|
|
||||||
|
# Wait for rollout to complete
|
||||||
|
kubectl rollout status deployment/backoffice-bff --timeout=5m || echo "Deployment rollout pending"
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
|
|
||||||
using Foursat.BackOffice.BFF.ClubMembership.Protobuf;
|
using Foursat.BackOffice.BFF.ClubMembership.Protobuf;
|
||||||
|
using GetAllClubMembershipsRequest = CMSMicroservice.Protobuf.Protos.ClubMembership.GetAllClubMembershipsRequest;
|
||||||
|
|
||||||
namespace BackOffice.BFF.Application.ClubMembershipCQ.Queries.GetAllClubMembers;
|
namespace BackOffice.BFF.Application.ClubMembershipCQ.Queries.GetAllClubMembers;
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ EXPOSE 8081
|
|||||||
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
|
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
|
||||||
ARG BUILD_CONFIGURATION=Release
|
ARG BUILD_CONFIGURATION=Release
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
|
COPY ["BackOffice.BFF.WebApi/NuGet.config", "NuGet.config"]
|
||||||
COPY ["BackOffice.BFF.WebApi/BackOffice.BFF.WebApi.csproj", "BackOffice.BFF.WebApi/"]
|
COPY ["BackOffice.BFF.WebApi/BackOffice.BFF.WebApi.csproj", "BackOffice.BFF.WebApi/"]
|
||||||
COPY ["Protobufs/BackOffice.BFF.Commission.Protobuf/BackOffice.BFF.Commission.Protobuf.csproj", "Protobufs/BackOffice.BFF.Commission.Protobuf/"]
|
COPY ["Protobufs/BackOffice.BFF.Commission.Protobuf/BackOffice.BFF.Commission.Protobuf.csproj", "Protobufs/BackOffice.BFF.Commission.Protobuf/"]
|
||||||
COPY ["Protobufs/BackOffice.BFF.Common.Protobuf/BackOffice.BFF.Common.Protobuf.csproj", "Protobufs/BackOffice.BFF.Common.Protobuf/"]
|
COPY ["Protobufs/BackOffice.BFF.Common.Protobuf/BackOffice.BFF.Common.Protobuf.csproj", "Protobufs/BackOffice.BFF.Common.Protobuf/"]
|
||||||
@@ -28,7 +29,7 @@ COPY ["Protobufs/BackOffice.BFF.Role.Protobuf/BackOffice.BFF.Role.Protobuf.cspro
|
|||||||
COPY ["Protobufs/BackOffice.BFF.UserRole.Protobuf/BackOffice.BFF.UserRole.Protobuf.csproj", "Protobufs/BackOffice.BFF.UserRole.Protobuf/"]
|
COPY ["Protobufs/BackOffice.BFF.UserRole.Protobuf/BackOffice.BFF.UserRole.Protobuf.csproj", "Protobufs/BackOffice.BFF.UserRole.Protobuf/"]
|
||||||
COPY ["Protobufs/BackOffice.BFF.Category.Protobuf/BackOffice.BFF.Category.Protobuf.csproj", "Protobufs/BackOffice.BFF.Category.Protobuf/"]
|
COPY ["Protobufs/BackOffice.BFF.Category.Protobuf/BackOffice.BFF.Category.Protobuf.csproj", "Protobufs/BackOffice.BFF.Category.Protobuf/"]
|
||||||
COPY ["Protobufs/BackOffice.BFF.ManualPayment.Protobuf/BackOffice.BFF.ManualPayment.Protobuf.csproj", "Protobufs/BackOffice.BFF.ManualPayment.Protobuf/"]
|
COPY ["Protobufs/BackOffice.BFF.ManualPayment.Protobuf/BackOffice.BFF.ManualPayment.Protobuf.csproj", "Protobufs/BackOffice.BFF.ManualPayment.Protobuf/"]
|
||||||
RUN dotnet restore "BackOffice.BFF.WebApi/BackOffice.BFF.WebApi.csproj"
|
RUN dotnet restore "BackOffice.BFF.WebApi/BackOffice.BFF.WebApi.csproj" --configfile NuGet.config
|
||||||
COPY . .
|
COPY . .
|
||||||
WORKDIR "/src/BackOffice.BFF.WebApi"
|
WORKDIR "/src/BackOffice.BFF.WebApi"
|
||||||
RUN dotnet build "./BackOffice.BFF.WebApi.csproj" -c $BUILD_CONFIGURATION -o /app/build
|
RUN dotnet build "./BackOffice.BFF.WebApi.csproj" -c $BUILD_CONFIGURATION -o /app/build
|
||||||
|
|||||||
@@ -14,13 +14,14 @@ if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
|
|||||||
builder.WebHost.ConfigureKestrel(options =>
|
builder.WebHost.ConfigureKestrel(options =>
|
||||||
{
|
{
|
||||||
// Setup a HTTP/2 endpoint without TLS.
|
// Setup a HTTP/2 endpoint without TLS.
|
||||||
options.ListenLocalhost(5000, o => o.Protocols =
|
options.ListenLocalhost(5001, o => o.Protocols =
|
||||||
HttpProtocols.Http2);
|
HttpProtocols.Http2);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
var levelSwitch = new LoggingLevelSwitch();
|
var levelSwitch = new LoggingLevelSwitch();
|
||||||
var logger = new LoggerConfiguration()
|
var logger = new LoggerConfiguration()
|
||||||
|
.WriteTo.Console()
|
||||||
.WriteTo.Seq(builder.Configuration["Seq:ServerUrl"] ?? "http://seq-svc:5341",
|
.WriteTo.Seq(builder.Configuration["Seq:ServerUrl"] ?? "http://seq-svc:5341",
|
||||||
apiKey: string.IsNullOrEmpty(builder.Configuration["Seq:ApiKey"]) ? null : builder.Configuration["Seq:ApiKey"],
|
apiKey: string.IsNullOrEmpty(builder.Configuration["Seq:ApiKey"]) ? null : builder.Configuration["Seq:ApiKey"],
|
||||||
controlLevelSwitch: levelSwitch)
|
controlLevelSwitch: levelSwitch)
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
},
|
},
|
||||||
"GrpcChannelOptions": {
|
"GrpcChannelOptions": {
|
||||||
"FMSMSAddress": "https://dl.afrino.co",
|
"FMSMSAddress": "https://dl.afrino.co",
|
||||||
"CMSMSAddress": "https://cms.kbs1.ir"
|
"CMSMSAddress": "http://cms-svc"
|
||||||
},
|
},
|
||||||
"Authentication": {
|
"Authentication": {
|
||||||
"Authority": "https://ids.domain.com/",
|
"Authority": "https://ids.domain.com/",
|
||||||
|
|||||||
Reference in New Issue
Block a user