diff --git a/.woodpecker.yml b/.woodpecker.yml index a009631..fdff108 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -1,12 +1,10 @@ steps: - - name: test + - name: file_operations image: ubuntu commands: - - echo "Starting tests" - - ls -la - - echo "Running tests" - - ./start_woodpecker_agent.sh - - echo "Tests complete" + - echo "Starting file operations tests" + - ./file_operations.sh + - echo "File operations tests complete" when: branch: - master diff --git a/file_operations.sh b/file_operations.sh new file mode 100755 index 0000000..85878b2 --- /dev/null +++ b/file_operations.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +# Vytvoření souborů +echo "Vytváření souborů..." +touch file1.txt file2.txt file3.txt +echo "Toto je soubor 1" > file1.txt +echo "Toto je soubor 2" > file2.txt +echo "Toto je soubor 3" > file3.txt + +# Kontrola obsahu souborů +echo "Kontrola obsahu souborů..." +cat file1.txt +cat file2.txt +cat file3.txt + +# Přesunutí souborů do nového adresáře +echo "Přesunutí souborů do adresáře 'new_directory'..." +mkdir -p new_directory +mv file1.txt file2.txt file3.txt new_directory/ + +# Kontrola, zda jsou soubory přesunuty +echo "Kontrola souborů v adresáři 'new_directory'..." +ls new_directory/ + +# Smazání souborů a adresáře +echo "Mazání souborů a adresáře..." +rm -rf new_directory/ + +# Kontrola, zda byly soubory a adresář smazány +echo "Kontrola, zda byly soubory a adresář smazány..." +if [ -d "new_directory" ]; then + echo "Adresář 'new_directory' nebyl smazán!" +else + echo "Adresář 'new_directory' byl úspěšně smazán." +fi + +echo "Operace se soubory byly dokončeny."