Hello, I’m trying to set up a CI job for a test project of mine.
The project uses Gatsby and Strapi. The problem is I don’t know how to have the strapi part running as my frontend “gatsby build” collects data from the local strapi backend.
Here is my config:
config.yml
version: 2.1
executors:
node:
parameters:
image:
type: string
# First 10.x LTS release, but old Yarn
default: “12.13.0”
docker:
- image: cimg/node:<< parameters.image >>
commands:
gatsby-build:
steps:
- checkout
- restore_cache:
keys:
- v1-npm-deps-{{ checksum “package-lock.json” }}
- run:
name: Install Dependencies
command: npm install
- save_cache:
key: v1-npm-deps-{{ checksum “package-lock.json” }}
paths:
- ./node_modules
- run:
name: Gatsby Build
command: npm run build
workflows:
version: 2
build-deploy:
jobs:
- build:
filters:
branches:
ignore:
- master
- release:
filters:
branches:
only:
- master
jobs:
build:
executor: node
working_directory: ~/Portfolio
steps:
- gatsby-build
release:
executor: node
working_directory: ~/Porfolio
steps:
- gatsby-build
Error: Since no service is running
gatsby build
info Starting to fetch data from Strapi - http://localhost:1337/about with params {“_limit”:1000}
error Failed to fetch data from Strapi connect ECONNREFUSED 127.0.0.1:1337Error: connect ECONNREFUSED 127.0.0.1:1337
I’m guessing I’m not the first to ask this question but my googling was not successfull enough to help me get past this error. I’ve run separate jobs on backend/frontend before but never beeing reliant on the backend running while the frontend was building