diff --git a/.github/workflows/validate-jenkins-tests.yml b/.github/workflows/validate-jenkins-tests.yml new file mode 100644 index 0000000..b9bb9e9 --- /dev/null +++ b/.github/workflows/validate-jenkins-tests.yml @@ -0,0 +1,24 @@ +name: Validate Jenkins Shell Tests +permissions: + contents: read + +on: + pull_request: + paths: + - "Jenkinsfile" + - "ci/jenkins/**" + - ".github/workflows/validate-jenkins-tests.yml" + workflow_dispatch: + +jobs: + validate: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v5 + + - name: Run Jenkins shell tests + shell: bash + run: | + set -xeuo pipefail + bash ci/jenkins/tests/run-all.sh diff --git a/.gitignore b/.gitignore index c5bcd68..14b92b3 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,7 @@ output _build-*/** *.log .worktrees/ + +*.txt + +docs/superpowers/ diff --git a/Jenkinsfile b/Jenkinsfile index 0faad05..d83d41b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -227,7 +227,13 @@ gh release upload "$release_tag" "$MANIFEST_FILE" --clobber } post { - success { + always { + archiveArtifacts artifacts: 'ci/jenkins/build/*', allowEmptyArchive: true + script { + def result = (currentBuild.currentResult ?: 'SUCCESS').toUpperCase() + env.N8N_STATUS = result == 'SUCCESS' ? 'success' : 'failure' + env.N8N_ERROR_SUMMARY = result == 'SUCCESS' ? '' : 'Pipeline failed before completion.' + } withCredentials([ string(credentialsId: 'n8n-webhook-url', variable: 'WEBHOOK_URL'), string(credentialsId: 'n8n-webhook-token', variable: 'N8N_WEBHOOK_SHARED_TOKEN') @@ -235,7 +241,11 @@ gh release upload "$release_tag" "$MANIFEST_FILE" --clobber sh '''#!/usr/bin/env bash set -euo pipefail -published_tags="$(paste -sd, "$TAGS_FILE")" +published_tags="" +if [[ -f "$TAGS_FILE" ]]; then + published_tags="$(paste -sd, "$TAGS_FILE")" +fi + finished_at="$(date -u +%Y-%m-%dT%H:%M:%SZ)" build_started_at="${BUILD_STARTED_AT:-}" if [[ -z "$build_started_at" && -f ci/jenkins/build/started_at ]]; then @@ -260,68 +270,29 @@ finished_epoch="$(date -u -d "$finished_at" +%s 2>/dev/null || printf '0')" duration_ms="$(( (finished_epoch - started_epoch) * 1000 ))" if (( duration_ms < 0 )); then duration_ms=0; fi -export STATUS="success" +export STATUS="${N8N_STATUS:-failure}" export JOB_NAME="$JOB_NAME" export BUILD_NUMBER="$BUILD_NUMBER" export BUILD_URL="$BUILD_URL" git_sha="${GIT_COMMIT:-${GIT_PREVIOUS_SUCCESSFUL_COMMIT:-unknown}}" export GIT_SHA="$git_sha" export IMAGE_NAME="$IMAGE_REPOSITORY" -export PUBLISHED_TAGS="${published_tags:-$short_date}" +if [[ "$STATUS" == "success" ]]; then + export PUBLISHED_TAGS="${published_tags:-$short_date}" +else + export PUBLISHED_TAGS="" +fi export TIMESTAMP_UTC="$finished_at" -export ERROR_SUMMARY="" +export ERROR_SUMMARY="${N8N_ERROR_SUMMARY:-}" export STARTED_AT="$build_started_at" export FINISHED_AT="$finished_at" export DURATION_MS="$duration_ms" export RELEASE_TAG="${release_tag:-unknown}" if ! bash ci/jenkins/scripts/notify_n8n.sh; then - echo "WARN: notify_n8n.sh failed in post-success hook (best-effort notification)." >&2 -fi -''' - } - } - failure { - withCredentials([ - string(credentialsId: 'n8n-webhook-url', variable: 'WEBHOOK_URL'), - string(credentialsId: 'n8n-webhook-token', variable: 'N8N_WEBHOOK_SHARED_TOKEN') - ]) { - sh '''#!/usr/bin/env bash -set -euo pipefail - -finished_at="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -started_at="${BUILD_STARTED_AT:-}" -if [[ -z "$started_at" && -f ci/jenkins/build/started_at ]]; then - started_at="$(/dev/null || printf '0')" -finished_epoch="$(date -u -d "$finished_at" +%s 2>/dev/null || printf '0')" -duration_ms="$(( (finished_epoch - started_epoch) * 1000 ))" -if (( duration_ms < 0 )); then duration_ms=0; fi - -export STATUS="failure" -export JOB_NAME="$JOB_NAME" -export BUILD_NUMBER="$BUILD_NUMBER" -export BUILD_URL="$BUILD_URL" -export GIT_SHA="${GIT_COMMIT:-unknown}" -export IMAGE_NAME="$IMAGE_REPOSITORY" -export PUBLISHED_TAGS="" -export TIMESTAMP_UTC="$finished_at" -export ERROR_SUMMARY="Pipeline failed before completion." -export STARTED_AT="$started_at" -export FINISHED_AT="$finished_at" -export DURATION_MS="$duration_ms" -export RELEASE_TAG="${RELEASE_TAG:-unknown}" -if ! bash ci/jenkins/scripts/notify_n8n.sh; then - echo "WARN: notify_n8n.sh failed in post-failure hook (best-effort notification)." >&2 + echo "WARN: notify_n8n.sh failed in post hook (best-effort notification)." >&2 fi ''' } } - always { - archiveArtifacts artifacts: 'ci/jenkins/build/*', allowEmptyArchive: true - } } } diff --git a/README.md b/README.md index 22c94a4..6ba5aeb 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ This project was created using the finpilot template: View screenshots -### GDM session selector +### COSMIC Greeter -![GDM session selector](https://raw.githubusercontent.com/ericrocha97/bluefin/main/docs/images/gdm-selector.png) +![COSMIC Greeter](https://raw.githubusercontent.com/ericrocha97/bluefin/main/docs/images/cosmic-greeter.png) ### COSMIC desktop ![COSMIC desktop](https://raw.githubusercontent.com/ericrocha97/bluefin/main/docs/images/cosmic-desktop.png) -### GNOME desktop - -![GNOME desktop](https://raw.githubusercontent.com/ericrocha97/bluefin/main/docs/images/gnome-desktop.png) - diff --git a/README.pt-BR.md b/README.pt-BR.md index d6234f6..a832937 100644 --- a/README.pt-BR.md +++ b/README.pt-BR.md @@ -7,7 +7,7 @@ Este projeto foi criado usando o template finpilot: Ver screenshots -### Seletor de sessão no GDM +### COSMIC Greeter -![Seletor de sessão no GDM](https://raw.githubusercontent.com/ericrocha97/bluefin/main/docs/images/gdm-selector.png) +![COSMIC Greeter](https://raw.githubusercontent.com/ericrocha97/bluefin/main/docs/images/cosmic-greeter.png) ### Desktop COSMIC ![Desktop COSMIC](https://raw.githubusercontent.com/ericrocha97/bluefin/main/docs/images/cosmic-desktop.png) -### Desktop GNOME - -![Desktop GNOME](https://raw.githubusercontent.com/ericrocha97/bluefin/main/docs/images/gnome-desktop.png) - diff --git a/build/15-system-optimizations.sh b/build/15-system-optimizations.sh index b01a0eb..0ab4e17 100755 --- a/build/15-system-optimizations.sh +++ b/build/15-system-optimizations.sh @@ -16,7 +16,6 @@ set -eoux pipefail # - journald size limits # - rpm-ostreed automatic update policy # - earlyoom configuration -# - GNOME mutter check-alive-timeout ############################################################################### # Source helper functions @@ -106,24 +105,6 @@ log_success "earlyoom service enabled" echo "::endgroup::" -############################################################################### -# Install GNOME GSettings Override -############################################################################### - -echo "::group:: Install GNOME Tweaks" -log_step "Installing GNOME GSettings overrides..." - -mkdir -p /usr/share/glib-2.0/schemas/ -cp -v "${SYSTEM_FILES_DIR}"/usr/share/glib-2.0/schemas/99-custom.gschema.override \ - /usr/share/glib-2.0/schemas/ - -# Recompile GSettings schemas to apply overrides -log_info "Recompiling GSettings schemas..." -glib-compile-schemas /usr/share/glib-2.0/schemas/ -log_success "GNOME check-alive-timeout set to 20000ms" - -echo "::endgroup::" - ############################################################################### # Install Custom Fastfetch Configuration ############################################################################### @@ -156,5 +137,4 @@ log_info " ✓ Transparent Huge Pages (defer+madvise, shrinker at 80%)" log_info " ✓ Journal size limited to 50MB" log_info " ✓ Automatic updates (stage policy)" log_info " ✓ earlyoom enabled (5% memory/swap threshold)" -log_info " ✓ GNOME mutter check-alive-timeout = 20s" log_info " ✓ Custom fastfetch config (image info, COSMIC version, build date)" diff --git a/build/30-cosmic-desktop.sh b/build/30-cosmic-desktop.sh index 980e9c7..4802594 100644 --- a/build/30-cosmic-desktop.sh +++ b/build/30-cosmic-desktop.sh @@ -3,11 +3,10 @@ set -eoux pipefail ############################################################################### -# Install COSMIC Desktop (System76) alongside GNOME +# Install COSMIC Desktop (System76) ############################################################################### # This script installs COSMIC from the System76 COPR repository. -# Base image is bluefin-dx:stable-daily which includes GNOME. -# COSMIC is installed as an additional desktop option, selectable at login. +# GNOME removal and display-manager switching happen later in 40-remove-gnome.sh. ############################################################################### # Source helper functions (includes logging utilities) @@ -23,7 +22,7 @@ else fi log_section "Installing COSMIC Desktop" -log_info "COSMIC will be installed alongside GNOME (dual desktop setup)" +log_info "COSMIC will be installed as the only desktop session in the final image" ############################################################################### # Install COSMIC Packages @@ -31,7 +30,6 @@ log_info "COSMIC will be installed alongside GNOME (dual desktop setup)" echo "::group:: Install COSMIC Desktop" -# Define COSMIC packages to install COSMIC_PACKAGES=( cosmic-session cosmic-greeter @@ -59,8 +57,6 @@ COSMIC_PACKAGES=( log_step "Installing COSMIC packages from COPR ryanabx/cosmic-epoch..." log_info "Packages to install: ${COSMIC_PACKAGES[*]}" -# Install COSMIC desktop from System76's COPR -# Using isolated pattern to prevent COPR from persisting copr_install_isolated "ryanabx/cosmic-epoch" "${COSMIC_PACKAGES[@]}" echo "::endgroup::" @@ -72,7 +68,6 @@ echo "::endgroup::" echo "::group:: Verify COSMIC Installation" log_step "Verifying COSMIC package installation..." -# Verify all installed COSMIC packages verification_failed=0 for pkg in "${COSMIC_PACKAGES[@]}"; do if ! verify_package "$pkg"; then @@ -85,43 +80,16 @@ if [[ $verification_failed -eq 1 ]]; then exit 1 fi -log_success "All COSMIC packages verified successfully" -echo "::endgroup::" - -############################################################################### -# Configure Display Manager -############################################################################### - -echo "::group:: Configure Display Manager" -log_step "Configuring display manager for dual desktop support..." - -# Keep GDM as default display manager (comes with bluefin-dx) -# User can choose between GNOME and COSMIC at login screen -log_info "GDM will remain as default display manager" -log_info "Users can select COSMIC or GNOME from the gear icon at login" - -# Verify COSMIC session file exists if [[ -f /usr/share/wayland-sessions/cosmic.desktop ]]; then log_success "COSMIC session registered: /usr/share/wayland-sessions/cosmic.desktop" else - log_warn "COSMIC session file not found at expected location" - log_info "Checking alternative locations..." - find /usr/share -name "cosmic*.desktop" 2>/dev/null | while read -r session_file; do - log_info "Found session file: $session_file" - done -fi - -# List available sessions -log_info "Available desktop sessions:" -if [[ -d /usr/share/wayland-sessions ]]; then - for session in /usr/share/wayland-sessions/*.desktop; do - if [[ -f "$session" ]]; then - session_name=$(grep -E "^Name=" "$session" 2>/dev/null | cut -d= -f2 || basename "$session") - log_info " - $session_name ($(basename "$session"))" - fi - done + log_error "COSMIC session file not found at /usr/share/wayland-sessions/cosmic.desktop" + log_info "Available COSMIC desktop files:" + find /usr/share -name "cosmic*.desktop" 2>/dev/null || true + exit 1 fi +log_success "All COSMIC packages verified successfully" echo "::endgroup::" ############################################################################### @@ -129,12 +97,5 @@ echo "::endgroup::" ############################################################################### log_section "COSMIC Desktop Installation Complete" -log_success "COSMIC desktop installed successfully as secondary desktop" -log_info "" -log_info "Desktop selection instructions:" -log_info " 1. At the GDM login screen, click the gear icon (⚙️)" -log_info " 2. Select 'COSMIC' or 'GNOME' session" -log_info " 3. Enter your password to log in" -log_info "" -log_info "To switch default display manager to COSMIC Greeter (optional):" -log_info " sudo systemctl disable gdm && sudo systemctl enable cosmic-greeter" +log_success "COSMIC desktop installed successfully" +log_info "GNOME removal and COSMIC Greeter activation will run in 40-remove-gnome.sh" diff --git a/build/40-remove-gnome.sh b/build/40-remove-gnome.sh new file mode 100644 index 0000000..ccb5ea2 --- /dev/null +++ b/build/40-remove-gnome.sh @@ -0,0 +1,186 @@ +#!/usr/bin/bash + +set -eoux pipefail + +############################################################################### +# Remove GNOME Desktop and Enable COSMIC Greeter +############################################################################### +# COSMIC is installed by 30-cosmic-desktop.sh before this script runs. +# Keep this script conservative: remove user-facing GNOME desktop/session pieces, +# not shared GTK/GLib libraries that other applications may still need. +############################################################################### + +# Source helper functions (includes logging utilities) +# shellcheck source=build/copr-helpers.sh +# shellcheck disable=SC1091 +if [[ -f /ctx/build/copr-helpers.sh ]]; then + source /ctx/build/copr-helpers.sh +elif [[ -f "$(dirname "$0")/copr-helpers.sh" ]]; then + source "$(dirname "$0")/copr-helpers.sh" +else + echo "copr-helpers.sh not found in /ctx/build or script directory" >&2 + exit 1 +fi + +log_section "Removing GNOME Desktop" + +############################################################################### +# Display Manager Transition +############################################################################### + +echo "::group:: Disable GDM" +log_step "Disabling GDM before package removal..." + +if systemctl list-unit-files gdm.service --no-legend 2>/dev/null | grep -q '^gdm.service'; then + systemctl disable gdm.service || log_warn "Unable to disable gdm.service before removal" + log_success "gdm.service disabled" +else + log_info "gdm.service unit is not present" +fi + +echo "::endgroup::" + +############################################################################### +# Remove GNOME Packages +############################################################################### + +echo "::group:: Remove GNOME packages" +log_step "Preparing conservative GNOME desktop package removal list..." + +GNOME_PACKAGES=( + gdm + gnome-shell + gnome-session + gnome-session-wayland-session + gnome-session-xsession + gnome-classic-session + gnome-control-center + gnome-software + gnome-initial-setup + gnome-tour + gnome-terminal + gnome-text-editor + gnome-system-monitor + gnome-disk-utility + gnome-calendar + gnome-contacts + gnome-clocks + gnome-logs + gnome-maps + gnome-weather + gnome-connections + gnome-remote-desktop + gnome-user-docs + gnome-user-share + gnome-browser-connector + nautilus + mutter + xdg-desktop-portal-gnome +) + +installed_packages=() +absent_packages=() + +for pkg in "${GNOME_PACKAGES[@]}"; do + if rpm -q "$pkg" &>/dev/null; then + installed_packages+=("$pkg") + else + absent_packages+=("$pkg") + fi +done + +if [[ ${#absent_packages[@]} -gt 0 ]]; then + log_info "GNOME removal candidates not installed: ${absent_packages[*]}" +fi + +if [[ ${#installed_packages[@]} -gt 0 ]]; then + log_info "Removing installed GNOME packages: ${installed_packages[*]}" + dnf5 remove -y "${installed_packages[@]}" + log_success "Installed GNOME package candidates removed" +else + log_info "No GNOME package candidates were installed" +fi + +echo "::endgroup::" + +############################################################################### +# Remove Leftover GNOME Session Files +############################################################################### + +echo "::group:: Remove GNOME session files" +log_step "Removing leftover GNOME session files..." + +rm -f \ + /usr/share/wayland-sessions/gnome.desktop \ + /usr/share/wayland-sessions/gnome-classic.desktop \ + /usr/share/xsessions/gnome.desktop \ + /usr/share/xsessions/gnome-classic.desktop + +log_success "GNOME session file cleanup complete" +echo "::endgroup::" + +############################################################################### +# Enable COSMIC Greeter +############################################################################### + +echo "::group:: Enable COSMIC Greeter" +log_step "Enabling cosmic-greeter.service..." + +if systemctl list-unit-files cosmic-greeter.service --no-legend 2>/dev/null | grep -q '^cosmic-greeter.service'; then + systemctl enable cosmic-greeter.service + log_success "cosmic-greeter.service enabled" +else + log_error "cosmic-greeter.service unit not found" + log_info "Available greeter unit files:" + systemctl list-unit-files '*greeter*' --no-legend 2>/dev/null || true + exit 1 +fi + +echo "::endgroup::" + +############################################################################### +# Verify COSMIC-only State +############################################################################### + +echo "::group:: Verify COSMIC-only desktop state" +log_step "Verifying COSMIC session and GNOME removal..." + +if [[ ! -f /usr/share/wayland-sessions/cosmic.desktop ]]; then + log_error "COSMIC session file is missing after GNOME removal" + exit 1 +fi + +shopt -s nullglob +gnome_sessions=( + /usr/share/wayland-sessions/gnome*.desktop + /usr/share/xsessions/gnome*.desktop +) +shopt -u nullglob + +if [[ ${#gnome_sessions[@]} -gt 0 ]]; then + log_error "GNOME session files remain: ${gnome_sessions[*]}" + exit 1 +fi + +critical_packages=(gdm gnome-shell gnome-session) +critical_failure=0 +for pkg in "${critical_packages[@]}"; do + if rpm -q "$pkg" &>/dev/null; then + log_error "Critical GNOME package still installed: $pkg" + critical_failure=1 + fi +done + +if [[ $critical_failure -eq 1 ]]; then + exit 1 +fi + +log_success "COSMIC session is present and GNOME sessions are absent" +echo "::endgroup::" + +############################################################################### +# Summary +############################################################################### + +log_section "GNOME Removal Complete" +log_success "COSMIC Greeter is enabled and GNOME desktop sessions are removed" diff --git a/build/README.md b/build/README.md index 21bfcbf..a25c79c 100644 --- a/build/README.md +++ b/build/README.md @@ -10,9 +10,10 @@ This directory contains build scripts that run during image creation. Scripts ar ## Included Scripts - **`10-build.sh`** - Main build script. Copies Flatpak preinstall files, installs `copr-cli`, `earlyoom`, `ffmpegthumbnailer`, and `libvdpau-va-gl`, enables `podman.socket`, and runs the other numbered scripts. -- **`15-system-optimizations.sh`** - Installs CachyOS/LinuxToys system optimizations (sysctl, udev, modprobe, tmpfiles, journald), configures earlyoom, rpm-ostreed auto-updates, and GNOME tweaks. +- **`15-system-optimizations.sh`** - Installs CachyOS/LinuxToys system optimizations (sysctl, udev, modprobe, tmpfiles, journald), configures earlyoom, and enables rpm-ostreed auto-updates. - **`20-third-party-repos.sh`** - Installs VSCode Insiders, Warp Terminal, and Vicinae (official Terra bootstrap with COPR fallback) from RPM repos. - **`30-cosmic-desktop.sh`** - Installs COSMIC desktop from System76's COPR repository. +- **`40-remove-gnome.sh`** - Removes GNOME desktop/session components and enables COSMIC Greeter. - **`99-versions.sh`** - Writes a version manifest to `/usr/share/bluefin-cosmic-dx/manifest.json`. - **`copr-helpers.sh`** - Helper functions for COPR management and logging. diff --git a/ci/jenkins/scripts/notify_n8n.sh b/ci/jenkins/scripts/notify_n8n.sh index 0ee9d99..72a9299 100644 --- a/ci/jenkins/scripts/notify_n8n.sh +++ b/ci/jenkins/scripts/notify_n8n.sh @@ -19,8 +19,6 @@ error_summary="${ERROR_SUMMARY:-}" dry_run="${DRY_RUN:-false}" curl_connect_timeout="${N8N_NOTIFY_CONNECT_TIMEOUT_SECONDS:-5}" curl_max_time="${N8N_NOTIFY_MAX_TIME_SECONDS:-30}" -curl_retry_count="${N8N_NOTIFY_RETRY_COUNT:-3}" -curl_retry_delay="${N8N_NOTIFY_RETRY_DELAY_SECONDS:-2}" json_escape() { local value="$1" @@ -83,9 +81,6 @@ fi printf '%s' "$payload" | curl --silent --show-error --fail \ --connect-timeout "$curl_connect_timeout" \ --max-time "$curl_max_time" \ - --retry "$curl_retry_count" \ - --retry-delay "$curl_retry_delay" \ - --retry-all-errors \ --request POST \ --header "Content-Type: application/json" \ --header "x-jenkins-webhook-token: $N8N_WEBHOOK_SHARED_TOKEN" \ diff --git a/ci/jenkins/tests/run-all.sh b/ci/jenkins/tests/run-all.sh index 0a180d0..f781b17 100644 --- a/ci/jenkins/tests/run-all.sh +++ b/ci/jenkins/tests/run-all.sh @@ -9,5 +9,6 @@ bash "$SCRIPT_DIR/test_extract_versions.sh" bash "$SCRIPT_DIR/test_create_github_release.sh" bash "$SCRIPT_DIR/test_notify_n8n.sh" bash "$SCRIPT_DIR/test_jenkinsfile_structure.sh" +bash "$SCRIPT_DIR/test_cosmic_only_scripts.sh" bash "$SCRIPT_DIR/test_sql_schema.sh" bash "$SCRIPT_DIR/test_n8n_blueprint.sh" diff --git a/ci/jenkins/tests/test_cosmic_only_scripts.sh b/ci/jenkins/tests/test_cosmic_only_scripts.sh new file mode 100644 index 0000000..c12422f --- /dev/null +++ b/ci/jenkins/tests/test_cosmic_only_scripts.sh @@ -0,0 +1,61 @@ +#!/usr/bin/env bash + +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +REPO_ROOT="$(cd "$SCRIPT_DIR/../../.." && pwd)" + +# shellcheck disable=SC1091 +source "$SCRIPT_DIR/assert.sh" + +COSMIC_SCRIPT="$REPO_ROOT/build/30-cosmic-desktop.sh" +REMOVE_GNOME_SCRIPT="$REPO_ROOT/build/40-remove-gnome.sh" +OPTIMIZATIONS_SCRIPT="$REPO_ROOT/build/15-system-optimizations.sh" +README_EN="$REPO_ROOT/README.md" +README_PT="$REPO_ROOT/README.pt-BR.md" +BUILD_README="$REPO_ROOT/build/README.md" + +assert_file_contains "$COSMIC_SCRIPT" 'log_section "Installing COSMIC Desktop"' +assert_file_contains "$COSMIC_SCRIPT" "cosmic-greeter" +assert_file_contains "$COSMIC_SCRIPT" "xdg-desktop-portal-cosmic" + +for stale_text in "alongside GNOME" "dual desktop" "GDM will remain" "gear icon"; do + if grep -Fqi -- "$stale_text" "$COSMIC_SCRIPT"; then + fail "Unexpected stale COSMIC install wording in build/30-cosmic-desktop.sh: $stale_text" + fi +done + +assert_file_contains "$REMOVE_GNOME_SCRIPT" "GNOME_PACKAGES=(" +assert_file_contains "$REMOVE_GNOME_SCRIPT" "cosmic-greeter.service" +assert_file_contains "$REMOVE_GNOME_SCRIPT" "dnf5 remove -y" +assert_file_contains "$REMOVE_GNOME_SCRIPT" "/usr/share/wayland-sessions/gnome.desktop" +assert_file_contains "$REMOVE_GNOME_SCRIPT" "/usr/share/wayland-sessions/cosmic.desktop" + +for stale_text in "GNOME GSettings" "glib-compile-schemas" "check-alive-timeout"; do + if grep -Fq -- "$stale_text" "$OPTIMIZATIONS_SCRIPT"; then + fail "Unexpected GNOME optimization remains in build/15-system-optimizations.sh: $stale_text" + fi +done + +for doc_file in "$README_EN" "$README_PT" "$BUILD_README"; do + if grep -Fqi -- "dual desktop" "$doc_file"; then + fail "Unexpected dual desktop wording in $doc_file" + fi + if grep -Fq -- "GNOME + COSMIC" "$doc_file"; then + fail "Unexpected GNOME + COSMIC wording in $doc_file" + fi +done + +for stale_text in "Choosing Desktop at Login" "GDM session selector" "Desktop GNOME" "### GNOME desktop"; do + if grep -Fq -- "$stale_text" "$README_EN"; then + fail "Unexpected stale English README wording: $stale_text" + fi +done + +for stale_text in "Escolhendo o Desktop no Login" "Seletor de sessão no GDM" "Desktop GNOME"; do + if grep -Fq -- "$stale_text" "$README_PT"; then + fail "Unexpected stale Portuguese README wording: $stale_text" + fi +done + +printf 'PASS: test_cosmic_only_scripts.sh\n' diff --git a/ci/jenkins/tests/test_jenkinsfile_structure.sh b/ci/jenkins/tests/test_jenkinsfile_structure.sh index a762ed6..e8f009e 100644 --- a/ci/jenkins/tests/test_jenkinsfile_structure.sh +++ b/ci/jenkins/tests/test_jenkinsfile_structure.sh @@ -20,8 +20,10 @@ assert_file_contains "$JENKINSFILE" "stage('Create GitHub Release')" assert_file_contains "$JENKINSFILE" "stage('Resolve Branch Context')" assert_file_contains "$JENKINSFILE" "post {" -assert_file_contains "$JENKINSFILE" "success {" -assert_file_contains "$JENKINSFILE" "failure {" +assert_file_contains "$JENKINSFILE" "always {" +assert_file_contains "$JENKINSFILE" "currentBuild.currentResult" +assert_file_contains "$JENKINSFILE" "env.N8N_STATUS" +assert_file_contains "$JENKINSFILE" "notify_n8n.sh failed in post hook" assert_file_contains "$JENKINSFILE" "ci/jenkins/scripts/generate_metadata.sh" assert_file_contains "$JENKINSFILE" "ci/jenkins/scripts/extract_versions.sh" @@ -67,6 +69,6 @@ assert_file_contains "$JENKINSFILE" "gh release edit \"\$release_tag\" --title \ assert_file_contains "$JENKINSFILE" "gh release create \"\$release_tag\" --title \"\$release_tag\" --notes-file \"\$RELEASE_BODY_FILE\"" assert_file_contains "$JENKINSFILE" "gh release upload \"\$release_tag\" \"\$MANIFEST_FILE\" --clobber" assert_file_contains "$JENKINSFILE" "git_sha=\"\${GIT_COMMIT:-\${GIT_PREVIOUS_SUCCESSFUL_COMMIT:-unknown}}\"" -assert_file_contains "$JENKINSFILE" "if [[ -z \"\$started_at\" && -f ci/jenkins/build/started_at ]]; then" +assert_file_contains "$JENKINSFILE" "if [[ -z \"\$build_started_at\" && -f ci/jenkins/build/started_at ]]; then" printf 'PASS: test_jenkinsfile_structure.sh\n' diff --git a/ci/jenkins/tests/test_notify_n8n.sh b/ci/jenkins/tests/test_notify_n8n.sh index 00fc608..83a8dc1 100644 --- a/ci/jenkins/tests/test_notify_n8n.sh +++ b/ci/jenkins/tests/test_notify_n8n.sh @@ -70,9 +70,6 @@ assert_file_contains "$CURL_ARGS_FILE" 'header Content-Type: application/json' assert_file_contains "$CURL_ARGS_FILE" 'header x-jenkins-webhook-token: test-shared-token' assert_file_contains "$CURL_ARGS_FILE" 'connect-timeout 5' assert_file_contains "$CURL_ARGS_FILE" 'max-time 30' -assert_file_contains "$CURL_ARGS_FILE" 'retry 3' -assert_file_contains "$CURL_ARGS_FILE" 'retry-delay 2' -assert_file_contains "$CURL_ARGS_FILE" 'retry-all-errors' assert_file_contains "$CURL_ARGS_FILE" 'url https://n8n.example/webhook/build' assert_file_contains "$CURL_BODY_FILE" '"git_sha":"0123456789abcdef"' assert_file_contains "$CURL_BODY_FILE" '"image_name":"ghcr.io/example/bluefin-cosmic-dx"' diff --git a/custom/system-files/usr/share/glib-2.0/schemas/99-custom.gschema.override b/custom/system-files/usr/share/glib-2.0/schemas/99-custom.gschema.override deleted file mode 100644 index 4a2d6ea..0000000 --- a/custom/system-files/usr/share/glib-2.0/schemas/99-custom.gschema.override +++ /dev/null @@ -1,4 +0,0 @@ -[org.gnome.mutter] -# Increase the check-alive-timeout to prevent false "app not responding" dialogs -# Default is 5000ms, which can trigger on heavy workloads -check-alive-timeout=20000 diff --git a/docs/images/cosmic-desktop.png b/docs/images/cosmic-desktop.png index 4358201..6083d73 100644 Binary files a/docs/images/cosmic-desktop.png and b/docs/images/cosmic-desktop.png differ diff --git a/docs/images/cosmic-greeter.png b/docs/images/cosmic-greeter.png new file mode 100644 index 0000000..8adf148 Binary files /dev/null and b/docs/images/cosmic-greeter.png differ diff --git a/docs/images/gdm-selector.png b/docs/images/gdm-selector.png deleted file mode 100644 index 7ff9ec4..0000000 Binary files a/docs/images/gdm-selector.png and /dev/null differ diff --git a/docs/images/gnome-desktop.png b/docs/images/gnome-desktop.png deleted file mode 100644 index 9075b37..0000000 Binary files a/docs/images/gnome-desktop.png and /dev/null differ diff --git a/iso/README.md b/iso/README.md index 23acc62..04e02a5 100644 --- a/iso/README.md +++ b/iso/README.md @@ -22,6 +22,13 @@ just build-qcow2 just run-vm-qcow2 ``` +Default local VM login credentials for QCOW2/RAW test images: + +- Username: `user` +- Password: `user` + +Change the user password hash in `iso/disk.toml` before distributing artifacts. + Build a RAW VM image: ```bash diff --git a/iso/disk.toml b/iso/disk.toml index 7478400..b7307a0 100644 --- a/iso/disk.toml +++ b/iso/disk.toml @@ -1,3 +1,11 @@ [[customizations.filesystem]] mountpoint = "/" minsize = "20 GiB" + +[[customizations.user]] +name = "user" +description = "user" +# Default local VM login password is "user" (SHA-512 hash below). +# Change this hash for your own local testing before distributing artifacts. +password = "$6$zTtLrcd2ocxh3WdL$Nyw/OT9D6Erg.9LN11aSlIMQVCFZgwrJUDkiwJjye.H5zjPZAK7UjBXK.AK2uKocZd4nrE2p3zcShTjuRwk9o." +groups = ["wheel"]