Question

Static site ignores environment_slug

Hi, I have a static site hosted on DO App Platform. I update it pretty rarely, but recently it’s started to fail at the build stage in a way that suggests it’s ignoring the appspec’s environment_slug.

I have this in my .do/app.yaml file (redacted name and repo):

name: XYZ
region: nyc
static_sites:
- build_command: bundle exec jekyll build -d ./public
  environment_slug: jekyll
  error_document: 404.html
  github:
    branch: main
    deploy_on_push: true
    repo: XYZ/XYZ
  name: XYZ
  source_dir: /

But the logs, included below, seem to suggest that it’s ignoring the environment_slug value of jekyll. Not sure why – I based it on this sample. My first thought was that maybe the jekyll environment had gone away; but using ruby shows the same. Also I cannot find any documentation for what values are possible here. The App Spec documentation just links to the App Platform documentation landing page.

What can I do to fix this? And what happened to make it stop working?

[2024-06-19 15:26:25]  › configuring custom build command to be run at the end of the build:
[2024-06-19 15:26:25]    │ bundle exec jekyll build -d ./public
[2024-06-19 15:26:25] 
[2024-06-19 15:26:25] ╭──────────── buildpack detection ───────────╼
[2024-06-19 15:26:26] │  › using Ubuntu 22.04 stack
[2024-06-19 15:26:26] │ Detected the following buildpacks suitable to build your app:
[2024-06-19 15:26:26] │ 
[2024-06-19 15:26:26] │    digitalocean/static  v0.0.3  (Static Assets)
[2024-06-19 15:26:26] │    digitalocean/custom  v0.1.2  (Custom Build Command)
[2024-06-19 15:26:26] ╰─────────────────────────────────────────────╼
[2024-06-19 15:26:26] 
[2024-06-19 15:26:26] ╭──────────── build caching ───────────╼
[2024-06-19 15:26:26] │  › checking for cache from a previous build
[2024-06-19 15:26:27] │ Previous image with name <registry-uri-0> not found
[2024-06-19 15:26:27] │ Layer cache not found
[2024-06-19 15:26:27] │ Layer cache not found
[2024-06-19 15:26:27] ╰───────────────────────────────────────╼
[2024-06-19 15:26:27] 
[2024-06-19 15:26:27] ╭──────────── app build ───────────╼
[2024-06-19 15:26:27] │ Running custom build command: bundle exec jekyll build -d ./public
[2024-06-19 15:26:27] │ bash: line 1: bundle: command not found
[2024-06-19 15:26:27] │ building: exit status 127
[2024-06-19 15:26:27] │ ERROR: failed to build: exit status 1
[2024-06-19 15:26:27] │ 
[2024-06-19 15:26:27] │ 
[2024-06-19 15:26:27] │  ✘ build failed

Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
June 23, 2024

Hey

Indeed, you’re right that the documentation for available environment slugs is not easily accessible. However, jekyll and ruby should both be valid options.

Based on the output, the jekyll seems to be indeed ignored and Ruby is not included as a buildpack. What I could suggest is trying to change this to ruby instead:

  environment_slug: ruby

You could also reach out to the DigitalOcean support team and report this issue as well:

https://www.digitalocean.com/support/

Let me know if this works!

- Bobby

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel