Skip to content

Commit

Permalink
DONT MERGE -- Test week 1 (earthlab#63)
Browse files Browse the repository at this point in the history
* update ci to remove images and posts when needed

* Ea python delete week 1 (earthlab#62)

* Add new section on spatial data applications to Intermediate TB (#506) 1-additional-content README.md blog changed_files.txt changed_image_files.txt changed_notebooks.txt changed_rmd_files.txt courses current_branch.txt images keys scripts tutorials workshops Copy images for remote sensing dir to images/earth-analytics
 
 1-additional-content README.md blog changed_files.txt changed_image_files.txt changed_notebooks.txt changed_rmd_files.txt courses current_branch.txt images keys scripts tutorials workshops Add lessons for new section on spatial data apps
 
 1-additional-content README.md blog changed_files.txt changed_image_files.txt changed_notebooks.txt changed_rmd_files.txt courses current_branch.txt images keys scripts tutorials workshops Small edits to clean up lessons
 
 1-additional-content README.md blog changed_files.txt changed_image_files.txt changed_notebooks.txt changed_rmd_files.txt courses current_branch.txt images keys scripts tutorials workshops Small text updates to pgs 1 and 4
 
 1-additional-content README.md blog changed_files.txt changed_image_files.txt changed_notebooks.txt changed_rmd_files.txt courses current_branch.txt images keys scripts tutorials workshops Update chapter name

* Delete moved lessons from week 1 ea python course

Co-authored-by: earth-lab <[email protected]>

Co-authored-by: earth-lab <[email protected]>
  • Loading branch information
Leah Wasser and earth-lab authored Feb 14, 2020
1 parent f2a8cd3 commit 1709990
Show file tree
Hide file tree
Showing 26 changed files with 313 additions and 1,458 deletions.
69 changes: 61 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
# get names of changed files
echo "${changed_files} ">> changed_files.txt
# Remove unwanted files from commit and count files changed
python parse-commit.py
python scripts/parse-commit.py
# Get latest commit message
echo $(git log -1 --pretty=%B) > commit_msg_latest.txt
Expand All @@ -29,6 +29,15 @@ jobs:
else
echo "No files were modified in the last commit."
fi
- run:
name: Get removed, renamed, or moved files
working_directory: ~/eds-lessons-website
command: |
deleted_files=$(git diff-tree --no-commit-id --name-only --diff-filter=D -r HEAD 2>&1)
# get names of changed files
echo "${deleted_files} ">> deleted_files.txt
python scripts/parse-deleted.py
ls
- run:
name: Get & print current branch
working_directory: ~/eds-lessons-website
Expand All @@ -44,7 +53,7 @@ jobs:
command: |
branch=$(head -1 eds-lessons-website/current_branch.txt)
# Only clone eds.org if there are files to commit
if [[ -f ~/eds-lessons-website/website_files.txt ]]
if [[ -f ~/eds-lessons-website/website_files.txt ]] || [ -f ~/eds-lessons-website/deleted_files.txt ]
then
if [ "$branch" != "master" ]
then
Expand All @@ -55,7 +64,7 @@ jobs:
then
# clone the remote branch
git clone --depth 1 https://${EDS_LESSONS_GITHUB_TOKEN_EL}@github.com/earthlab/earthlab.github.io.git -b "$branch"
echo "Looks like the branch doesn't existing on the eds.org website, created branch for you."
echo "Looks like the branch doesn't exist on the eds.org website, created branch for you."
else
# if the branch doesn't exist, clone master and checkout the branch as a new branch
git clone --depth 1 https://${EDS_LESSONS_GITHUB_TOKEN_EL}@github.com/earthlab/earthlab.github.io.git
Expand All @@ -78,17 +87,61 @@ jobs:
git checkout -b website-autobuild
fi
fi
# Copy files to the live website repo
cd ~/eds-lessons-website
python move-files.py
# Only Copy files to the live website repo if there are files to move
# This might be nice as it's own step.
if [[ -f website_files.txt ]]
then
cd ~/eds-lessons-website
python scripts/move-files.py
fi
else
echo "There are no changes, not cloning the website repo."
fi
pwd
- run:
name: Delete removed/renamed/moved images from .io website
working_directory: ~/eds-lessons-website
command: |
if [[ -f deleted_image_files.txt ]]
then
echo -e "Deleting the following images:"
cat deleted_image_files.txt | while read line
do
echo $line
image_to_delete=~/earthlab.github.io/$line
rm $image_to_delete
done
else
echo "There are no images to remove in this PR!"
fi
- run:
name: Delete removed/renamed/moved markdown files and associated image directories from .io website
working_directory: ~/eds-lessons-website
command: |
ls
if [[ -f deleted_md_files.txt ]]
then
echo -e "Deleting the following notebooks and their images:"
cat deleted_md_files.txt | while read line
do
echo $line
post_to_delete=~/earthlab.github.io/$line
rm $post_to_delete
echo "$post_to_delete"
# clear images dir associated with post
image_dir_to_delete=~/earthlab.github.io/images/${line%.*}
rm -rf $image_dir_to_delete
echo "$image_dir_to_delete"
done
else
echo "There are no lessons and associated lesson images to remove in this PR!"
fi
- run:
name: Push files to new repo
name: Push changes in files and images to earthlab.github.io repo
working_directory: ~/earthlab.github.io
command: |
if [[ -f ~/eds-lessons-website/website_files.txt ]]
if [[ -f ~/eds-lessons-website/website_files.txt ]] || [ -f ~/eds-lessons-website/deleted_files.txt ]
then
# Be sure to see how many files there are and only commit if there are more than 0
git status
Expand Down

This file was deleted.

Loading

0 comments on commit 1709990

Please sign in to comment.