# 软件工程第六组 **Repository Path**: hen121381/software-engineering-group-6 ## Basic Information - **Project Name**: 软件工程第六组 - **Description**: 大学生心理健康平台 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 1 - **Created**: 2024-09-03 - **Last Updated**: 2025-08-16 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Set PowerShell output encoding to UTF-8 $OutputEncoding = New-Object -typename System.Text.UTF8Encoding # Set repository and image tags $repository = "your-docker-repo" # Change this to your Docker repository address # Check if Git repository exists $isGitRepo = Test-Path .git if ($isGitRepo) { # Get the current Git commit hash as the version tag $commitHash = git rev-parse --short HEAD if ($?) { Write-Host "Git commit hash: $commitHash" } else { Write-Host "Unable to get Git commit info, using timestamp as version tag" $commitHash = (Get-Date -Format "yyyyMMdd-HHmmss") } } else { Write-Host "Not a Git repository, using timestamp as version tag" $commitHash = (Get-Date -Format "yyyyMMdd-HHmmss") } # Define image names $frontendSchoolImage = "frontend-school" $frontendStudentImage = "frontend-student" $frontendTeacherImage = "frontend-teacher" $backendImage = "backend" $mysqlImage = "mysql:8.0" $redisImage = "redis:7.0" $neo4jImage = "neo4j:5.7" # Login to Docker repository (if needed) Write-Host "Logging into Docker repository..." docker login $repository # Build images Write-Host "Building images..." # Build Frontend - School docker build -t "$repository/$frontendSchoolImage:$commitHash" -f "frontend-school/Dockerfile" . # Build Frontend - Student docker build -t "$repository/$frontendStudentImage:$commitHash" -f "frontend-student/Dockerfile" . # Build Frontend - Teacher docker build -t "$repository/$frontendTeacherImage:$commitHash" -f "frontend-teacher/Dockerfile" . # Build Backend docker build -t "$repository/$backendImage:$commitHash" -f "backend/Dockerfile" . # Push images to remote repository Write-Host "Pushing images to remote repository..." docker push "$repository/$frontendSchoolImage:$commitHash" docker push "$repository/$frontendStudentImage:$commitHash" docker push "$repository/$frontendTeacherImage:$commitHash" docker push "$repository/$backendImage:$commitHash" # Push base images (e.g., MySQL, Redis, Neo4j) docker push $mysqlImage docker push $redisImage docker push $neo4jImage Write-Host "All images have been successfully pushed to the remote repository"