Skip to content

Commit e044d9c

Browse files
authored
Lamby v4, Dev Containers, & More! (#21)
1 parent 4540320 commit e044d9c

Some content is hidden

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

94 files changed

+750
-862
lines changed

.devcontainer/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
FROM ruby:3.1-bullseye

.devcontainer/devcontainer.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"build": {
3+
"dockerfile": "Dockerfile"
4+
},
5+
"features": {
6+
"ghcr.io/devcontainers/features/common-utils": {},
7+
"ghcr.io/devcontainers/features/sshd:latest": {}
8+
},
9+
"remoteUser": "vscode"
10+
}

Dockerfile

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

README.md

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,42 @@
11
# Lamby Cookiecutter
22

3-
<a href="https://lamby.custominktech.com"><img src="https://user-images.githubusercontent.com/2381/59363668-89edeb80-8d03-11e9-9985-2ce14361b7e3.png" alt="Lamby: Simple Rails & AWS Lambda Integration using Rack." align="right" width="300" /></a>
3+
<a href="https://lamby.custominktech.com"><img src="https://raw.githubusercontent.com/customink/lamby/master/images/social2.png" alt="Lamby: Simple Rails & AWS Lambda Integration using Rack." align="right" width="450" style="margin-left:1rem;margin-bottom:1rem;" /></a>
44

55
An [AWS SAM cookiecutter](https://technology.customink.com/blog/2020/03/13/using-aws-sam-cookiecutter-project-templates-to-kickstart-your-ambda-projects/) project template to quickly create a new Rails application for AWS Lambda. Details:
66

7-
- Rails v6.x on Ruby 2.7 runtime.
8-
- Integrated JavaScript development.
9-
- Compiles CSS/JS assets.
10-
- No ActiveRecord. Read our [Database Options](https://lamby.custominktech.com/docs/database_options) guides.
7+
- Rails v7.x on Ruby 3.1 runtime.
8+
- Integrated JavaScript & CSS Development.
9+
- CI/CD GitHub Actions for Test & Deploy.
1110

1211
**[Lamby: Simple Rails & AWS Lambda Integration using Rack.](https://lamby.custominktech.com)**
1312

1413
## Usage
1514

16-
⚠️ Please reference the full [Quick Start](https://lamby.custominktech.com/docs/quick_start) guide on the Lamby site for details. Basic usage is:
17-
18-
### SAM Init
19-
20-
If you have the [AWS SAM CLI](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/what-is-sam.html) already installed, use the first command. If not, use the second Docker based command.
21-
22-
```shell
23-
$ sam init --location "gh:customink/lamby-cookiecutter"
24-
```
15+
⚠️ Please reference the full [Quick Start](https://lamby.custominktech.com/docs/quick_start) guide on the Lamby site for details. Basic usage requires Docker to be installed to run the Cookiecutter software using the following command.
2516

2617
```shell
2718
$ docker run \
2819
--rm \
2920
--interactive \
3021
--volume "${PWD}:/var/task" \
31-
public.ecr.aws/sam/build-ruby2.7 \
32-
sam init --location "gh:customink/lamby-cookiecutter"
33-
```
34-
35-
### Setup & Deploy (within project)
36-
37-
```shell
38-
$ ./bin/bootstrap
39-
$ ./bin/setup
40-
$ ./bin/deploy
22+
ghcr.io/customink/lamby-cookiecutter \
23+
"gh:customink/lamby-cookiecutter"
4124
```
4225

4326
## Contributing
4427

45-
This starter project is 100% scripted within Docker using the scripts in the `bin` directory. To build run the following commands.
28+
This project is built for [GitHub Codespcaes](https://github.com/features/codespaces) using the [Development Container](https://containers.dev) specification. Once you have the repo cloned and setup with a dev container using either Codespaces or [VS Code](#using-vs-code), run the following commands. This will install Rails and build the Cookiecutter project with any local changes.
4629

4730
```shell
48-
./bin/bootstrap
49-
./bin/build
31+
$ ./bin/build
5032
```
5133

34+
#### Using VS Code
35+
36+
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. This allows you to use the integrated terminal for the command above.
37+
5238
## Code of Conduct
5339

5440
Everyone interacting in the Lamby project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/customink/lamby/blob/master/CODE_OF_CONDUCT.md).
41+
42+
Bug reports and pull requests are welcome on GitHub at https://github.com/customink/lamby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.

bin/_build

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

bin/_lambify

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

bin/bootstrap

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

bin/build

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/sh
22
set -e
33

4-
docker-compose run \
5-
build \
6-
./bin/_build
4+
./bin/rails-new
5+
./bin/lambify
6+
./bin/inserts
7+
./bin/cleanup

bin/_cleanup renamed to bin/cleanup

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ PROJECT_FOLDER="{{cookiecutter.project_name}}"
77
cd $PROJECT_FOLDER
88

99
rm -rf ./.git \
10+
./config/puma \
1011
./config/master.key \
1112
./config/credentials.yml.enc \
1213
./Gemfile.lock \

bin/_inserts renamed to bin/inserts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,21 @@ insert_file_over_pattern () {
1313
sed --in-place "${rline}r ../inserts/${1}" $1
1414
}
1515

16-
# Replace `RenameMe` module namespace with cookiecutter's name.
16+
# We are leaning into dev containers. More: https://containers.dev
17+
#
18+
cp -r ../inserts/.devcontainer .
19+
20+
# Replace RenameMe|rename_me with cookiecutter's name.
1721
#
1822
sed --in-place \
1923
's/RenameMe/{% include "_cctmp\/class_name.txt" %}/' \
2024
config/application.rb
25+
sed --in-place \
26+
's/rename_me_production/{% include "_cctmp\/dash_name.txt" %}-production/' \
27+
config/cable.yml
28+
sed --in-place \
29+
's/rename_me_production/{% include "_cctmp\/dash_name.txt" %}-production/' \
30+
config/environments/production.rb
2131

2232
# Create a simple welcome to Lamby/Rails index page. To do
2333
# this we need a simple starter route, view layout and template.

0 commit comments

Comments
 (0)