Skip to content

Commit 576b3e5

Browse files
committed
Docs for Codesacpaces, VS Code, or Dev Containers CLI.
1 parent e1775da commit 576b3e5

File tree

5 files changed

+27
-13
lines changed

5 files changed

+27
-13
lines changed

README.md

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -170,36 +170,50 @@ Please use AWS' [Restricting access to Systems Manager parameters using IAM poli
170170

171171
## Development
172172

173-
This project is built for [GitHub Codespcaes](https://github.com/features/codespaces) which may not be available to everyone. Thankfully you can use this same devcontainer.json specification automatically with [VS Code Remote Development](https://code.visualstudio.com/docs/remote/remote-overview) which allows you to clone this repo and [open the folder in a container](https://code.visualstudio.com/docs/remote/containers#_quick-start-open-an-existing-folder-in-a-container).
173+
This project is built for [GitHub Codespcaes](https://github.com/features/codespaces) using the [Development Container](https://containers.dev) specification. Even though Codespaces may not be available to everyone, this project's containers are easy to work for anyone with any editor.
174+
175+
Our development container is based on the [vscode-remote-try-rust](https://github.com/microsoft/vscode-remote-try-rust) demo project. For details on the VS Code Rust development container, have a look at the [container's history](https://github.com/microsoft/vscode-dev-containers/tree/main/containers/rust/history). Once you have the repo cloned and setup with a dev container using Codespaces, [VS Code](#using-vs-code), or the [Dev Container CLI](#dev-container-cli), run the following commands. This will install packages, build your project, and run tests without needing to connect to SSM.
174176

175-
Our development container is based on the [vscode-remote-try-rust](https://github.com/microsoft/vscode-remote-try-rust) demo project. For details on the VS Code Rust development containers, have a look here: https://github.com/microsoft/vscode-dev-containers/tree/main/containers/rust/history. Once you have the repo cloned or setup in a development container, run the following command. This will install and build your project.
176177

177178
```shell
178179
./bin/setup
180+
./bin/test-local
179181
```
180182

181-
Optionally, you can setup/build the Amazon Linux 2 files. This will use Docker in Docker to download AWS SAM & Lambda images to build cryptia using what is present (like glibc) in those environments.
183+
If you want to test SSm with your AWS account, the AWS CLI is installed on the dev container. Set it up with your **test credentials** using:
182184

183185
```shell
184-
./amzn/setup
186+
aws configure
185187
```
186188

187-
#### Running Tests
188-
189-
Requires an AWS account to populate test SSM Parameters. The AWS CLI is installed on the devcontainer. Set it up with your **test credentials** using:
189+
You can to develop the Amazon Linux 2 support, This will use Docker in Docker to download AWS SAM & Lambda images to build cryptia using what is present (like glibc) in that environment.
190190

191191
```shell
192-
aws configure
192+
./amzn/setup
193+
./amzn/test
193194
```
194195

195-
Once complete, you can run the tests using the following command. If you make changes to the code, make sure to run `bin/setup` again whick will run cargo build for you.
196+
#### Using VS Code
197+
198+
If you have the [Visual Studio Code Dev Container](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension installed you can easily clone this repo locally, use the "Open Folder in Container..." command, and use the integrated terminal for your setup and test commands. Example shown below:
199+
200+
![VS Code showing the "Dev Containers: Open Folder in Container..." command.](/images/readme-devcontainer-open-folder.png)
201+
202+
![VS Code window with the Crypteia project open in a dev container. Shown too are the tests running.](/images/readme-devcontainer-vscode.png)
203+
204+
#### Dev Container CLI
205+
206+
You can use the open-source [Dev Container CLI](https://github.com/devcontainers/cli) to mimic what Codespaces and/or VS Code are doing for you. In this way, you can use different editors. You must have Docker installed. Here are the commands to build the dev container and setup/test the project.
196207

197208
```shell
198-
./bin/test
209+
devcontainer build --workspace-folder .
210+
devcontainer up --workspace-folder .
211+
devcontainer run-user-commands --workspace-folder .
199212
```
200213

201-
Again, if you are working on the Amazon Linux 2 project files, assuming you have already run `./amzn/setup`, you can run the same tests above using that environment.
202-
203214
```shell
204-
./amzn/test
215+
devcontainer exec --workspace-folder . ./bin/setup
216+
devcontainer exec --workspace-folder . ./bin/test-local
205217
```
218+
219+
![Showing Sublime Text on a Mac using the Dev Container CLI to run Crypteia tests.](/images/readme-devcontainer-cli-sublime.png)
92.5 KB
Loading
295 KB
Loading
51.5 KB
Loading

images/readme-devcontainer-vscode.png

143 KB
Loading

0 commit comments

Comments
 (0)