unicef / drone-4sdgtoolkit

Toolkit of drones-for-public-good resources including text, image, video and audio content, and open-source software, code, libraries, and training datasets.
https://unicef.github.io/drone-4sdgtoolkit/
Creative Commons Attribution Share Alike 4.0 International
8 stars 4 forks source link

Debug deploy script and failure to deploy for multiple commiters #18

Closed jwflory closed 2 years ago

jwflory commented 2 years ago

Summary

Debug the CI deploy script and why it fails to deploy for some users but not others

Background

Some CI jobs will fail to deploy the site, even when the build step is passing. See this job; most of the deploy script finishes successfully but then it fails to force-push to gh-pages branch. I added more verbosity in commit 9240b899da1644ce92c6ed83722583f3a666701c, but this needs additional investigation.

Details

I suspect this is some issue with SSH keys and deploy keys. When I push changes to the GitHub repository, the CI job completes successfully. When @enonied4g pushes changes, the deploy script will fail and refuse to publish new content.

Outcome

Any committer is able to create, modify, and publish content on the Toolkit

jwflory commented 2 years ago

Fixed in commit 0da4320c32b7ef2265342fe5382105acbbf628a9. The issue was the $CIRCLE_USERNAME environment variable is not set if the committer has never logged into CircleCI before, which caused the git config command to fail. This is rectified with a check if the environment variable is not set, and uses a custom string instead of deriving the username from the environment variable. The last few commits verify this fix as working. ✅

Closing this one! 🎬