Skip to content

Commit

Permalink
add version.json in designer image (#13312)
Browse files Browse the repository at this point in the history
* add version.json in designer image

* restart services after setting up oauth app

* wait for gitea to be up
  • Loading branch information
mirkoSekulic authored Aug 6, 2024
1 parent c527f97 commit e1d7839
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/designer-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
client-id: ${{ secrets.AZURE_CLIENT_ID_FC }}
tenant-id: ${{ secrets.AZURE_TENANT_ID_FC }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID_FC }}
build-args: DESIGNER_VERSION=${{ needs.get-short-sha.outputs.short-sha }}

helm-push:
needs: get-short-sha
Expand Down
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ RUN yarn build

# Building the backend
FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS generate-studio-backend
ARG DESIGNER_VERSION=''
WORKDIR /build
COPY backend .
RUN dotnet publish src/Designer/Designer.csproj -c Release -o /app_output
Expand All @@ -45,6 +46,9 @@ RUN rm -f /app_output/Altinn.Studio.Designer.staticwebassets.runtime.json
WORKDIR /app_template
RUN apk add jq zip
RUN wget -O - https://api.github.com/repos/Altinn/app-template-dotnet/releases/latest | jq '.assets[]|select(.name | startswith("app-template-dotnet-") and endswith(".zip"))' | jq '.browser_download_url' | xargs wget -O apptemplate.zip && unzip apptemplate.zip && rm apptemplate.zip
# Create version file
WORKDIR /version
RUN echo "{\"designerVersion\":\"$DESIGNER_VERSION\",\"appTemplateVersion\":\"$(curl -s https://api.github.com/repos/Altinn/app-template-dotnet/releases/latest | jq -r .tag_name)\"}" > version.json

# Building the final image
FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine AS final
Expand All @@ -61,8 +65,10 @@ COPY --from=generate-studio-frontend /build/frontend/dist/dashboard ./wwwroot/de
COPY --from=generate-studio-frontend /build/frontend/dist/resourceadm ./wwwroot/designer/frontend/resourceadm
COPY --from=generate-studio-frontend /build/frontend/dist/language ./wwwroot/designer/frontend/lang
COPY --from=generate-studio-frontend /build/frontend/dist/studio-root ./wwwroot/designer/frontend/studio-root
COPY --from=generate-studio-backend /version/version.json ./wwwroot/designer/version.json

## Copying app template
COPY --from=generate-studio-backend /app_template ./Templates/AspNet


ENTRYPOINT ["dotnet", "Altinn.Studio.Designer.dll"]
5 changes: 4 additions & 1 deletion development/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ const path = require('path');
const writeEnvFile = require('./utils/write-env-file.js');

const startingDockerCompose = () => runCommand('docker compose up -d --remove-orphans --build');
const restartComposeServices = () =>
runCommand('docker compose down && docker compose up -d --remove-orphans');

const createUser = (username, password, admin) =>
runCommand(
Expand Down Expand Up @@ -102,7 +104,8 @@ const createOidcClientIfNotExists = async (env) => {

writeEnvFile(env);
// reload designer with new clientid and secret
startingDockerCompose();
restartComposeServices();
await waitFor('http://studio.localhost/repos/');
};

const addUserToSomeTestDepTeams = async (env) => {
Expand Down

0 comments on commit e1d7839

Please sign in to comment.