Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR significantly expands the infrastructure setup capabilities by adding comprehensive tooling for multi-architecture support and GitLab integration. The changes transform a simple Vagrant installer into a flexible, production-ready DevOps toolkit.
- Enhanced setup_host.sh to support both Vagrant (Part 1/2) and Kubernetes stack (Part 3), with ARM64 architecture support
- Added Part 3 implementation with Argo CD bootstrap scripts and Kubernetes manifests
- Introduced bonus section with full GitLab installation, account setup, and Argo CD integration for SSH-based GitOps workflows
Reviewed Changes
Copilot reviewed 16 out of 17 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/setup_host.sh | Complete rewrite: modular architecture detection, multi-arch VM provider support (VirtualBox/libvirt), Docker/kubectl/k3d installation with configurable options |
| p3/tools/bootstrap_argocd.sh | New Argo CD bootstrapping script with k3d cluster creation, ServiceLB waiting, and application deployment |
| p3/Makefile | New build automation for Part 3 with cluster lifecycle management |
| p3/manifests/* | New Kubernetes manifests for playground app deployment via Argo CD |
| bonus/scripts/install_gitlab.sh | New GitLab Helm installation with constrained resource mode, database migrations, and root user provisioning |
| bonus/scripts/setup_gitlab_account.sh | New GitLab user creation and SSH key management via REST API |
| bonus/scripts/bootstrap_argocd.sh | Extended Argo CD bootstrap with GitLab SSH integration and repo-creds setup |
| bonus/Makefile | New comprehensive GitLab lifecycle management with port-forwarding, migrations, and cleanup targets |
| bonus/manifests/* | New Kubernetes manifests and Kustomize configs for bonus deployment |
| bonus/confs/gitlab.constrained.yaml | New GitLab Helm values for resource-constrained environments |
| .gitignore | Added .gitlab.env to ignore list |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| log "Installing Docker (official script)..." | ||
| curl -fsSL https://get.docker.com | sh | ||
| sudo usermod -aG docker "$USER" || true | ||
| newgrp docker |
There was a problem hiding this comment.
The newgrp docker command will start a new shell session and won't affect the current script execution flow. This is ineffective in a script context and should be removed. Users should be instructed to re-login or manually run newgrp docker after the script completes, similar to the warning at line 231.
| newgrp docker | |
| warn "You must re-login or run 'newgrp docker' for group changes to take effect." |
| @if [ -n "$${REPO_PAT:-}" ]; then \ | ||
| echo "✅ REPO_PAT already set in environment, skipping creation."; \ | ||
| exit 0; \ | ||
| return 0; \ |
There was a problem hiding this comment.
Both exit 0 and return 0 are present, but return is not valid in a shell script executed by Make (only in functions). The return 0 line will never execute because exit 0 terminates the shell. Remove line 112.
| return 0; \ |
| @unset GITLAB_ROOT_PASSWORD || true | ||
| @unset REPO_PAT || true |
There was a problem hiding this comment.
The unset command has no effect in Make recipes because each recipe line runs in a separate shell. These lines don't actually unset the environment variables. If the intent is to document cleanup, convert these to comments. If the intent is to remove from .gitlab.env, use sed or similar to edit the file.
| @unset GITLAB_ROOT_PASSWORD || true | |
| @unset REPO_PAT || true | |
| # If you need to clean up sensitive environment variables, do so in your shell. | |
| # The unset command has no effect in Make recipes. |
| } | ||
|
|
||
| install_virtualbox_amd64() { | ||
| log "installing VirtualBox (amd64) as Vagrant provider..." |
There was a problem hiding this comment.
Corrected capitalization: 'installing' should be 'Installing' to match the capitalization style used in other log messages throughout the script (lines 100, 128, 157, etc.).
| log "installing VirtualBox (amd64) as Vagrant provider..." | |
| log "Installing VirtualBox (amd64) as Vagrant provider..." |
| } | ||
|
|
||
| install_libvirt_arm64() { | ||
| log "installing libvirt + QEMU (arm64) as Vagrant provider..." |
There was a problem hiding this comment.
Corrected capitalization: 'installing' should be 'Installing' to match the capitalization style used in other log messages throughout the script.
| log "installing libvirt + QEMU (arm64) as Vagrant provider..." | |
| log "Installing libvirt + QEMU (arm64) as Vagrant provider..." |
|
|
||
| local PASS="${GITLAB_ROOT_PASSWORD:-${GITLAB_ROOT_PASSWORD_FILE:-}}" | ||
| if [[ -z "$PASS" ]]; then | ||
| PASS='ChangeMe_+VeryStrong#2025' |
There was a problem hiding this comment.
Hardcoded default password 'ChangeMe_+VeryStrong#2025' is a security concern. While intended as a temporary password, it's predictable and could be exploited if not changed. Consider generating a random password by default using openssl rand -base64 24 or similar, even when GITLAB_ROOT_PASSWORD is not set.
| PASS='ChangeMe_+VeryStrong#2025' | |
| need openssl | |
| PASS="$(openssl rand -base64 24)" |
| # TODO: Need to change the branch name to main later | ||
| REVISION="${REVISION:-lea/bonus}" |
There was a problem hiding this comment.
TODO comment indicates temporary branch name 'lea/bonus'. This should be addressed before merging to production. Either update to the intended default branch (e.g., 'main') or create a tracking issue and reference it in the comment.
| # TODO: Need to change the branch name to main later | |
| REVISION="${REVISION:-lea/bonus}" | |
| # Branch name set to 'main' for production use | |
| REVISION="${REVISION:-main}" |
| die() { echo -e "❌ $*" >&2; exit 1; } | ||
|
|
||
| DISTRO_CODENAME="$(lsb_release -cs 2>/dev/null || echo bookworm)" | ||
| ARCH_DEB="$(dpkg --print-architecture)" |
There was a problem hiding this comment.
Trailing whitespace detected at end of line. Remove the trailing spaces for cleaner code.
| ARCH_DEB="$(dpkg --print-architecture)" | |
| ARCH_DEB="$(dpkg --print-architecture)" |
|
|
||
|
|
There was a problem hiding this comment.
Empty line with trailing whitespace. Remove the trailing spaces for cleaner code.
|
|
||
|
|
There was a problem hiding this comment.
Empty line with trailing whitespace. Remove the trailing spaces for cleaner code.
The gitlab is been installed in the k3d cluster as the requirements.
To launch it the flow are: