Skip to content

Commit dffe8ff

Browse files
authored
Merge branch 'main-enterprise' into dependabot/npm_and_yarn/eslint/eslintrc-3.1.0
2 parents 6629dbe + b3b8cb5 commit dffe8ff

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+4387
-2108
lines changed

.devcontainer/Dockerfile

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.195.0/containers/javascript-node/.devcontainer/base.Dockerfile
22
# [Choice] Node.js version (use -bullseye variants on local arm64/Apple Silicon): 16, 14, 12, 16-bullseye, 14-bullseye, 12-bullseye, 16-buster, 14-buster, 12-buster
3-
ARG VARIANT=16-bullseye
4-
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT}
3+
ARG VARIANT=20-bookworm
4+
FROM mcr.microsoft.com/devcontainers/javascript-node:1-${VARIANT}
55

66
# [Optional] Uncomment this section to install additional OS packages.
77
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
8-
&& apt-get -y install --no-install-recommends python pip
8+
&& apt-get -y install --no-install-recommends python3 python3-pip
99

1010
# [Optional] Uncomment if you want to install an additional version of node using nvm
1111
# ARG EXTRA_NODE_VERSION=10
@@ -17,6 +17,14 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
1717
# Update npm
1818
RUN npm install -g npm
1919
# Intall aws cli
20-
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip" && unzip awscliv2.zip && sudo ./aws/install
20+
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-$(uname -m).zip" -o "awscliv2.zip" && \
21+
unzip awscliv2.zip && \
22+
sudo ./aws/install && \
23+
rm -rf ./aws && \
24+
rm awscliv2.zip
2125
# Install sam cli
22-
RUN pip install aws-sam-cli
26+
RUN curl -L "https://github.com/aws/aws-sam-cli/releases/latest/download/aws-sam-cli-linux-$(dpkg --print-architecture).zip" -o "aws-sam-cli.zip" && \
27+
unzip aws-sam-cli.zip -d sam-installation && \
28+
sudo ./sam-installation/install && \
29+
rm -rf ./sam-installation && \
30+
rm aws-sam-cli.zip

.devcontainer/devcontainer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// Update 'VARIANT' to pick a Node version: 16, 14, 12.
88
// Append -bullseye or -buster to pin to an OS version.
99
// Use -bullseye variants on local arm64/Apple Silicon.
10-
"args": { "VARIANT": "16-bullseye" }
10+
"args": { "VARIANT": "20-bookworm" }
1111
},
1212

1313
"settings": {},
@@ -34,4 +34,4 @@
3434

3535
"remoteUser": "node",
3636

37-
}
37+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Delete old releases
2+
permissions: write-all
3+
4+
on:
5+
workflow_dispatch:
6+
inputs:
7+
beforeDate:
8+
type: string
9+
required: true
10+
description: YYYY-MM-DD - All releases before this date are deleted.
11+
default: "2024-01-01"
12+
13+
jobs:
14+
delete-releases:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Delete releases
18+
run: |
19+
for i in $(gh release list --repo https://github.com/$GITHUB_REPOSITORY --json createdAt,tagName --limit 1000 | jq --arg date $BEFORE_DATE '.[] | select(.createdAt < $date ) | .tagName' | tr -d '"'); do gh release delete $i -y --cleanup-tag --repo https://github.com/$GITHUB_REPOSITORY ; done
20+
echo Deleted releases before $BEFORE_DATE in https://github.com/$GITHUB_REPOSITORY >> $GITHUB_STEP_SUMMARY
21+
env:
22+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
BEFORE_DATE: ${{ inputs.beforeDate }}
24+
25+

.github/workflows/deploy-k8s.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,35 +29,35 @@ jobs:
2929
steps:
3030
- name: Checkout repository
3131
uses: actions/checkout@v4
32-
- uses: azure/login@v1
32+
- uses: azure/login@v2
3333
with:
3434
client-id: ${{ secrets.AZURE_CLIENT_ID }}
3535
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
3636
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
37-
- uses: azure/aks-set-context@v3
37+
- uses: azure/aks-set-context@v4
3838
with:
3939
resource-group: ${{env.AZURE_RESOURCE_GROUP}}
4040
cluster-name: ${{env.AZURE_AKS_CLUSTER}}
4141
id: login
4242
- run: |
4343
kubectl get deployment
4444
- name: app-env
45-
uses: azure/k8s-create-secret@v4
45+
uses: azure/k8s-create-secret@v5
4646
with:
4747
namespace: 'default'
4848
secret-type: 'generic'
4949
arguments: --from-literal=APP_ID=${{ secrets.APP_ID }} --from-literal=PRIVATE_KEY=${{ secrets.PRIVATE_KEY }} --from-literal=WEBHOOK_SECRET=${{ secrets.WEBHOOK_SECRET }}
5050
secret-name: app-env
5151
- name: Set imagePullSecret
52-
uses: azure/k8s-create-secret@v4
52+
uses: azure/k8s-create-secret@v5
5353
with:
5454
namespace: ${{env.AZURE_AKS_NAMESPACE}}
5555
container-registry-url: ${{env.IMAGE_REGISTRY_URL}}
5656
container-registry-username: ${{ secrets.DOCKER_USERNAME }}
5757
container-registry-password: ${{ secrets.DOCKER_PASSWORD }}
5858
secret-name: 'image-pull-secret'
5959
id: create-secret
60-
- uses: Azure/k8s-deploy@v4.10
60+
- uses: Azure/k8s-deploy@v5
6161
with:
6262
namespace: ${{env.AZURE_AKS_NAMESPACE}}
6363
manifests: |

.github/workflows/node-ci.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@ jobs:
1515
- name: Setup node
1616
uses: actions/setup-node@v4
1717
with:
18-
node-version: 16.x
18+
node-version: ${{ matrix.node-version }}
1919
cache: npm
2020
- run: npm install
2121
- run: npm run test:unit:ci
22+
strategy:
23+
matrix:
24+
node-version:
25+
- 18
26+
- 20

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v16
1+
v20

Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:16-alpine
1+
FROM node:20-alpine
22
WORKDIR /opt/safe-settings
33
ENV NODE_ENV production
44
## Set the Labels
@@ -8,12 +8,12 @@ LABEL version="1.0" \
88

99
## These files are copied separately to allow updates
1010
## to the image to be as small as possible
11-
COPY package.json /opt/safe-settings/
11+
COPY package*.json /opt/safe-settings/
1212
COPY index.js /opt/safe-settings/
1313
COPY lib /opt/safe-settings/lib
1414

1515
## Install the app and dependencies
16-
RUN npm install
16+
RUN npm ci
1717

1818
## This app will listen on port 3000
1919
EXPOSE 3000
@@ -22,4 +22,4 @@ USER node
2222

2323
## This does not start properly when using the ['npm','start'] format
2424
## so stick with just calling it outright
25-
CMD npm start
25+
CMD npm start

0 commit comments

Comments
 (0)