liuyuqi-dellpc 11 months ago
parent
commit
ee3ca958ff

+ 11 - 1
docs/README.md

@@ -9,7 +9,17 @@
 
 ## License
 
-
+Apache 2.0
 
 ## Reference
 
+github docs
+
+coding docs
+
+gogs docs
+
+gitlab docs
+
+azure pipeline docs
+

+ 6 - 5
docs/_sidebar.md

@@ -3,20 +3,20 @@
   * [前言](README.md)
 
 * IDE
-  
+
     * [Codespaces](ide/codespaces.md)
     * [Coding](ide/coding.md)
     * [Gitpod](ide/gitpod.md)
 
 * CI/CD
-  
+
     * [Azure pipeline](cicd/auzre_pipeline.md)
     * [Gitee](cicd/gitee.md)
     * [Github action](cicd/github_aciton.md)
     * [Gitlab ci](cicd/gitlab_ci.md)
 
 * 编程语言
-  
+
     * [Flutter 开发](dev/flutter.md)
     * [Go](dev/go.md)
     * [PHP](dev/php.md)
@@ -25,9 +25,10 @@
     * [Nodejs开发](dev/nodejs.md)
 
 * AI
-  
+
   * [Hugging Face 镜像](ai.md)
 
 * 其他
 
-  * [其他](others.md)
+  * [其他](others.md)
+

+ 93 - 0
docs/cicd/auzre_pipeline.md

@@ -1,5 +1,98 @@
 # Azure Pipeline
 
+Azure Pipelines 和 Github Action一样,支持各种语言,各种平台(windows,linux,mac),自动部署到各云平台,开源项目10个免费无线分钟数。
+
+
+
+## Usage
+
 项目添加 `.azure-pipelines/azure-pipelines.yml`,
 
+```
+trigger:
+- main
+
+variables:
+  # Azure Resource Manager connection created during pipeline creation
+  azureSubscription: 'subscription-id'
+  # Web app name
+  webAppName: 'web-app-name'
+  # Agent VM image name
+  vmImageName: 'ubuntu-latest'
+  # Environment name
+  environmentName: 'environment-name'
+  # Root folder under which your composer.json file is available.
+  rootFolder: $(System.DefaultWorkingDirectory)
+
+stages:
+- stage: Build
+  displayName: Build stage
+  variables:
+    phpVersion: '7.4'
+  jobs:
+  - job: BuildJob
+    pool:
+      vmImage: $(vmImageName)
+    steps:
+    - script: |
+        sudo update-alternatives --set php /usr/bin/php$(phpVersion)
+        sudo update-alternatives --set phar /usr/bin/phar$(phpVersion)
+        sudo update-alternatives --set phpdbg /usr/bin/phpdbg$(phpVersion)
+        sudo update-alternatives --set php-cgi /usr/bin/php-cgi$(phpVersion)
+        sudo update-alternatives --set phar.phar /usr/bin/phar.phar$(phpVersion)
+        php -version
+      workingDirectory: $(rootFolder)
+      displayName: 'Use PHP version $(phpVersion)'
+
+    - script: composer install --no-interaction --prefer-dist
+      workingDirectory: $(rootFolder)
+      displayName: 'Composer install'
+
+    - task: ArchiveFiles@2
+      displayName: 'Archive files'
+      inputs:
+        rootFolderOrFile: '$(rootFolder)'
+        includeRootFolder: false
+        archiveType: zip
+        archiveFile: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip
+        replaceExistingArchive: true
+
+    - upload: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip
+      displayName: 'Upload package'
+      artifact: drop
+
+- stage: Deploy
+  displayName: 'Deploy Web App'
+  dependsOn: Build
+  condition: succeeded()
+  jobs:
+  - deployment: DeploymentJob
+    pool:
+      vmImage: $(vmImageName)
+    environment: $(environmentName)
+    strategy:
+      runOnce:
+        deploy:
+          steps:
+          - task: AzureWebApp@1
+            displayName: 'Deploy Azure Web App'
+            inputs:
+              azureSubscription: $(azureSubscription)
+              appName: $(webAppName)
+              package: $(Pipeline.Workspace)/drop/$(Build.BuildId).zip
+```
+
+注意其中指定 php 版本,安装依赖,部署等
+
+
+
+## AppCenter
+
+
+
+## Reference
+
+[Azure Pipelines | Microsoft Azure](https://azure.microsoft.com/en-us/products/devops/pipelines)
+
+[Azure Pipelines documentation - Azure DevOps | Microsoft Learn](https://learn.microsoft.com/en-us/azure/devops/pipelines/?view=azure-devops)
 

+ 18 - 0
docs/cicd/cloud_build.md

@@ -0,0 +1,18 @@
+# Cloud Build
+
+Cloud Build 是 google 项目构建平台,每月2500分钟=41小时/月,2核,8G配置。
+
+
+
+## Usage
+
+
+
+
+
+
+
+## Reference
+
+[使用 Cloud Build 自动构建  |  Cloud Source Repositories 文档  |  Google Cloud](https://cloud.google.com/source-repositories/docs/integrating-with-cloud-build?hl=zh-cn)
+

+ 0 - 2
docs/cicd/gitee.md

@@ -1,2 +0,0 @@
-# gitee
-

+ 12 - 0
docs/cicd/gitlab_ci.md

@@ -2,3 +2,15 @@
 
 
 
+## 介绍
+
+
+
+## Usage
+
+
+
+
+
+
+

+ 2 - 0
docs/dev/dotnet.md

@@ -33,6 +33,8 @@
 传统 C++,C# 等桌面exe项目,使用:`msbuild.yml` 自动构建
 
 
+
+
 ## C/C++
 
 C/C++项目编译,

+ 1 - 1
docs/dev/flutter.md

@@ -155,7 +155,7 @@ docker push
 
 ## Jenkins
 
-通过docker快速启动一个 Jenkins 服务,配置好环境变量,插件,构建任务,即可实现自动化构建,部署,通知等功能。
+通过docker快速启动一个 Jenkins 服务,配置好环境,插件,构建任务,即可实现自动化构建,部署,通知等功能。
 
 ```
 docker run -d -p 8080:8080 -p 50000:50000 -v /var/jenkins_home:/var/jenkins_home jenkins/jenkins:lts

+ 7 - 0
docs/dev/others.md

@@ -1,5 +1,12 @@
 # Others
 
+
+
 ## Rust
 
+
+
 ## Ruby
+
+
+

+ 41 - 1
docs/dev/php.md

@@ -1,8 +1,48 @@
 # php 开发
 
-基于 docker,快速切换 php 版本开发环境,如,项目需要在 php7.4 环境下开发,可以使用以下方式:
+基于 docker ,快速切换 php 版本开发环境,如,项目需要在 php7.4 环境下开发,可以使用以下方式:
 
 ```bash
+
+chmod -R 777 .
+docker run --rm -it -v $(pwd):/var/www/html -p 9000:80 php:8.3.6-apache
+docker run --rm -it -v $(pwd):/var/www/html -p 9000:80 php:8.1.8-apache
+
+docker run --rm -it -v $(pwd):/var/www/html -p 9000:80 php:7.4.27-apache
+
+docker run --rm -it -v $(pwd):/var/www/html -p 9000:80 php:5.6.38-apache
+
+```
+
+开发环境需要 composer,启动下面容器即可:
+```bash
+#php8+xdebug+composer
+docker run --rm -it -v $(pwd):/var/www/html -p 8000:8000 sineverba/php8xc:1.18.0 /bin/bash
+
+```
+
+laravel 项目使用下面容器,可以添加 `docker-compose.yaml` 配置一并启动数据库:
+```
+# https://hub.docker.com/r/bitnami/laravel
+docker run --rm -it -v $(pwd):/app -p 8000:8000 bitnami/laravel:latest
+
+
+docker run -d --name laravel \
+  -p 8000:8000 \
+  --env DB_HOST=mariadb \
+  --env DB_PORT=3306 \
+  --env DB_USERNAME=bn_myapp \
+  --env DB_DATABASE=bitnami_myapp \
+  --network laravel-network \
+  --volume ${PWD}/my-project:/app \
+  bitnami/laravel:latest
+
+```
+
+php 命令行项目工具:
+```
+docker run --rm -it -v $(pwd):/var/www/html -v $(pwd)/Downloads:/root/Downloads/MusicDL/ -p 9000:80 php:8.1.8-apache /bin/bash
+
 docker run --rm -it -v /workspace:/app php:7.4 /bin/bash
 
 thinkphp new demo

+ 4 - 0
docs/ide/codespaces.md

@@ -33,5 +33,9 @@ Github 60小时/月免费开发环境,支持远程容器开发,Vscode。注
 
 
 
+## Usage
+
+
+
 
 

+ 7 - 1
docs/ide/gitpod.md

@@ -1,6 +1,6 @@
 # gitpod
 
-最早的远程开发平台,配置较高,50 小时/月免费,添加 `gitpod` 配置文件 `.gitpod.yml`,内容如下:
+Gitpod是最早的远程开发平台,配置较高,50 小时/月免费,很容易用完。添加配置文件 `.gitpod.yml` 和 `.gitpod.Dockerfile`,内容如下:
 
 ```yaml
 image:
@@ -16,3 +16,9 @@ tasks:
         command: npm run dev
 ```
 
+
+
+
+
+
+