Integration Extract JSON Value #2350
Replies: 4 comments
-
Beta Was this translation helpful? Give feedback.
-
Ow and this is how I extract the env value in my task ---
- hosts: name_flex_dev_01
vars:
branch: "{{ lookup('env', 'FLEX_BRANCH', default='develop') }}"
become: yes
become_user: ubuntu
tasks:
- name: output branch
debug:
msg: "branch={{ branch }}"
|
Beta Was this translation helpful? Give feedback.
-
So I started debugging the app and got to this LocalJob. It seems the issue is occurring because the t.Environment.ENV value might not be in a proper JSON format, or the json.Unmarshal call is not correctly parsing the input. semaphore/services/tasks/LocalJob.go Lines 152 to 156 in f5404b1 I added some outputs to the CLI and saw that |
Beta Was this translation helpful? Give feedback.
-
Hi @ronzyfonzy ---
- hosts: name_flex_dev_01
vars:
branch: "{{ FLEX_BRANCH }}"
become: yes
become_user: ubuntu
tasks:
- name: output branch
debug:
msg: "branch={{ branch }}" |
Beta Was this translation helpful? Give feedback.
-
Hello 👋
Before I ask the question I have to say that this is an awesome project 👍 ... so Thank You
I have deployed Semaphore on my staging server and I created an Integration where a webhook (PullRequest created) from Bitbucket triggers a ansible task. The problem I have is that I am unable to extract the branch name from the POST request. Nowhere in the documentation I have found how to exactly extract a nested value in a JSON payload. I presume I can do that with JSONPath syntaxs. In my case that is
pullrequest.source.branch.name
(based on the payload - see sample payload bellow)Am I doing something wrong? Should I extract in another way?
This is an obfuscated JSON example:
This is how I have setup my value extractor:
Beta Was this translation helpful? Give feedback.
All reactions