Skip to content

Commit d8a649e

Browse files
authored
feat:http-cli version update (#12)
* chore: update Makefile to use the build-enhanced build script * chore: add build-enhanced handling of HTTP_CLI_VERSION variable * refactor: update http-cli version and improve the build process. also documents how to generate new builds when updating the http-cli version
1 parent 7fb17cb commit d8a649e

File tree

7 files changed

+52
-8
lines changed

7 files changed

+52
-8
lines changed

.github/workflows/build-and-release.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ concurrency:
2222
jobs:
2323
build-base:
2424
runs-on: ubuntu-latest
25+
env:
26+
HTTP_CLI_VERSION: v1.1.0
2527
steps:
2628
- uses: actions/checkout@v3
2729
- name: Set up Docker Buildx
@@ -47,6 +49,7 @@ jobs:
4749
--platform linux/arm64,linux/amd64 \
4850
--provenance=false \
4951
--secret id=github_token,src=github_token \
52+
--build-arg HTTP_CLI_VERSION=${{ env.HTTP_CLI_VERSION }} \
5053
--target base \
5154
--tag ghcr.io/${{ github.repository_owner }}/lambda-shell-runtime:base \
5255
--tag public.ecr.aws/j5r7n1v7/lambda-shell-runtime:base \
@@ -60,7 +63,7 @@ jobs:
6063
runs-on: ubuntu-latest
6164
if: github.event.pull_request.draft == false || github.event_name != 'pull_request'
6265
env:
63-
HTTP_CLI_VERSION: v1.0.1
66+
HTTP_CLI_VERSION: v1.1.0
6467
steps:
6568
- uses: actions/checkout@v3
6669
- uses: actions/setup-node@v3

.github/workflows/build-base.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ concurrency:
2828
jobs:
2929
build-base:
3030
runs-on: ubuntu-latest
31+
env:
32+
HTTP_CLI_VERSION: v1.1.0
3133
steps:
3234
- uses: actions/checkout@v4
3335

@@ -48,6 +50,7 @@ jobs:
4850
--platform linux/arm64 \
4951
--provenance=false \
5052
--secret id=github_token,src=github_token \
53+
--build-arg HTTP_CLI_VERSION=${{ env.HTTP_CLI_VERSION }} \
5154
--target base \
5255
--tag ghcr.io/${{ github.repository_owner }}/lambda-shell-runtime:base \
5356
--push \

.github/workflows/build-installers.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ concurrency:
1818
jobs:
1919
build-installers:
2020
runs-on: ubuntu-latest
21+
env:
22+
HTTP_CLI_VERSION: v1.1.0
2123
steps:
2224
- uses: actions/checkout@v4
2325

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM public.ecr.aws/lambda/provided:al2023 AS builder
22

3-
ARG HTTP_CLI_VERSION=v1.0.1
3+
ARG HTTP_CLI_VERSION=v1.1.0
44

55
RUN dnf install -y unzip && \
66
dnf clean all

Makefile

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,31 @@ help: ## Show this help
1111
build: tiny micro full ## Build all variants locally
1212

1313
base: ## Build base image
14-
VERSION=$(VERSION) ./build --platform $(PLATFORM) --tag $(TAG) --load base
14+
VERSION=$(VERSION) ./build-enhanced --platform $(PLATFORM) --tag $(TAG) --load base
1515

1616
tiny: base ## Build tiny variant
17-
VERSION=$(VERSION) ./build --platform $(PLATFORM) --tag $(TAG) --load tiny
17+
VERSION=$(VERSION) ./build-enhanced --platform $(PLATFORM) --tag $(TAG) --load tiny
1818

1919
micro: base ## Build micro variant
20-
VERSION=$(VERSION) ./build --platform $(PLATFORM) --tag $(TAG) --load micro
20+
VERSION=$(VERSION) ./build-enhanced --platform $(PLATFORM) --tag $(TAG) --load micro
2121

2222
full: base ## Build full variant
23-
VERSION=$(VERSION) ./build --platform $(PLATFORM) --tag $(TAG) --load full
23+
VERSION=$(VERSION) ./build-enhanced --platform $(PLATFORM) --tag $(TAG) --load full
2424

2525
push-base: ## Push base to registry
26-
VERSION=$(VERSION) ./build --platform $(PLATFORM) --tag $(REGISTRY)/$(TAG) --push base
26+
VERSION=$(VERSION) ./build-enhanced --platform $(PLATFORM) --tag $(TAG) --registry $(REGISTRY) --push base
2727

2828
push: ## Push all variants to registry
29-
VERSION=$(VERSION) ./build --platform $(PLATFORM) --tag $(REGISTRY)/$(TAG) --push tiny micro full
29+
VERSION=$(VERSION) ./build-enhanced --platform $(PLATFORM) --tag $(TAG) --registry $(REGISTRY) --push tiny micro full
30+
31+
push-ghcr: ## Push all variants to GitHub Container Registry
32+
VERSION=$(VERSION) ./build-enhanced --platform $(PLATFORM) --tag $(TAG) --ghcr --push tiny micro full
33+
34+
push-public-ecr: ## Push all variants to AWS Public ECR
35+
VERSION=$(VERSION) ./build-enhanced --platform $(PLATFORM) --tag $(TAG) --public-ecr --push tiny micro full
36+
37+
push-all: ## Push to both GHCR and Public ECR
38+
VERSION=$(VERSION) ./build-enhanced --platform $(PLATFORM) --tag $(TAG) --ghcr --public-ecr --push tiny micro full
3039

3140
clean: ## Remove local images
3241
docker rmi -f $(TAG):base $(TAG):tiny $(TAG):micro $(TAG):full 2>/dev/null || true

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,30 @@ The shell runtime is **highly competitive** with official runtimes while providi
244244
# Optimize shell script performance
245245
```
246246

247+
## Updating http-cli Version
248+
249+
The runtime includes [http-cli](https://github.com/ql4b/http-cli) for simplified HTTP operations. To update to a newer version:
250+
251+
1. **Update version in all configuration files:**
252+
- `.github/workflows/build-and-release.yml` (2 locations)
253+
- `.github/workflows/build-base.yml`
254+
- `.github/workflows/build-installers.yml`
255+
- `Dockerfile` (ARG HTTP_CLI_VERSION)
256+
- `build-enhanced` script (default value)
257+
258+
2. **Trigger a new build:**
259+
```bash
260+
# Push changes to trigger GitHub Actions
261+
git add .
262+
git commit -m "Update http-cli to vX.X.X"
263+
git push origin develop
264+
```
265+
266+
3. **Or build locally:**
267+
```bash
268+
HTTP_CLI_VERSION=v1.2.0 ./build-enhanced --load tiny
269+
```
270+
247271
## Contributing
248272

249273
We welcome contributions! Please see our [contributing guidelines](CONTRIBUTING.md) for details.

build-enhanced

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ PLATFORM="linux/arm64"
77
MODE="--load"
88
TAG="lambda-shell-runtime"
99
VERSION="${VERSION:-develop}"
10+
HTTP_CLI_VERSION="${HTTP_CLI_VERSION:-v1.0.1}"
1011
VARIANTS="base tiny micro full"
1112
REGISTRIES=""
1213

@@ -79,6 +80,8 @@ for VARIANT in $VARIANTS; do
7980
--platform "$PLATFORM" \
8081
--provenance=false \
8182
--secret id=github_token,env=GITHUB_TOKEN \
83+
--build-arg VERSION="$VERSION" \
84+
--build-arg HTTP_CLI_VERSION="$HTTP_CLI_VERSION" \
8285
$TAGS \
8386
--file "$DOCKERFILE" \
8487
${TARGET:+--target "$TARGET"} \

0 commit comments

Comments
 (0)