forked from specklesystems/speckle-server
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/arup-group/speckle-server i…
…nto jm/dev/2.14.7
- Loading branch information
Showing
65 changed files
with
2,106 additions
and
40 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:16 | ||
|
||
# Install Docker CE CLI | ||
RUN apt-get update \ | ||
&& apt-get install -y apt-transport-https ca-certificates curl gnupg2 lsb-release \ | ||
&& curl -fsSL https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/gpg | apt-key add - 2>/dev/null \ | ||
&& echo "deb [arch=amd64] https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]') $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list \ | ||
&& apt-get update \ | ||
&& apt-get install -y docker-ce-cli | ||
|
||
# Install Docker Compose | ||
RUN LATEST_COMPOSE_VERSION=$(curl -sSL "https://api.github.com/repos/docker/compose/releases/latest" | grep -o -P '(?<="tag_name": ").+(?=")') \ | ||
&& curl -sSL "https://github.com/docker/compose/releases/download/${LATEST_COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose \ | ||
&& chmod +x /usr/local/bin/docker-compose | ||
|
||
ARG NONROOT_USER=node | ||
|
||
RUN echo "#!/bin/sh\n\ | ||
sudoIf() { if [ \"\$(id -u)\" -ne 0 ]; then sudo \"\$@\"; else \"\$@\"; fi }\n\ | ||
SOCKET_GID=\$(stat -c '%g' /var/run/docker.sock) \n\ | ||
if [ \"${SOCKET_GID}\" != '0' ]; then\n\ | ||
if [ \"\$(cat /etc/group | grep :\${SOCKET_GID}:)\" = '' ]; then sudoIf groupadd --gid \${SOCKET_GID} docker-host; fi \n\ | ||
if [ \"\$(id ${NONROOT_USER} | grep -E \"groups=.*(=|,)\${SOCKET_GID}\(\")\" = '' ]; then sudoIf usermod -aG \${SOCKET_GID} ${NONROOT_USER}; fi\n\ | ||
fi\n\ | ||
exec \"\$@\"" > /usr/local/share/docker-init.sh \ | ||
&& chmod +x /usr/local/share/docker-init.sh | ||
|
||
# VS Code overrides ENTRYPOINT and CMD when executing `docker run` by default. | ||
# Setting the ENTRYPOINT to docker-init.sh will configure non-root access to | ||
# the Docker socket if "overrideCommand": false is set in devcontainer.json. | ||
# The script will also execute CMD if you need to alter startup behaviors. | ||
ENTRYPOINT [ "/usr/local/share/docker-init.sh" ] | ||
CMD [ "sleep", "infinity" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"name": "Speckle Dev Environment", | ||
"build": { | ||
"dockerfile": "Dockerfile" | ||
}, | ||
"extensions": ["ms-azuretools.vscode-docker"], | ||
"runArgs": ["--init"], | ||
"mounts": ["source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind"], | ||
"remoteUser": "node", | ||
"overrideCommand": false, | ||
"postStartCommand": "npm install && npx lerna bootstrap && npx lerna run build && docker-compose -f docker-compose-deps.yml up -d && cp packages/server/.env-example packages/server/.env" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
["prod", "hs2", "staging", "hk", "alr", "et"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
["staging"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
[ | ||
{ | ||
"environment": "staging", | ||
"region": "eu-west-1", | ||
"accessKey": "STAGING_AWS_ACCESS_KEY_ID", | ||
"secretAccessKey": "STAGING_AWS_SECRET_ACCESS_KEY", | ||
"url": "https://v2.staging-speckle.arup.com" | ||
}, | ||
{ | ||
"environment": "prod", | ||
"region": "eu-west-1", | ||
"accessKey": "AWS_ACCESS_KEY_ID", | ||
"secretAccessKey": "AWS_SECRET_ACCESS_KEY", | ||
"url": "https://v2.speckle.arup.com" | ||
}, | ||
{ | ||
"environment": "hk", | ||
"region": "ap-east-1", | ||
"accessKey": "AWS_ACCESS_KEY_ID", | ||
"secretAccessKey": "AWS_SECRET_ACCESS_KEY", | ||
"url": "https://hk.speckle.arup.com" | ||
}, | ||
{ | ||
"environment": "alr", | ||
"region": "ap-southeast-2", | ||
"accessKey": "AWS_ACCESS_KEY_ID", | ||
"secretAccessKey": "AWS_SECRET_ACCESS_KEY", | ||
"url": "https://lightrail.speckle.arup.com" | ||
}, | ||
{ | ||
"environment": "et", | ||
"region": "eu-west-2", | ||
"accessKey": "AWS_ACCESS_KEY_ID", | ||
"secretAccessKey": "AWS_SECRET_ACCESS_KEY", | ||
"url": "https://eustontower.speckle.arup.com" | ||
}, | ||
{ | ||
"environment": "hs2", | ||
"region": "eu-west-2", | ||
"accessKey": "AWS_ACCESS_KEY_ID", | ||
"secretAccessKey": "AWS_SECRET_ACCESS_KEY", | ||
"url": "https://hs2.speckle.arup.com" | ||
}, | ||
{ | ||
"package": "server", | ||
"cxName": "spec-cx-server", | ||
"serviceName": "specklev2" | ||
}, | ||
{ | ||
"package": "frontend", | ||
"cxName": "spec-cx-frontend", | ||
"serviceName": "specklev2-frontend" | ||
}, | ||
{ | ||
"package": "preview-service", | ||
"cxName": "spec-cx-preview", | ||
"serviceName": "specklev2-preview-service" | ||
}, | ||
{ | ||
"package": "webhook-service", | ||
"cxName": "spec-cx-webhook", | ||
"serviceName": "specklev2-webhook-service" | ||
}, | ||
{ | ||
"package": "fileimport-service", | ||
"cxName": "spec-cx-fileimport-service", | ||
"serviceName": "specklev2-fileimport-service" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
[ | ||
{ | ||
"environment": "staging", | ||
"region": "eu-west-1", | ||
"accessKey": "STAGING_AWS_ACCESS_KEY_ID", | ||
"secretAccessKey": "STAGING_AWS_SECRET_ACCESS_KEY", | ||
"url": "https://v2.staging-speckle.arup.com" | ||
}, | ||
{ | ||
"package": "server", | ||
"cxName": "spec-cx-server", | ||
"serviceName": "specklev2" | ||
}, | ||
{ | ||
"package": "frontend", | ||
"cxName": "spec-cx-frontend", | ||
"serviceName": "specklev2-frontend" | ||
}, | ||
{ | ||
"package": "preview-service", | ||
"cxName": "spec-cx-preview", | ||
"serviceName": "specklev2-preview-service" | ||
}, | ||
{ | ||
"package": "webhook-service", | ||
"cxName": "spec-cx-webhook", | ||
"serviceName": "specklev2-webhook-service" | ||
}, | ||
{ | ||
"package": "fileimport-service", | ||
"cxName": "spec-cx-fileimport-service", | ||
"serviceName": "specklev2-fileimport-service" | ||
} | ||
] |
51 changes: 51 additions & 0 deletions
51
.github/workflows/p500-webhook-service_speckle-v2-webhook-prod-web.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy | ||
# More GitHub Actions for Azure: https://github.com/Azure/actions | ||
|
||
name: Build and deploy container app to Azure Web App - speckle-v2-webhook-prod-web | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: 'ubuntu-latest' | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Log in to registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: https://arupspecklev2prodacr.azurecr.io/ | ||
username: ${{ secrets.AzureAppService_ContainerUsername_592a6616f6cc45a5a547a318c5808ddf }} | ||
password: ${{ secrets.AzureAppService_ContainerPassword_1a4296e21ed54d00ad50079f39c4ae7c }} | ||
|
||
- name: Build and push container image to registry | ||
uses: docker/build-push-action@v2 | ||
with: | ||
push: true | ||
tags: arupspecklev2prodacr.azurecr.io/${{ secrets.AzureAppService_ContainerUsername_592a6616f6cc45a5a547a318c5808ddf }}/arupspecklev2prodacr/webhook-service:${{ github.sha }} | ||
file: ./packages/webhook-service/Dockerfile | ||
|
||
deploy: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
environment: | ||
name: 'p500-webhook-service' | ||
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} | ||
|
||
steps: | ||
- name: Deploy to Azure Web App | ||
id: deploy-to-webapp | ||
uses: azure/webapps-deploy@v2 | ||
with: | ||
app-name: 'speckle-v2-webhook-prod-web' | ||
slot-name: 'production' | ||
publish-profile: ${{ secrets.AzureAppService_PublishProfile_54dd1b5256ec4f1d92dbbba7abe745ec }} | ||
images: 'arupspecklev2prodacr.azurecr.io/${{ secrets.AzureAppService_ContainerUsername_592a6616f6cc45a5a547a318c5808ddf }}/arupspecklev2prodacr/webhook-service:${{ github.sha }}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy | ||
# More GitHub Actions for Azure: https://github.com/Azure/actions | ||
|
||
name: P500 Backend | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: 'ubuntu-latest' | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Log in to registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: https://arupspecklev2prodacr.azurecr.io/ | ||
username: ${{ secrets.AzureAppService_ContainerUsername_ff44661e05e94e0aa89a43eaf41808c7 }} | ||
password: ${{ secrets.AzureAppService_ContainerPassword_07bfd3cf925041cb9246f1fe66fb8d17 }} | ||
|
||
- name: Build and push container image to registry | ||
uses: docker/build-push-action@v2 | ||
with: | ||
push: true | ||
tags: arupspecklev2prodacr.azurecr.io/${{ secrets.AzureAppService_ContainerUsername_ff44661e05e94e0aa89a43eaf41808c7 }}/backend:${{ github.sha }} | ||
file: ./packages/server/Dockerfile | ||
build-args: SPECKLE_SERVER_VERSION=v${{ github.sha }} | ||
|
||
deploy: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
environment: | ||
name: 'p500-backend' | ||
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} | ||
|
||
steps: | ||
- name: Deploy to Azure Web App | ||
id: deploy-to-webapp | ||
uses: azure/webapps-deploy@v2 | ||
with: | ||
app-name: 'speckle-v2-backend-prod-web' | ||
slot-name: 'production' | ||
publish-profile: ${{ secrets.AzureAppService_PublishProfile_f2962ef2bf0146968e6b35c963f8aa43 }} | ||
images: 'arupspecklev2prodacr.azurecr.io/${{ secrets.AzureAppService_ContainerUsername_ff44661e05e94e0aa89a43eaf41808c7 }}/backend:${{ github.sha }}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy | ||
# More GitHub Actions for Azure: https://github.com/Azure/actions | ||
|
||
name: P500 Frontend | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: 'ubuntu-latest' | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Log in to registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: https://arupspecklev2prodacr.azurecr.io/ | ||
username: ${{ secrets.AzureAppService_ContainerUsername_de098371e29a46b5b05da0397be4e193 }} | ||
password: ${{ secrets.AzureAppService_ContainerPassword_f29c00baef67447a86121de1ccf89ba5 }} | ||
|
||
- name: Build and push container image to registry | ||
uses: docker/build-push-action@v2 | ||
with: | ||
push: true | ||
tags: arupspecklev2prodacr.azurecr.io/${{ secrets.AzureAppService_ContainerUsername_de098371e29a46b5b05da0397be4e193 }}/frontend:${{ github.sha }} | ||
file: ./packages/frontend/Dockerfile | ||
build-args: | | ||
VUE_APP_GRAPHQL_WS=wss://${{ secrets.P500_SPECKLE_BACKEND }}/graphql | ||
secrets: | | ||
"posthog_api_key=${{ secrets.POSTHOG_API_KEY }}" | ||
deploy: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
environment: | ||
name: 'p500-frontend' | ||
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} | ||
|
||
steps: | ||
- name: Deploy to Azure Web App | ||
id: deploy-to-webapp | ||
uses: azure/webapps-deploy@v2 | ||
with: | ||
app-name: 'speckle-v2-frontend-prod-web' | ||
slot-name: 'production' | ||
publish-profile: ${{ secrets.AzureAppService_PublishProfile_bad3a6f5559c46fc9ca24925c2190beb }} | ||
images: 'arupspecklev2prodacr.azurecr.io/${{ secrets.AzureAppService_ContainerUsername_de098371e29a46b5b05da0397be4e193 }}/frontend:${{ github.sha }}' |
51 changes: 51 additions & 0 deletions
51
.github/workflows/preview-service-debug_speckle-v2-preview-prod.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy | ||
# More GitHub Actions for Azure: https://github.com/Azure/actions | ||
|
||
name: Build and deploy container app to Azure Web App - speckle-v2-preview-prod | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: 'ubuntu-latest' | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Log in to registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: https://arupspecklev2prodacr.azurecr.io/ | ||
username: ${{ secrets.AzureAppService_ContainerUsername_4cad90ecad8440b5aac524055c5fae59 }} | ||
password: ${{ secrets.AzureAppService_ContainerPassword_30b7688af0df4df883a0e68be50b8636 }} | ||
|
||
- name: Build and push container image to registry | ||
uses: docker/build-push-action@v2 | ||
with: | ||
push: true | ||
tags: arupspecklev2prodacr.azurecr.io/${{ secrets.AzureAppService_ContainerUsername_4cad90ecad8440b5aac524055c5fae59 }}/arupspecklev2prodacr/arupspecklev2prodacr/preview-service:${{ github.sha }} | ||
file: ./packages/preview-service/Dockerfile | ||
|
||
deploy: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
environment: | ||
name: 'p500 - Preview Service' | ||
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} | ||
|
||
steps: | ||
- name: Deploy to Azure Web App | ||
id: deploy-to-webapp | ||
uses: azure/webapps-deploy@v2 | ||
with: | ||
app-name: 'speckle-v2-preview-prod' | ||
slot-name: 'production' | ||
publish-profile: ${{ secrets.AzureAppService_PublishProfile_9db157e7b79b464dbddd000d57abd0c9 }} | ||
images: 'arupspecklev2prodacr.azurecr.io/${{ secrets.AzureAppService_ContainerUsername_4cad90ecad8440b5aac524055c5fae59 }}/arupspecklev2prodacr/arupspecklev2prodacr/preview-service:${{ github.sha }}' |
Oops, something went wrong.