Skip to content

Commit

Permalink
fix: package static assets on make sam-pull
Browse files Browse the repository at this point in the history
This commit fixes a bug whereby static assets were missing the tagged
release (e.g. `latest`, `beta`).

When running `make sam-pull` we should add the directory the assets will
be pull into as a prerequisite, since it involves more steps than merely
creating a directory.
  • Loading branch information
jta committed Jun 10, 2024
1 parent 1aa32b3 commit 31eece4
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -187,16 +187,19 @@ $(SAM_PACKAGE_TEMPLATES): | $(SAM_PACKAGE_DIRS)

SAM_PULL_REGION_TARGETS = $(foreach region,$(AWS_REGIONS),sam-pull-$(region))

$(foreach target,$(SAM_PULL_REGION_TARGETS),$(eval \
$(target): $(foreach app,$(APPS), $(SAM_BUILD_DIR)/regions/$(subst sam-pull-,,$(target))) \
))

.PHONY: $(SAM_PULL_REGION_TARGETS)
$(SAM_PULL_REGION_TARGETS): require_bucket_prefix
# force ourselves to use the public URLs, verifying ACLs are correctly set
mkdir -p $(SAM_BUILD_DIR)/regions/$(subst sam-pull-,,$@) && \
cd $(SAM_BUILD_DIR)/regions/$(subst sam-pull-,,$@) && \
for app in $(APPS); do \
curl -fs \
-O https://$(S3_BUCKET_PREFIX)$(subst sam-pull-,,$@).s3.amazonaws.com/aws-sam-apps/$(VERSION)/$${app}.yaml \
-w "Pulled %{url_effective} status=%{http_code} size=%{size_download}\n" || exit 1; \
done
cd $(SAM_BUILD_DIR)/regions/$(subst sam-pull-,,$@) && \
for app in $(APPS); do \
curl -fs \
-O https://$(S3_BUCKET_PREFIX)$(subst sam-pull-,,$@).s3.amazonaws.com/aws-sam-apps/$(VERSION)/$${app}.yaml \
-w "Pulled %{url_effective} status=%{http_code} size=%{size_download}\n" || exit 1; \
done

SAM_PUSH_REGION_TARGETS = $(foreach region,$(AWS_REGIONS),sam-push-$(region))

Expand Down

0 comments on commit 31eece4

Please sign in to comment.