Skip to content

Workflow file for this run

on:
push:
branches:
- PE-test
jobs:
test-job:
runs-on: ubuntu-latest
steps:
- name: Echo github variables
id: get_ref
run: |
output_file="final_result"
echo "brokers-dmx-prod-non-revenue-eks-2.kafka-us-east-1b.vungle.io 66" >> final_result
echo "brokers-dmx-prod-non-revenue-eks-3.kafka-us-east-1b.vungle.io 78" >> final_result
cat final_result
file_content=""
echo 'KAFKA_RESTART<<EOF' >> $GITHUB_OUTPUT
while read -r line; do
#new_string=$(echo "$line" | sed -E 's/.*-([0-9]+)\.kafka-us-east-1b\.vungle\.io ([0-9]{1,3})$/\1_\2/')
modify=$(echo "$line" | sed -E 's/.*-([0-9]+)\.kafka-us-east-1b\.vungle\.io ([0-9]+)/\1_\2/')
file_content+="$modify"'\n' # Append line and add a newline character
done < final_result
echo $file_content
echo "content=$file_content" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_OUTPUT
# To be continue for run ANsible script
- name: Run Ansible playbook
run: |
# echo "${{ env.content }}"
echo -e "${{ env.content }}" | while read -r line; do
# Use sed to extract the two parts and echo them separately
first_part=$(echo "$line" | sed -E 's/^([0-9]+)_.*/\1/')
second_part=$(echo "$line" | sed -E 's/^[0-9]+_(.*)/\1/')
# Echo the parts separately
if [[ -n "$first_part" ]]; then
echo "First part: $first_part"
echo "Second part: $second_part"
fi
done