I have the following curl request which I want to use in my config.yml file for my CircleCI pipeline.
But it keeps giving me errors and I cannot find the right syntax to get it to work. I put the file in YAML lint and the error is mapping values are not allowed in this context. Here is my curl request
curl -X POST -H 'Content-type: application/json' --data '{"text":"This is a test!"}' [WEBHOOK URL]
Here is my config.yml file:
version: 2.1
jobs:
build:
working_directory: ~/circleci-python
docker:
- image: "circleci/python:3.6.4"
steps:
- checkout
- run: python3 main.py
test:
working_directory: ~/circleci-python
docker:
- image: "circleci/python:3.6.4"
steps:
- checkout
- run: python3 main-test.py
- run: curl -X POST -H 'Content-type: application/json' --data '{"text":"This is a test!"}' [WEBHOOK URL]
workflows:
build_and_test:
jobs:
- build
- test:
requires:
- build