Skip to content

Update docker/build-push-action action to v6 #214

Update docker/build-push-action action to v6

Update docker/build-push-action action to v6 #214

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: test
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
pull_request:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
test:
# The type of runner that the job will run on
runs-on: ubuntu-latest
env:
PATH_OUT_BASIC: build/out/basic
PATH_OUT_FULL: build/out/full
PATH_IN_FULL: testing/file/full/in
PATH_IN_BASIC: testing/file/basic/in
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
# printenv
- name: printenv
run: printenv
# PWD
- name: PWD
run: pwd
# install jq
- name: apt jq
run: sudo apt-get install -y jq
# Runs a set of commands using the runners shell
- name: prepare build folders
run: |
mkdir build
cp -r config build
cp -r docker build
cp -r testing/config/* build/config/
rm build/config/pipeline/output-elastic-logstash.conf
mkdir -p $PATH_OUT_BASIC
chmod +777 $PATH_OUT_BASIC
mkdir -p $PATH_OUT_FULL
chmod +777 $PATH_OUT_FULL
ls -lah build/config/pipeline
cp -r docker/elasticsearch build
ls -lah build
docker build -f build/elasticsearch/Dockerfile -t jmeter-logstash-elastic build
# Run docker
- name: Run docker basic
run: |
docker run --rm -e "FILE_READ_MODE=read" \
-e "FILE_START_POSITION=beginning" \
-e "FILE_EXIT_AFTER_READ=true" \
-v ${PWD}/$PATH_OUT_BASIC:/output/ \
-v ${PWD}/$PATH_IN_BASIC:/input/ \
jmeter-logstash-elastic
- name: Run docker FULL
run: |
docker run --rm -e "FILE_READ_MODE=read" \
-e "FILE_START_POSITION=beginning" \
-e "FILE_EXIT_AFTER_READ=true" \
-e "EXECUTION_ID=myexecution" \
-e "PROJECT_NAME=myproject" \
-e "ENVIRONMENT_NAME=myenv" \
-e "TEST_NAME=mytest" \
-e "TEST_METADATA=users=50,location=europe,key=myvalue" \
-e "TEST_TAGS=prd,tnr,mytag" \
-v ${PWD}/$PATH_OUT_FULL:/output/ \
-v ${PWD}/$PATH_IN_FULL:/input/ \
jmeter-logstash-elastic
- name: check Expected Files list
run: |
for testtype in basic full ; do
echo "Start check for ${testtype}"
export PATH_EXPECTED=testing/file/${testtype}/expected
echo "##CHECK expected folder $PATH_EXPECTED"
ls -la $PATH_EXPECTED
export PATH_OUT=build/out/${testtype}
echo "##CHECK PATH_OUT folder $PATH_OUT"
ls -la $PATH_OUT
for filepath in $PATH_EXPECTED/*.json; do
FILE_NAME=${filepath##*/}
echo "####START###############################$FILE_NAME#####################################"
EXPECTED_FILE=$PATH_EXPECTED/$FILE_NAME
OUT_FILE=$PATH_OUT/$FILE_NAME
echo "####OUT###############$FILE_NAME#####################"
jq --sort-keys 'del(.host) | del(."@timestamp") | del(.timestamp)' $OUT_FILE
echo "####OUT###############$FILE_NAME#####################"
echo "####EXPECTED##########$FILE_NAME#####################"
jq --sort-keys 'del(.host) | del(."@timestamp") | del(.timestamp)' $EXPECTED_FILE
echo "####EXPECTED##########$FILE_NAME#####################"
diff <(jq --sort-keys 'del(.host) | del(."@timestamp") | del(.timestamp)' $EXPECTED_FILE) <(jq --sort-keys 'del(.host) | del(."@timestamp") | del(.timestamp)' $OUT_FILE)
echo "####END###############################$FILE_NAME#####################################"
done
done