-
Notifications
You must be signed in to change notification settings - Fork 628
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add support for codespaces / devcontainers (#3632)
Adding basic support for codespaces.
- Loading branch information
Showing
5 changed files
with
105 additions
and
0 deletions.
There are no files selected for viewing
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,2 @@ | ||
ARG VARIANT="18-bullseye" | ||
FROM mcr.microsoft.com/vscode/devcontainers/typescript-node:0-${VARIANT} |
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,17 @@ | ||
open_workspace() { | ||
local workspace_file=$WORKSPACE/.vscode/gh-runners.code-workspace | ||
|
||
if ! [ -f "$workspace_file" ]; then | ||
echo "🔴 Missing workspace file" | ||
return 1 | ||
fi | ||
|
||
echo "🟡 Opening workspace" | ||
if code "$workspace_file"; then | ||
echo "🟢 Workspace opened" | ||
return 0 | ||
else | ||
echo "🔴 Failed to open workspace" | ||
return 1 | ||
fi | ||
} |
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,32 @@ | ||
{ | ||
"name": "GitHub Runners AWS", | ||
"build": { "dockerfile": "Dockerfile" }, | ||
"features": { | ||
"ghcr.io/devcontainers/features/github-cli:1": {}, | ||
"ghcr.io/devcontainers/features/terraform:1": {} | ||
}, | ||
|
||
"containerEnv": { | ||
"WORKSPACE": "${containerWorkspaceFolder}" // e.g. /workspaces/my-project | ||
}, | ||
|
||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"dbaeumer.vscode-eslint", | ||
"editorconfig.editorconfig", | ||
"esbenp.prettier-vscode", | ||
"firsttris.vscode-jest-runner", | ||
"hashicorp.hcl", | ||
"hashicorp.terraform", | ||
"hashicorp.terraform", | ||
"orta.vscode-jest", | ||
"yzhang.markdown-all-in-one" | ||
] | ||
} | ||
}, | ||
"postCreateCommand": { | ||
"bash_command": "bash ${containerWorkspaceFolder}/.devcontainer/postCreateScript.sh", | ||
"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" | ||
} | ||
} |
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 @@ | ||
printf "source \$WORKSPACE/.devcontainer/bashrc.sh\n" >> ~/.bashrc |
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,53 @@ | ||
================================================================================ | ||
================================================================================ | ||
=====================================================++++**+++================== | ||
=================================================+++++=********+================ | ||
=============================================+***+=--:-#********+=============== | ||
==========================================+***+=--:::::-+*#*****+=============== | ||
=======================================+*#%*=--:::::::::::-=====+=============== | ||
=====================================+#%%##%*-:::::::::::::::::+================ | ||
===========================++======*#%%#######=-::::::::::::::=+================ | ||
=======================++==---::-+#%%###########+-:::::::::::-+================= | ||
====================+==-::::::-=#%%################+=::::::::+================== | ||
=================++=-:::::::-=#%%%####%%##**########%#*++=-:++================== | ||
===============+=-:::-------*%%%###%%%#=:...:-*############*+=================== | ||
=====. .-====-:--++***+++#%%###%#%%+: .-*###########+==================== | ||
===-. --:-++**+=====+%%%###%%#%*- :*#########*====================== | ||
=== .:==++=========*%%%#####%#%*=. .=#########*======================= | ||
===: :: .==========+%%%%#####%%%%#+=-:::-+#########+======================== | ||
====: :=========#%%%%#####%#**#####*##########+========================== | ||
==== .=========%%%%%####*+=*%##############============================= | ||
====-.... :--------=##%%%%#*==*%##############=::++========================== | ||
========--::---------=-=#%%%#+=#%#############*=-::-*=========================== | ||
======------------=+*=---*#++*%#############+-:::::++=========================== | ||
=====----------=+*+=+---=++*%%%%#########**+-:::::++============================ | ||
===----------+*+=-+*+-=+=*#+=*%%%%%%%#*+==+#=:::-*+============================= | ||
==---------+**+-=**+===**=-=--=+***+======#+-::=+=============================== | ||
==----------+=-=**=:=+*=--++---==========**=:-++================================ | ||
=---------=*=-=**=::::--=*+----=-:::-===**=-=+================================== | ||
=--------=*=-+**+::-=*+=*+-----=. ..=+==+==================================== | ||
=-------==--***+=+**=*+*=------. -+=..===================================== | ||
=------=--=***+**+=-+*+------==. .=+: .===================================== | ||
=--------=*****+---++=-----===== .=: :====================================== | ||
==------=***+=----==-----======- -======================================= | ||
===----=*+=------=-----=========: .======================================== | ||
====--==------------==============--============================================ | ||
======--------================================================================== | ||
================================================================================ | ||
================================================================================ | ||
================================================================================ | ||
================================================================================ | ||
==========================================================================-:-=++ | ||
|
||
|
||
Welcome to the AWS GitHub runners: | ||
|
||
Load the vscode workspace to get started | ||
|
||
Option 1: run `open_workspace` | ||
Option 2: open the workspace file `.vscoe/gh-runners.code-workspace` and load the workspace | ||
|
||
Build the lambda: | ||
- cd lambdas | ||
- yarn instal & yarn run dist | ||
|