From dd5af8952e9976b66f058fa092ea5adafd41f62b Mon Sep 17 00:00:00 2001 From: Camila Macedo Date: Sat, 4 Nov 2023 07:20:40 +0000 Subject: [PATCH] test Signed-off-by: Camila Macedo --- .github/workflows/main.yml | 70 ++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 37 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6c14d80..36b216d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -35,46 +35,42 @@ jobs: openssl x509 -req -in ./data/certs/server.csr -CA ./data/certs/local-ca.pem -CAkey ./data/certs/local-ca.key -CAcreateserial -out ./data/certs/tls-crt -days 365 -sha256 ls -la ./data/certs - - name: Build Docker Compose - run: | - docker-compose build - - name: Run Docker Compose run: | - docker-compose up --force-recreate -d + docker-compose up --build --force-recreate --wait-timeout 60 sleep 10 - - - name: Check Service Status - run: | - for i in {1..12}; do - status_code=$(curl --write-out '%{http_code}' --silent --output /dev/null -X POST http://localhost:80/sign) - if [ "$status_code" -eq 400 ]; then - echo "Service is up and returned 400 Bad Request. Ready to proceed." - break - else - echo "Service responded with status code $status_code, waiting for 400. Attempt $i of 12." - sleep 10 - fi - done - - if [ "$status_code" -ne 400 ]; then - echo "Service did not respond with 400 Bad Request after 12 attempts. Exiting." - exit 1 - fi - - - name: Execute Script - run: | - python3 fake-lmp-device-register --registration-url "http://localhost:80/sign" --factory fake-test-sample - - - name: Check relative /var/sota directory and pkey.pem file - run: | - if [[ -d "var/sota" && -f "var/sota/pkey.pem" ]]; then - echo "Relative /var/sota directory exists and pkey.pem is present" - else - echo "Relative /var/sota directory or pkey.pem is missing" - exit 1 - fi - ls -la var/sota/ +# +# - name: Check Service Status +# run: | +# for i in {1..12}; do +# status_code=$(curl --write-out '%{http_code}' --silent --output /dev/null -X POST http://localhost:80/sign) +# if [ "$status_code" -eq 400 ]; then +# echo "Service is up and returned 400 Bad Request. Ready to proceed." +# break +# else +# echo "Service responded with status code $status_code, waiting for 400. Attempt $i of 12." +# sleep 10 +# fi +# done +# +# if [ "$status_code" -ne 400 ]; then +# echo "Service did not respond with 400 Bad Request after 12 attempts. Exiting." +# exit 1 +# fi +# +# - name: Execute Script +# run: | +# python3 fake-lmp-device-register --registration-url "http://localhost:80/sign" --factory fake-test-sample +# +# - name: Check relative /var/sota directory and pkey.pem file +# run: | +# if [[ -d "var/sota" && -f "var/sota/pkey.pem" ]]; then +# echo "Relative /var/sota directory exists and pkey.pem is present" +# else +# echo "Relative /var/sota directory or pkey.pem is missing" +# exit 1 +# fi +# ls -la var/sota/ - name: Output Docker Compose Logs if: always()