From 07cf37844fc948620f05bff17cf55651b733adf9 Mon Sep 17 00:00:00 2001 From: Carlo D'Ambrosio Date: Fri, 1 Aug 2025 10:52:51 +0200 Subject: [PATCH 1/3] chore: update Makefile to use the build-enhanced build script --- Makefile | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index eda0f51..3760a97 100644 --- a/Makefile +++ b/Makefile @@ -11,22 +11,31 @@ help: ## Show this help build: tiny micro full ## Build all variants locally base: ## Build base image - VERSION=$(VERSION) ./build --platform $(PLATFORM) --tag $(TAG) --load base + VERSION=$(VERSION) ./build-enhanced --platform $(PLATFORM) --tag $(TAG) --load base tiny: base ## Build tiny variant - VERSION=$(VERSION) ./build --platform $(PLATFORM) --tag $(TAG) --load tiny + VERSION=$(VERSION) ./build-enhanced --platform $(PLATFORM) --tag $(TAG) --load tiny micro: base ## Build micro variant - VERSION=$(VERSION) ./build --platform $(PLATFORM) --tag $(TAG) --load micro + VERSION=$(VERSION) ./build-enhanced --platform $(PLATFORM) --tag $(TAG) --load micro full: base ## Build full variant - VERSION=$(VERSION) ./build --platform $(PLATFORM) --tag $(TAG) --load full + VERSION=$(VERSION) ./build-enhanced --platform $(PLATFORM) --tag $(TAG) --load full push-base: ## Push base to registry - VERSION=$(VERSION) ./build --platform $(PLATFORM) --tag $(REGISTRY)/$(TAG) --push base + VERSION=$(VERSION) ./build-enhanced --platform $(PLATFORM) --tag $(TAG) --registry $(REGISTRY) --push base push: ## Push all variants to registry - VERSION=$(VERSION) ./build --platform $(PLATFORM) --tag $(REGISTRY)/$(TAG) --push tiny micro full + VERSION=$(VERSION) ./build-enhanced --platform $(PLATFORM) --tag $(TAG) --registry $(REGISTRY) --push tiny micro full + +push-ghcr: ## Push all variants to GitHub Container Registry + VERSION=$(VERSION) ./build-enhanced --platform $(PLATFORM) --tag $(TAG) --ghcr --push tiny micro full + +push-public-ecr: ## Push all variants to AWS Public ECR + VERSION=$(VERSION) ./build-enhanced --platform $(PLATFORM) --tag $(TAG) --public-ecr --push tiny micro full + +push-all: ## Push to both GHCR and Public ECR + VERSION=$(VERSION) ./build-enhanced --platform $(PLATFORM) --tag $(TAG) --ghcr --public-ecr --push tiny micro full clean: ## Remove local images docker rmi -f $(TAG):base $(TAG):tiny $(TAG):micro $(TAG):full 2>/dev/null || true \ No newline at end of file From 46d7cc80b91f4d801f40b9e6018c0d7dee1f608a Mon Sep 17 00:00:00 2001 From: Carlo D'Ambrosio Date: Fri, 1 Aug 2025 10:54:03 +0200 Subject: [PATCH 2/3] chore: asdd build-enhanced handling of HTTP_CLI_VERSION variable --- build-enhanced | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-enhanced b/build-enhanced index 7e1e95a..3dff387 100755 --- a/build-enhanced +++ b/build-enhanced @@ -7,6 +7,7 @@ PLATFORM="linux/arm64" MODE="--load" TAG="lambda-shell-runtime" VERSION="${VERSION:-develop}" +HTTP_CLI_VERSION="${HTTP_CLI_VERSION:-v1.0.1}" VARIANTS="base tiny micro full" REGISTRIES="" @@ -79,6 +80,8 @@ for VARIANT in $VARIANTS; do --platform "$PLATFORM" \ --provenance=false \ --secret id=github_token,env=GITHUB_TOKEN \ + --build-arg VERSION="$VERSION" \ + --build-arg HTTP_CLI_VERSION="$HTTP_CLI_VERSION" \ $TAGS \ --file "$DOCKERFILE" \ ${TARGET:+--target "$TARGET"} \ From b90c221c570005809178d77af4a1cf320b197e99 Mon Sep 17 00:00:00 2001 From: Carlo D'Ambrosio Date: Fri, 1 Aug 2025 11:01:15 +0200 Subject: [PATCH 3/3] refactor: update http-cli version and improve the build process. also documents how to generate new builds when updating the http-cli version --- .github/workflows/build-and-release.yml | 5 ++++- .github/workflows/build-base.yml | 3 +++ .github/workflows/build-installers.yml | 2 ++ Dockerfile | 2 +- README.md | 24 ++++++++++++++++++++++++ 5 files changed, 34 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index 61c4c43..6d0069c 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -22,6 +22,8 @@ concurrency: jobs: build-base: runs-on: ubuntu-latest + env: + HTTP_CLI_VERSION: v1.1.0 steps: - uses: actions/checkout@v3 - name: Set up Docker Buildx @@ -47,6 +49,7 @@ jobs: --platform linux/arm64,linux/amd64 \ --provenance=false \ --secret id=github_token,src=github_token \ + --build-arg HTTP_CLI_VERSION=${{ env.HTTP_CLI_VERSION }} \ --target base \ --tag ghcr.io/${{ github.repository_owner }}/lambda-shell-runtime:base \ --tag public.ecr.aws/j5r7n1v7/lambda-shell-runtime:base \ @@ -60,7 +63,7 @@ jobs: runs-on: ubuntu-latest if: github.event.pull_request.draft == false || github.event_name != 'pull_request' env: - HTTP_CLI_VERSION: v1.0.1 + HTTP_CLI_VERSION: v1.1.0 steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 diff --git a/.github/workflows/build-base.yml b/.github/workflows/build-base.yml index 22d55ad..14d79f4 100644 --- a/.github/workflows/build-base.yml +++ b/.github/workflows/build-base.yml @@ -28,6 +28,8 @@ concurrency: jobs: build-base: runs-on: ubuntu-latest + env: + HTTP_CLI_VERSION: v1.1.0 steps: - uses: actions/checkout@v4 @@ -48,6 +50,7 @@ jobs: --platform linux/arm64 \ --provenance=false \ --secret id=github_token,src=github_token \ + --build-arg HTTP_CLI_VERSION=${{ env.HTTP_CLI_VERSION }} \ --target base \ --tag ghcr.io/${{ github.repository_owner }}/lambda-shell-runtime:base \ --push \ diff --git a/.github/workflows/build-installers.yml b/.github/workflows/build-installers.yml index 752cadd..7a74971 100644 --- a/.github/workflows/build-installers.yml +++ b/.github/workflows/build-installers.yml @@ -18,6 +18,8 @@ concurrency: jobs: build-installers: runs-on: ubuntu-latest + env: + HTTP_CLI_VERSION: v1.1.0 steps: - uses: actions/checkout@v4 diff --git a/Dockerfile b/Dockerfile index 2a46324..db98aa8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM public.ecr.aws/lambda/provided:al2023 AS builder -ARG HTTP_CLI_VERSION=v1.0.1 +ARG HTTP_CLI_VERSION=v1.1.0 RUN dnf install -y unzip && \ dnf clean all diff --git a/README.md b/README.md index 26868d7..9b6c0c4 100644 --- a/README.md +++ b/README.md @@ -244,6 +244,30 @@ The shell runtime is **highly competitive** with official runtimes while providi # Optimize shell script performance ``` +## Updating http-cli Version + +The runtime includes [http-cli](https://github.com/ql4b/http-cli) for simplified HTTP operations. To update to a newer version: + +1. **Update version in all configuration files:** + - `.github/workflows/build-and-release.yml` (2 locations) + - `.github/workflows/build-base.yml` + - `.github/workflows/build-installers.yml` + - `Dockerfile` (ARG HTTP_CLI_VERSION) + - `build-enhanced` script (default value) + +2. **Trigger a new build:** + ```bash + # Push changes to trigger GitHub Actions + git add . + git commit -m "Update http-cli to vX.X.X" + git push origin develop + ``` + +3. **Or build locally:** + ```bash + HTTP_CLI_VERSION=v1.2.0 ./build-enhanced --load tiny + ``` + ## Contributing We welcome contributions! Please see our [contributing guidelines](CONTRIBUTING.md) for details.