From 7d8873a765f71bc3d50f0e0be1609dd155f9106b Mon Sep 17 00:00:00 2001 From: DaveW-STFC Date: Thu, 3 Oct 2024 12:45:16 +0100 Subject: [PATCH] removed unused files --- .github/workflows/pr_check_copy.sh | 49 -------------------------- .github/workflows/pr_copied_files.yaml | 1 - scripts/pr_check_copies.sh | 49 -------------------------- 3 files changed, 99 deletions(-) delete mode 100644 .github/workflows/pr_check_copy.sh delete mode 100755 scripts/pr_check_copies.sh diff --git a/.github/workflows/pr_check_copy.sh b/.github/workflows/pr_check_copy.sh deleted file mode 100644 index 339b573a..00000000 --- a/.github/workflows/pr_check_copy.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash - -# Script to check if the changed files to promote are a direct copy of earlier environment - -# Function to compare the files, file1 is our original file passed to the script followed by two possible further files -compare_files() { - file1=$1 - file2=$2 - file3=$3 - - # Check the number of arguments passed to the function for comparison - # To know the number of files for comparison - # We then check whether the files exist in the previous environment, if not the PR needs review - if [ "$#" -eq 2 ]; then - if [ -f $file2 ]; then - if cmp -s "$file1" "$file2"; then - echo $((0)) - else - echo $((1)) - fi - else - echo $((1)) - fi - else - if [[ -f $file2 && -f $file3 ]]; then - if cmp -s "$file1" "$file2" && cmp -s "$file1" "$file3"; then - echo $((0)) - else - echo $((1)) - fi - else - echo $((1)) - fi - fi -} - -# Check the file path to determine if it's from staging or prod folder -# If it's staging we pass it along with a url to the file in dev folder -# If it's from prod we pass both the staging and dev file also for comparison -path=$1 -curr_env=$2 -comp_env=$3 -comp_env2=$4 - -if [[ -z $4 ]]; then - compare_files "$1" "${path/$curr_env/"$comp_env"}" -else - compare_files "$1" "${path/$curr_env/"$comp_env"}" "${path/$curr_env/"$comp_env2"}" -fi \ No newline at end of file diff --git a/.github/workflows/pr_copied_files.yaml b/.github/workflows/pr_copied_files.yaml index 9f59c54c..0c792d13 100644 --- a/.github/workflows/pr_copied_files.yaml +++ b/.github/workflows/pr_copied_files.yaml @@ -43,7 +43,6 @@ jobs: echo "One or more files in the staging folder has changed." echo "Files that have changed: $STAGING_ALL_CHANGED_FILES" echo "result=true" >> "$GITHUB_OUTPUT" - ls -l ${{ github.workspace }}/.github/workflows/ for file in ${{ steps.changed-files.outputs.staging_all_changed_files }}; do res=$( ${{ github.workspace }}/.github/workflows/pr_check_copies.sh "$file" "staging" "dev" ) echo $res diff --git a/scripts/pr_check_copies.sh b/scripts/pr_check_copies.sh deleted file mode 100755 index 339b573a..00000000 --- a/scripts/pr_check_copies.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash - -# Script to check if the changed files to promote are a direct copy of earlier environment - -# Function to compare the files, file1 is our original file passed to the script followed by two possible further files -compare_files() { - file1=$1 - file2=$2 - file3=$3 - - # Check the number of arguments passed to the function for comparison - # To know the number of files for comparison - # We then check whether the files exist in the previous environment, if not the PR needs review - if [ "$#" -eq 2 ]; then - if [ -f $file2 ]; then - if cmp -s "$file1" "$file2"; then - echo $((0)) - else - echo $((1)) - fi - else - echo $((1)) - fi - else - if [[ -f $file2 && -f $file3 ]]; then - if cmp -s "$file1" "$file2" && cmp -s "$file1" "$file3"; then - echo $((0)) - else - echo $((1)) - fi - else - echo $((1)) - fi - fi -} - -# Check the file path to determine if it's from staging or prod folder -# If it's staging we pass it along with a url to the file in dev folder -# If it's from prod we pass both the staging and dev file also for comparison -path=$1 -curr_env=$2 -comp_env=$3 -comp_env2=$4 - -if [[ -z $4 ]]; then - compare_files "$1" "${path/$curr_env/"$comp_env"}" -else - compare_files "$1" "${path/$curr_env/"$comp_env"}" "${path/$curr_env/"$comp_env2"}" -fi \ No newline at end of file