Skip to content

Commit 09dfab4

Browse files
authored
Merge branch 'main-enterprise' into dependabot/github_actions/Azure/k8s-deploy-5
2 parents 1387362 + 506613f commit 09dfab4

Some content is hidden

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

50 files changed

+8861
-13784
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+
}

.github/workflows/create-pre-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
steps:
4141
- uses: actions/checkout@v4
4242
- name: Setup node
43-
uses: actions/setup-node@v3
43+
uses: actions/setup-node@v4
4444
with:
4545
node-version: 16.x
4646
cache: 'npm'

.github/workflows/create-release.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
steps:
1919
- uses: actions/checkout@v4
2020
- name: Setup node
21-
uses: actions/setup-node@v3
21+
uses: actions/setup-node@v4
2222
with:
2323
node-version: 16.x
2424
cache: "npm"
@@ -68,6 +68,7 @@ jobs:
6868

6969
helm:
7070
runs-on: ubuntu-latest
71+
needs: build
7172
steps:
7273
- name: Clone repo
7374
uses: actions/checkout@v4
@@ -84,8 +85,8 @@ jobs:
8485
run: |
8586
cd helm
8687
helm registry login -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }} ghcr.io
87-
helm package --app-version ${{ github.ref_name }} --version ${{ github.ref_name }} safe-settings
88-
helm push safe-settings-${{ github.ref_name }}.tgz ${{ env.HELM_REPO }}
88+
helm package --app-version ${{ needs.build.outputs.release }} --version ${{ needs.build.outputs.release }} safe-settings
89+
helm push safe-settings-${{ needs.build.outputs.release }}.tgz ${{ env.HELM_REPO }}
8990
9091
#trigger-deployment:
9192
# needs: build
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: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,27 +29,27 @@ 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}}

.github/workflows/node-ci.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,14 @@ jobs:
1313
steps:
1414
- uses: actions/checkout@v4
1515
- name: Setup node
16-
uses: actions/setup-node@v3
16+
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

.github/workflows/rc-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
steps:
2626
- uses: actions/checkout@v4
2727
- name: Use Node.js
28-
uses: actions/setup-node@v3
28+
uses: actions/setup-node@v4
2929
with:
3030
node-version: 16.x
3131
cache: npm

.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)