create-cwa 2.0.0-alpha.51 → 2.0.0-alpha.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/smoke.sh +11 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-cwa",
3
- "version": "2.0.0-alpha.51",
3
+ "version": "2.0.0-alpha.53",
4
4
  "description": "Create a new CWA (Components Web App) project",
5
5
  "type": "module",
6
6
  "bin": {
package/smoke.sh CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/bin/sh
2
2
  # Template CI only (#215): creates a project from this checkout with the built CLI, starts it through bin/up and checks the login.
3
- # Usage: packages/create-cwa/smoke.sh <work dir> (SMOKE_FEATURES: all|none|a,b; SMOKE_FIXTURES: true|false)
3
+ # Usage: packages/create-cwa/smoke.sh <work dir> (SMOKE_FEATURES: all|none|a,b; SMOKE_FIXTURES: true|false; SMOKE_REQUIRE_BASE=true fails instead of skipping)
4
4
  # Needs node and pnpm (or a built dist/), git, docker with compose, and free ports 80, 443, 3001, 5432 and 8025.
5
5
  set -u
6
6
 
@@ -16,13 +16,22 @@ export CWA_UP_TIMEOUT="${CWA_UP_TIMEOUT:-1800}"
16
16
  fail() {
17
17
  [ -z "${GITHUB_ACTIONS:-}" ] || echo "::error::create-cwa smoke: $*"
18
18
  echo "create-cwa smoke failed: $*" >&2
19
- [ "$(pwd)" != "$PROJECT" ] || docker compose logs --no-color --tail 80 php app >&2
19
+ if [ -f "$PROJECT/compose.yaml" ]; then
20
+ (cd "$PROJECT" && docker compose logs --no-color --tail 200 php app) >&2
21
+ # How the project's network reaches GitHub, for composer's refused downloads (#226).
22
+ net=$(docker network ls --format '{{.Name}}' | grep -m 1 "^${NAME}_default$" || true)
23
+ [ -z "$net" ] || docker run --rm --network "$net" curlimages/curl:8.11.1 -sS -o /dev/null --max-time 20 \
24
+ -w 'api.github.com from the project network: %{http_code} via %{remote_ip}\n' https://api.github.com/ >&2 || true
25
+ getent ahosts api.github.com >&2 || true
26
+ fi
20
27
  exit 1
21
28
  }
22
29
 
23
30
  # A release commit names its own cwa-php-base before publish-php-base.yml has pushed it: skip, don't fail. GitLab shows exit 3 orange (allow_failure exit_codes).
24
31
  base=$(sed -n 's/^ARG CWA_PHP_BASE=//p' "$ROOT/api/Dockerfile" | head -n 1)
25
32
  if [ -n "$base" ] && ! out=$(docker buildx imagetools inspect "$base" 2>&1) && echo "$out" | grep -qi 'not found'; then
33
+ # publish-php-base.yml's release smoke test runs after the image is tagged, so a missing one there is a failure (#226).
34
+ [ "${SMOKE_REQUIRE_BASE:-}" != true ] || fail "$base isn't published"
26
35
  [ -z "${GITHUB_ACTIONS:-}" ] || echo "::warning::create-cwa smoke skipped: $base isn't published yet; re-run once publish-php-base.yml has pushed it"
27
36
  echo "create-cwa smoke skipped: $base isn't published yet (a release commit before publish-php-base.yml). Re-run once it's pushed." >&2
28
37
  [ -n "${GITLAB_CI:-}" ] && exit 3