Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions .github/workflows/check-sample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,16 @@ jobs:
- name: Run Checks
id: checks
run: |
eval "$(curl -fsSL s.defang.io/install)"
./scripts/check-sample-files.sh > checklist.txt
./scripts/check-modified-samples.sh > modified.txt
echo "@@ MODIFIED @@"
cat modified.txt
echo "@@ CHECKLIST @@"
cat checklist.txt

# TODO: Uncomment the following lines to validate the Compose files
# once we figure out how to prevent it from erroring on warnings.
# - name: Validate Compose Files with Defang CLI
# run: |
# eval "$(curl -fsSL s.defang.io/install)"
# cat modified.txt | xargs -n1 defang compose config -C > /dev/null
- name: Validate Compose Files with Defang CLI
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lionello not sure we need this: it's currently checked by the deploy_changed_samples. Though... that one is erroring with:

2025/06/16 17:11:08 Deployer 0: failed to run test crew-django-redis-postgres: failed to load configs for test crew-django-redis-postgres: failed to load project: validating /home/runner/work/samples/samples/samples/crew-django-redis-postgres/compose.yaml: services.embedding Additional property provider is not allowed

So if this one takes into account the new provider property, then maybe we switch it?

run: |
cat modified.txt | xargs --no-run-if-empty -n1 defang compose config -C

- name: Add checklist to PR description
uses: actions/github-script@v5
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/publish-sample-template.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
name: Publish Sample Template

on:
push:
push:
branches:
- main
paths:
- 'samples/**'
- 'scripts/template-manager.js'
- 'scripts/check-modified-samples.sh'

jobs:
publish_samples:
runs-on: ubuntu-latest
permissions:
permissions:
contents: write
pull-requests: write
steps:
Expand Down
2 changes: 1 addition & 1 deletion samples/nextjs/app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ RUN if [ "$NEXT_OUTPUT" = "export" ]; then \
EXPOSE 3000

# Start the app
CMD ["npm", "start"]
CMD ["npm", "start"]
2 changes: 1 addition & 1 deletion samples/nextjs/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"start": "exec next start",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lionello why exec? That's not standard.

"lint": "next lint"
},
"dependencies": {
Expand Down
1 change: 1 addition & 0 deletions tools/testing/deployer/deployer.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ func (d *CliDeployer) Cleanup(ctx context.Context) error {
}

func (d *CliDeployer) RunCommand(ctx context.Context, opt func(*exec.Cmd), command string, args ...string) (*exec.Cmd, error) {
log.Printf("Running command in dir %q: %q %q", d.WorkDir, command, args)
cmd := exec.CommandContext(ctx, command, args...)
cmd.Env = d.EnvVars
if d.WorkDir != "" {
Expand Down
4 changes: 2 additions & 2 deletions tools/testing/test/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ func Run(ctx context.Context, test TestInfo) (*ItemResult, error) {
// declare variable for url
var url string

// Regular expression to capture an "https://" URL that follows "will be available at:"
re := regexp.MustCompile(`will be available at:\s*.*?(https://[^\s]+)`)
// Regular expression to capture an "https://" URL that follows "DEPLOYMENT_COMPLETED"
re := regexp.MustCompile(`DEPLOYMENT_COMPLETED\s*((?:https?://)?[^\s]+)`)

// Find the first match in the output string
match := re.FindStringSubmatch(outputStr)
Expand Down
Loading