Publish dynamic questions during UAT deploy
This commit is contained in:
@@ -34,7 +34,7 @@ docker system df
|
||||
df -h
|
||||
|
||||
docker build -f api/QuestionsApi.Tests/Dockerfile -t "${TEST_IMAGE}" .
|
||||
docker build --build-arg BUILD_REVISION="${BUILD_TAG}" -t "${API_IMAGE}" api/QuestionsApi
|
||||
docker build --build-arg BUILD_REVISION="${BUILD_TAG}" -f api/QuestionsApi/Dockerfile -t "${API_IMAGE}" .
|
||||
docker build \
|
||||
--build-arg BUILD_REVISION="${BUILD_TAG}" \
|
||||
--build-arg DEPLOYMENT_ENVIRONMENT="${DEPLOYMENT_ENVIRONMENT}" \
|
||||
@@ -70,6 +70,20 @@ kubectl kustomize "k8s/overlays/${DEPLOYMENT_ENVIRONMENT}" \
|
||||
kubectl rollout restart deployment/step3-api -n "${KUBE_NAMESPACE}"
|
||||
kubectl rollout status deployment/step3-api -n "${KUBE_NAMESPACE}" --timeout=240s
|
||||
kubectl get --raw "/api/v1/namespaces/${KUBE_NAMESPACE}/services/step3-api:http/proxy/readyz" >/dev/null
|
||||
|
||||
if [ "${DEPLOYMENT_ENVIRONMENT}" = "uat" ]; then
|
||||
API_POD="$(kubectl get pods -n "${KUBE_NAMESPACE}" -l app=step3-api \
|
||||
--field-selector=status.phase=Running -o jsonpath='{.items[0].metadata.name}')"
|
||||
if [ -z "${API_POD}" ]; then
|
||||
echo "No running API pod is available for dynamic question promotion." >&2
|
||||
exit 1
|
||||
fi
|
||||
kubectl exec -n "${KUBE_NAMESPACE}" "${API_POD}" -- \
|
||||
dotnet QuestionsApi.dll promote-dynamic-questions \
|
||||
--source /app/content/dynamic_questions \
|
||||
--apply
|
||||
fi
|
||||
|
||||
kubectl rollout status deployment/step3-web -n "${KUBE_NAMESPACE}" --timeout=240s
|
||||
kubectl get --raw "/api/v1/namespaces/${KUBE_NAMESPACE}/services/step3-web:http/proxy/healthz" >/dev/null
|
||||
|
||||
|
||||
@@ -4,16 +4,19 @@ FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
||||
ARG BUILD_REVISION
|
||||
WORKDIR /src
|
||||
|
||||
COPY ["QuestionsApi.csproj", "./"]
|
||||
RUN dotnet restore "QuestionsApi.csproj"
|
||||
COPY ["api/QuestionsApi/QuestionsApi.csproj", "api/QuestionsApi/"]
|
||||
RUN dotnet restore "api/QuestionsApi/QuestionsApi.csproj"
|
||||
|
||||
COPY . .
|
||||
COPY api/QuestionsApi/ api/QuestionsApi/
|
||||
COPY content/dynamic_questions/ content/dynamic_questions/
|
||||
WORKDIR /src/api/QuestionsApi
|
||||
RUN dotnet publish "QuestionsApi.csproj" -c Release -o /app/publish /p:UseAppHost=false /p:SourceRevisionId=${BUILD_REVISION}
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS final
|
||||
ARG BUILD_REVISION
|
||||
WORKDIR /app
|
||||
COPY --from=build /app/publish .
|
||||
COPY --from=build /src/content/dynamic_questions ./content/dynamic_questions
|
||||
|
||||
ENV ASPNETCORE_URLS=http://+:5008 \
|
||||
ASPNETCORE_ENVIRONMENT=Production \
|
||||
|
||||
@@ -12,7 +12,7 @@ public static class DynamicBlueprintCommand
|
||||
var sourceIndex = Array.FindIndex(args, value => value.Equals("--source", StringComparison.OrdinalIgnoreCase));
|
||||
var source = sourceIndex >= 0 && sourceIndex + 1 < args.Length
|
||||
? args[sourceIndex + 1]
|
||||
: Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, "..", "..", "..", "..", "..", "content", "dynamic_questions"));
|
||||
: Path.Combine(AppContext.BaseDirectory, "content", "dynamic_questions");
|
||||
if (!Directory.Exists(source))
|
||||
{
|
||||
await output.WriteLineAsync($"Dynamic blueprint directory not found: {source}");
|
||||
|
||||
Reference in New Issue
Block a user