Skip to content

Commit ddc98fe

Browse files
committed
fix conflict
2 parents 7cb6047 + f4b259f commit ddc98fe

File tree

496 files changed

+54298
-33807
lines changed

Some content is hidden

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

496 files changed

+54298
-33807
lines changed

.ci/Dockerfile

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,15 @@
11
#syntax=docker/dockerfile:1.2
2-
FROM node:14 as build
3-
WORKDIR /lambda
2+
FROM node:20 as build
3+
WORKDIR /lambdas
44
RUN apt-get update \
55
&& apt-get install -y zip \
66
&& rm -rf /var/lib/apt/lists/*
77

8-
FROM build as runner-binaries-syncer
9-
COPY modules/runner-binaries-syncer/lambdas/runner-binaries-syncer /lambda
10-
RUN --mount=type=cache,target=/lambda/node_modules,id=runner-binaries-syncer \
11-
yarn install && yarn dist
12-
13-
FROM build as runners
14-
COPY modules/runners/lambdas/runners /lambda
15-
RUN --mount=type=cache,target=/lambda/node_modules,id=runners \
16-
yarn install && yarn dist
17-
18-
FROM build as webhook
19-
COPY modules/webhook/lambdas/webhook /lambda
20-
RUN --mount=type=cache,target=/lambda/node_modules,id=webhook \
21-
yarn install && yarn dist
8+
FROM build as lambdas
9+
COPY lambdas /lambdas
10+
RUN --mount=type=cache,target=/work/node_modules,id=lambdas \
11+
yarn install --frozen-lockfile && yarn dist && \
12+
find . -name "*.zip" -exec cp {} . \;
2213

2314
FROM scratch as final
24-
COPY --from=runner-binaries-syncer /lambda/runner-binaries-syncer.zip /runner-binaries-syncer.zip
25-
COPY --from=runners /lambda/runners.zip /runners.zip
26-
COPY --from=webhook /lambda/webhook.zip /webhook.zip
15+
COPY --from=lambdas /lambdas/*.zip /

.ci/build-yarn.sh

Lines changed: 0 additions & 11 deletions
This file was deleted.

.ci/terraform-init-all.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/usr/bin/env bash
2+
3+
# This script will run terraform init in all subdirectories of the examples directory
4+
# required to run tflint via pre-commit
5+
6+
# only run the script if a uniique pid file exits if not creat it or --force flag is passed
7+
pid="/tmp/philips-labs-terraform-aws-github-runner.pid"
8+
if [ "$1" == "--force" ]; then
9+
rm -f /tmp/philips-labs-terraform-aws-github-runner.pid
10+
fi
11+
12+
if [ ! -f $pid ]; then
13+
echo $$ > $pid
14+
else
15+
echo "Init all terraform directories will be skipped. To run the script remove the file $pid or run with --force"
16+
exit 0
17+
fi
18+
19+
# Change to the examples directory
20+
example_dirs=$(find examples -mindepth 1 -maxdepth 2 -type d | grep -v "templates")
21+
module_dirs=$(find modules -mindepth 1 -maxdepth 2 -type d | grep -v "templates")
22+
23+
# merge example_dirs and module_dirs in terraform_dirs
24+
terraform_dirs=$(echo $example_dirs $module_dirs "modules/runners/pool" | tr " " "\n" | sort -u | tr "\n" " ")
25+
26+
for dir in $terraform_dirs; do
27+
# Check if the subdirectory exists in Git
28+
if git rev-parse --is-inside-work-tree &>/dev/null && git ls-files --error-unmatch "$dir" &>/dev/null; then
29+
echo "Running terraform init in ${dir} - supressing output"
30+
pushd "$dir" >/dev/null
31+
terraform init -lockfile=readonly -backend=false &>/dev/null || true
32+
popd >/dev/null
33+
fi
34+
done

.devcontainer/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ARG VARIANT="20-bullseye"
2+
FROM mcr.microsoft.com/vscode/devcontainers/typescript-node:0-${VARIANT}

.devcontainer/bashrc.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
open_workspace() {
2+
local workspace_file=$WORKSPACE/.vscode/gh-runners.code-workspace
3+
4+
if ! [ -f "$workspace_file" ]; then
5+
echo "🔴 Missing workspace file"
6+
return 1
7+
fi
8+
9+
echo "🟡 Opening workspace"
10+
if code "$workspace_file"; then
11+
echo "🟢 Workspace opened"
12+
return 0
13+
else
14+
echo "🔴 Failed to open workspace"
15+
return 1
16+
fi
17+
}

.devcontainer/devcontainer.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"name": "GitHub Runners AWS",
3+
"build": { "dockerfile": "Dockerfile" },
4+
"features": {
5+
"ghcr.io/devcontainers/features/github-cli:1": {},
6+
"ghcr.io/devcontainers/features/terraform:1": {}
7+
},
8+
9+
"containerEnv": {
10+
"WORKSPACE": "${containerWorkspaceFolder}" // e.g. /workspaces/my-project
11+
},
12+
13+
"customizations": {
14+
"vscode": {
15+
"extensions": [
16+
"dbaeumer.vscode-eslint",
17+
"editorconfig.editorconfig",
18+
"esbenp.prettier-vscode",
19+
"firsttris.vscode-jest-runner",
20+
"hashicorp.hcl",
21+
"hashicorp.terraform",
22+
"hashicorp.terraform",
23+
"orta.vscode-jest",
24+
"yzhang.markdown-all-in-one"
25+
]
26+
}
27+
},
28+
"postCreateCommand": {
29+
"bash_command": "bash ${containerWorkspaceFolder}/.devcontainer/postCreateScript.sh",
30+
"welcome": "sudo cp -v .devcontainer/welcome.txt /usr/local/etc/vscode-dev-containers/first-run-notice.txt || true && sudo cp -v .devcontainer/welcome.txt /workspaces/.codespaces/shared/first-run-notice.txt || true"
31+
}
32+
}

.devcontainer/postCreateScript.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
printf "source \$WORKSPACE/.devcontainer/bashrc.sh\n" >> ~/.bashrc

.devcontainer/welcome.txt

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
================================================================================
2+
================================================================================
3+
=====================================================++++**+++==================
4+
=================================================+++++=********+================
5+
=============================================+***+=--:-#********+===============
6+
==========================================+***+=--:::::-+*#*****+===============
7+
=======================================+*#%*=--:::::::::::-=====+===============
8+
=====================================+#%%##%*-:::::::::::::::::+================
9+
===========================++======*#%%#######=-::::::::::::::=+================
10+
=======================++==---::-+#%%###########+-:::::::::::-+=================
11+
====================+==-::::::-=#%%################+=::::::::+==================
12+
=================++=-:::::::-=#%%%####%%##**########%#*++=-:++==================
13+
===============+=-:::-------*%%%###%%%#=:...:-*############*+===================
14+
=====. .-====-:--++***+++#%%###%#%%+: .-*###########+====================
15+
===-. --:-++**+=====+%%%###%%#%*- :*#########*======================
16+
=== .:==++=========*%%%#####%#%*=. .=#########*=======================
17+
===: :: .==========+%%%%#####%%%%#+=-:::-+#########+========================
18+
====: :=========#%%%%#####%#**#####*##########+==========================
19+
==== .=========%%%%%####*+=*%##############=============================
20+
====-.... :--------=##%%%%#*==*%##############=::++==========================
21+
========--::---------=-=#%%%#+=#%#############*=-::-*===========================
22+
======------------=+*=---*#++*%#############+-:::::++===========================
23+
=====----------=+*+=+---=++*%%%%#########**+-:::::++============================
24+
===----------+*+=-+*+-=+=*#+=*%%%%%%%#*+==+#=:::-*+=============================
25+
==---------+**+-=**+===**=-=--=+***+======#+-::=+===============================
26+
==----------+=-=**=:=+*=--++---==========**=:-++================================
27+
=---------=*=-=**=::::--=*+----=-:::-===**=-=+==================================
28+
=--------=*=-+**+::-=*+=*+-----=. ..=+==+====================================
29+
=-------==--***+=+**=*+*=------. -+=..=====================================
30+
=------=--=***+**+=-+*+------==. .=+: .=====================================
31+
=--------=*****+---++=-----===== .=: :======================================
32+
==------=***+=----==-----======- -=======================================
33+
===----=*+=------=-----=========: .========================================
34+
====--==------------==============--============================================
35+
======--------==================================================================
36+
================================================================================
37+
================================================================================
38+
================================================================================
39+
================================================================================
40+
==========================================================================-:-=++
41+
42+
43+
Welcome to the AWS GitHub runners:
44+
45+
Load the vscode workspace to get started
46+
47+
Option 1: run `open_workspace`
48+
Option 2: open the workspace file `.vscoe/gh-runners.code-workspace` and load the workspace
49+
50+
Build the lambda:
51+
- cd lambdas
52+
- yarn instal & yarn run dist
53+

.editorconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,13 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
16
[*]
7+
indent_style = space
8+
indent_size = 2
9+
tab_width = 2
210
end_of_line = lf
11+
charset = utf-8
12+
trim_trailing_whitespace = true
13+
insert_final_newline = true

.github/dependabot.yml

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
# Please see the documentation for all configuration options:
44
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
55

6+
# NPM production dependencies are part of the generated Lambda JavaScript.
7+
# Therefore updates on production are prefixed with fix(component) to trigger releases.
8+
# Development updates are prefixed with chore, and not triggering a release.
9+
610
version: 2
711
updates:
812
- package-ecosystem: "github-actions"
@@ -13,21 +17,27 @@ updates:
1317
interval: "weekly"
1418

1519
- package-ecosystem: "npm"
16-
directory: "/modules/runner-binaries-syncer/lambdas/runner-binaries-syncer"
17-
schedule:
18-
interval: "weekly"
19-
20-
- package-ecosystem: "npm"
21-
directory: "/modules/webhook/lambdas/webhook"
22-
schedule:
23-
interval: "weekly"
24-
25-
- package-ecosystem: "npm"
26-
directory: "/modules/runners/lambdas/runners"
20+
directory: "/lambdas"
2721
schedule:
2822
interval: "weekly"
23+
groups:
24+
aws:
25+
patterns:
26+
- "@aws-sdk/*"
27+
octokit:
28+
patterns:
29+
- "@octokit/*"
30+
aws-powertools:
31+
patterns:
32+
- "@aws-lambda-powertools/*"
2933

30-
- package-ecosystem: "npm"
31-
directory: "/.release"
32-
schedule:
33-
interval: "weekly"
34+
ignore:
35+
- dependency-name: "@middy/core"
36+
update-types: ["version-update:semver-major"]
37+
- dependency-name: "@octokit/*"
38+
update-types: ["version-update:semver-major"]
39+
- dependency-name: "eslint"
40+
update-types: ["version-update:semver-major"]
41+
commit-message:
42+
prefix: "fix(lambda)"
43+
prefix-development: "chore(lambda)"

0 commit comments

Comments
 (0)