buildkite / templates

Buildkite pipeline templates
https://buildkite.com/pipelines/templates
MIT License
2 stars 1 forks source link

Add Ruby on Rails using hosted agents template #112

Closed jordandcarter closed 3 months ago

jordandcarter commented 3 months ago

An example of using Ruby on Rails with hosted agents.

jordandcarter commented 3 months ago

Looking good. In the absence of having CI for automating each of these templates, we've generally followed the convention of adding an example-project to each of the templates in order to test them locally.

e.g.

cd ruby-on-rails-ci/example-project;
bk local run ../pipeline.yaml

Interestingly running locally is probably not going to work anymore with hosted compute cache volumes 🤔

I'd still suggest adding the example-project folder for consistency so we can assert at least the bare-bones pipeline works locally with the cached volumes commented out.

In this instance you should be able to duplicate ruby-ci/example-project.

I've added an example-project but was unable to get it passing locally. I couldn't decipher the problem. Could you please try it locally?

...
2024/05/13 13:07:37 [http] POST /jobs/f851634c-4c27-4b09-865f-ace451412c17/chunks?sequence=2&offset=7042&size=24233 127.0.0.1:64846
2024-05-13 13:07:37 DEBUG  GET http://127.0.0.1:64838/jobs/f851634c-4c27-4b09-865f-ace451412c17unting objects:  30% (151/502)command=start agent_version=3.70.0+8325.6ebf6cb424f966f6dcdbfa583daa899f0f0b2064
# ↳ Command completed in 1.4779s
# Checking out `v5.9.0`
$ git checkout -f v5.9.0
# ↳ Command completed in 10.433ms
# Moving temporary plugin directory to final location
$ cd /private/var/folders/br/1s9f3spd27z01s_zjfyyrdvw0000gn/T/buildkite-build-010596477
$ cd /Users/jordan/src/templates/ruby-on-rails-hosted-ci/example-project
# Local hook pre-command doesn't exist: file does not exist, skipping
# A hook runner was written to "/tmp/buildkite-agent-hook-wrapper/hook-script-wrapper-2362405522" with the following:
$ /tmp/buildkite-agent-hook-wrapper/hook-script-wrapper-2362405522
2024-05-13 13:07:37 DEBUG  Loaded config command=env dump agent_version=3.70.0+8325.6ebf6cb424f966f6dcdbfa583daa899f0f0b2064
# ↳ Command completed in 315.55ms
🚨 Error: The command exited with status 1
# Local hook post-command doesn't exist: file does not exist, skipping
# Local hook pre-exit doesn't exist: file does not exist, skipping
# A hook runner was written to "/tmp/buildkite-agent-hook-wrapper/hook-script-wrapper-3983112969" with the following:
$ /tmp/buildkite-agent-hook-wrapper/hook-script-wrapper-3983112969
2024-05-13 13:07:38 DEBUG  ↳ GET http://127.0.0.1:64838/jobs/f851634c-4c27-4b09-865f-ace451412c17 command=start proto=HTTP/1.1 status=200 Δ=65.262584ms agent_version=3.70.0+8325.6ebf6cb424f966f6dcdbfa583daa899f0f0b2064
2024-05-13 13:07:38 DEBUG  ↳ POST http://127.0.0.1:64838/jobs/f851634c-4c27-4b09-865f-ace451412c17/chunks?sequence=2&offset=7042&size=24233 command=start proto=HTTP/1.1 status=200 Δ=68.140583ms agent_version=3.70.0+8325.6ebf6cb424f966f6dcdbfa583daa899f0f0b2064
2024-05-13 13:07:38 DEBUG  local [Process] PTY has finished being copied to the buffer command=start agent_version=3.70.0+8325.6ebf6cb424f966f6dcdbfa583daa899f0f0b2064
2024-05-13 13:07:38 INFO   local Process with PID: 23231 finished with Exit Status: 1, Signal: nil command=start
...
dannymidnight commented 3 months ago

I've added an example-project but was unable to get it passing locally. I couldn't decipher the problem. Could you please try it locally?

I'll give it a whirl!

dannymidnight commented 3 months ago

Aight @jordandcarter, I gave it a whirl and with some minor updates, managed to get it passing locally. I also tidied up some of the pipeline to make it render a little nicer in the gallery.

e.g.

Screenshot 2024-05-13 at 11 45 37 am
dannymidnight commented 3 months ago

:shipit: