Skip to content

Commit

Permalink
Chore: Update DevOps tooling from central repository [skip ci]
Browse files Browse the repository at this point in the history
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
ModeSevenIndustrialSolutions authored and github-actions[bot] committed May 20, 2024
1 parent 5227272 commit 0a23bf9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 53 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/bootstrap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
47 changes: 0 additions & 47 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@

# Temporary directories
tmp/
rawdata/

# Other stuff
*.iml

# Temporary devops repo
.devops

Expand All @@ -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
Expand Down Expand Up @@ -163,33 +136,13 @@ celerybeat.pid
*.sage.py

# Environments

.env
.venv
env/
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/

Expand Down
16 changes: 13 additions & 3 deletions scripts/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ###

Expand All @@ -21,14 +22,17 @@ 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)
if [ ! -x "$MKTEMP_CMD" ]; then
echo "MKTEMP command was NOT found in PATH"; exit 1
fi



SHELL_SCRIPT=$(mktemp -t script-XXXXXXXX.sh)

### Functions ###
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 0a23bf9

Please sign in to comment.