-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Individual docker scripts ci changes #1001
base: master
Are you sure you want to change the base?
Conversation
…al-docker-scripts-ci
…al-docker-scripts-ci
Reviewer's Guide by SourceryThis pull request refactors the CI/CD pipeline for Docker container deployment, introducing new scripts for generating and managing container scripts for the metadata server, repository server, and GCS (Globus Connect Server). The changes aim to improve modularity, reduce redundancy, and enhance the maintainability of the deployment process. File-Level Changes
Tips
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @nedvedba - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider adding error handling in the CI pipeline to check for the existence and executability of the new scripts before running them.
- It would be beneficial to update or create documentation for the new environment variables and configuration options introduced in this change.
Here's what I looked at during the review
- 🟡 General issues: 2 issues found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.
FILE_NAME=$(basename "${SCRIPT}") | ||
SOURCE=$(dirname "$SCRIPT") | ||
PROJECT_ROOT=$(realpath "${SOURCE}/..") | ||
source "${PROJECT_ROOT}/config/datafed.sh" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Consider centralizing environment variable handling
While sourcing the config file is good, consider creating a separate function to handle environment variables. This would make it easier to manage and update environment variables across all scripts.
# Function to load environment variables
load_environment_variables() {
local config_file="${PROJECT_ROOT}/config/datafed.sh"
if [[ -f "$config_file" ]]; then
source "$config_file"
else
echo "Error: Config file not found: $config_file"
exit 1
fi
}
load_environment_variables
|
||
USER_ID=$(id -u) | ||
|
||
docker run -d \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Add error handling for Docker commands
Consider adding error checking after Docker commands. For example: 'if [ $? -ne 0 ]; then echo "Error: Docker command failed"; exit 1; fi'
docker run -d \
--restart=always \
--name datafed-nginx \
if [ $? -ne 0 ]; then
echo "Error: Docker run command failed"
exit 1
fi
Summary by Sourcery
Refactor CI configuration to utilize new script-based Docker container management, enhancing maintainability and reducing inline script complexity.
CI: