From 0a23bf9f660198ea495c66f224df8656108bbc6e Mon Sep 17 00:00:00 2001 From: ModeSevenIndustrialSolutions <93649628+ModeSevenIndustrialSolutions@users.noreply.github.com> Date: Mon, 20 May 2024 08:23:25 +0000 Subject: [PATCH] Chore: Update DevOps tooling from central repository [skip ci] Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .github/workflows/bootstrap.yaml | 7 +++-- .gitignore | 47 -------------------------------- scripts/bootstrap.sh | 16 +++++++++-- 3 files changed, 17 insertions(+), 53 deletions(-) diff --git a/.github/workflows/bootstrap.yaml b/.github/workflows/bootstrap.yaml index 41dac5a..3e1df48 100644 --- a/.github/workflows/bootstrap.yaml +++ b/.github/workflows/bootstrap.yaml @@ -91,9 +91,10 @@ jobs: # Only updates file if it has changed selective_file_copy() { # Receives a single file path as argument - SHA_SRC=$(sha1sum "$DEVOPS_DIR"/"$1" | awk '{print $1}') - SHA_DST=$(sha1sum "$1" 2>/dev/null | awk '{print $1}' || :) - if [ "$SHA_SRC" != "$SHA_DST" ]; then + # SHA_SRC=$(sha1sum "$DEVOPS_DIR/$1" | awk '{print $1}') + # SHA_DST=$(sha1sum "$1" 2>/dev/null | awk '{print $1}' || :) + # if [ "$SHA_SRC" != "$SHA_DST" ]; then + if ! (cmp "$DEVOPS_DIR/$1" "$1"); then echo "Copying: $1" cp "$DEVOPS_DIR/$1" "$1" git add "$1" diff --git a/.gitignore b/.gitignore index de68e60..3a63141 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,3 @@ - -# Temporary directories -tmp/ -rawdata/ - -# Other stuff -*.iml - # Temporary devops repo .devops @@ -24,37 +16,18 @@ node_modules credentials.env config.toml - # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] *$py.class - - .idea/* *.iml - # C extensions *.so # Distribution / packaging - -dist/ -build/ -*.egg-info/ -*.egg - -# Compiled Python files -*.pyc - -# IDE specific files -.idea/ -.vscode/ - -# Environment and virtualenv files - .Python .pdm-python .pdm-build @@ -163,7 +136,6 @@ celerybeat.pid *.sage.py # Environments - .env .venv env/ @@ -171,25 +143,6 @@ venv/ ENV/ env.bak/ venv.bak/ - - -# macOS specific files -.DS_Store - -# Jupyter Notebook -.ipynb_checkpoints/ - -# Testing -htmlcov/ -.tox/ - -# Pytest -.pytest_cache/ - -# Coverage -.coverage -.coverage.* - examples/itr_ui/ itr_env/ diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh index 83afb31..ac070c2 100755 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -11,6 +11,7 @@ SOURCE_FILE="bootstrap.yaml" WGET_URL="https://raw.githubusercontent.com/os-climate/devops-toolkit/main/.github/workflows/$SOURCE_FILE" AUTOMATION_BRANCH="update-devops-tooling" DEVOPS_DIR=".devops" +FETCH_MODE="wget" ### Checks ### @@ -21,7 +22,8 @@ fi WGET_CMD=$(which wget) if [ ! -x "$WGET_CMD" ]; then - echo "WGET command was NOT found in PATH"; exit 1 + echo "WGET command was NOT found in PATH; using CURL" + FETCH_MODE="curl" fi MKTEMP_CMD=$(which mktemp) @@ -29,6 +31,8 @@ if [ ! -x "$MKTEMP_CMD" ]; then echo "MKTEMP command was NOT found in PATH"; exit 1 fi + + SHELL_SCRIPT=$(mktemp -t script-XXXXXXXX.sh) ### Functions ### @@ -95,9 +99,15 @@ if [ -f "$SOURCE_FILE" ]; then echo "Removing existing copy of: $SOURCE_FILE" rm "$SOURCE_FILE" fi -echo "Pulling latest DevOps bootstrap workflow from:" +echo "Pulling latest DevOps bootstrap YAML from:" echo " $WGET_URL" -"$WGET_CMD" -q "$WGET_URL" +if [ "$FETCH_MODE" = "wget" ]; then + "$WGET_CMD" -q "$WGET_URL" > /dev/null 2>&1 +fi +if [ ! -f "$SOURCE_FILE" ]; then + echo "Attempting to retrieve YAML file with CURL" + curl "$WGET_URL" > "$SOURCE_FILE" +fi # The section below extracts shell code from the YAML file echo "Extracting shell code from: $SOURCE_FILE"