Tree by Rust implement

2020年05月20日 · 0 分钟 · 0 字

Appveyor

Appveyor 也是一款线上 CICD 工具。 Support Contexts: Windows (Default) Ubuntu MacOS Support Languages: Node.js io.js Xamarin Python Ruby C++ Go Ruby 1version: 1.0.{build}-{branch} 2 3skip_commits: 4 files: 5 - "azure-pipelines.yml" 6 - "README.md" 7 8install: 9 - set PATH=C:\Ruby26-x64\bin;%PATH% 10 - bundle install 11 12build: off 13 14before_test: 15 - ruby -v 16 - gem -v 17 - bundle -v 18 19test_script: 20 - rails db:migrate RAILS_ENV=test Appveyor.yml Reference 1# Notes: 2# - Minimal appveyor.yml file is an empty file. All sections are optional. 3# - Indent each level of configuration with 2 spaces. Do not use tabs! 4# - All section names are case-sensitive. 5# - Section names should be unique on each level. 6 7#---------------------------------# 8# general configuration # 9#---------------------------------# 10 11# version format 12version: 1.0.{build} 13 14# you can use {branch} name in version format too 15# version: 1.0.{build}-{branch} 16 17# branches to build 18branches: 19 # whitelist 20 only: 21 - master 22 - production 23 24 # blacklist 25 except: 26 - gh-pages 27 28# Do not build on tags (GitHub, Bitbucket, GitLab, Gitea) 29skip_tags: true 30 31# Start builds on tags only (GitHub, BitBucket, GitLab, Gitea) 32skip_non_tags: true 33 34# Skipping commits with particular message or from specific user 35skip_commits: 36 message: /Created.*\.(png|jpg|jpeg|bmp|gif)/ # Regex for matching commit message 37 author: John # Commit author's username, name, email or regexp maching one of these. 38 39# Including commits with particular message or from specific user 40only_commits: 41 message: /build/ # Start a new build if message contains 'build' 42 author: jack@company.com # Start a new build for commit of user with email jack@company.com 43 44# Skipping commits affecting specific files (GitHub only). More details here: /docs/appveyor-yml 45#skip_commits: 46# files: 47# - docs/* 48# - '**/*.html' 49 50# Including commits affecting specific files (GitHub only). More details here: /docs/appveyor-yml 51#only_commits: 52# files: 53# - Project-A/ 54# - Project-B/ 55 56# Do not build feature branch with open Pull Requests 57skip_branch_with_pr: true 58 59# Maximum number of concurrent jobs for the project 60max_jobs: 1 61 62#---------------------------------# 63# environment configuration # 64#---------------------------------# 65 66# Build worker image (VM template) 67image: Visual Studio 2015 68 69# scripts that are called at very beginning, before repo cloning 70init: 71 - git config --global core.autocrlf input 72 73# clone directory 74clone_folder: c:\projects\myproject 75 76# fetch repository as zip archive 77shallow_clone: true # default is "false" 78 79# set clone depth 80clone_depth: 5 # clone entire repository history if not defined 81 82# setting up etc\hosts file 83hosts: 84 queue-server: 127.0.0.1 85 db.server.com: 127.0.0.2 86 87# environment variables 88environment: 89 my_var1: value1 90 my_var2: value2 91 # this is how to set encrypted variable. Go to "Settings" -> "Encrypt YAML" page in account menu to encrypt data. 92 my_secure_var1: 93 secure: FW3tJ3fMncxvs58/ifSP7w== 94 95# environment: 96# global: 97# connection_string: server=12;password=13; 98# service_url: https://127.0.0.1:8090 99# 100# matrix: 101# - db: mysql 102# provider: mysql 103# 104# - db: mssql 105# provider: mssql 106# password: 107# secure: $#(JFDA)jQ@#$ 108 109# this is how to allow failing jobs in the matrix 110matrix: 111 fast_finish: true # set this flag to immediately finish build once one of the jobs fails. 112 allow_failures: 113 - platform: x86 114 configuration: Debug 115 - platform: x64 116 configuration: Release 117 118 # exclude configuration from the matrix. Works similarly to 'allow_failures' but build not even being started for excluded combination. 119 exclude: 120 - platform: x86 121 configuration: Debug 122 123# build cache to preserve files/folders between builds 124cache: 125 - packages -> **\packages.config # preserve "packages" directory in the root of build folder but will reset it if packages.config is modified 126 - projectA\libs 127 - node_modules # local npm modules 128 - '%LocalAppData%\NuGet\Cache' # NuGet < v3 129 - '%LocalAppData%\NuGet\v3-cache' # NuGet v3 130 131# enable service required for build/tests 132services: 133 - mssql2014 # start SQL Server 2014 Express 134 - mssql2014rs # start SQL Server 2014 Express and Reporting Services 135 - mssql2012sp1 # start SQL Server 2012 SP1 Express 136 - mssql2012sp1rs # start SQL Server 2012 SP1 Express and Reporting Services 137 - mssql2008r2sp2 # start SQL Server 2008 R2 SP2 Express 138 - mssql2008r2sp2rs # start SQL Server 2008 R2 SP2 Express and Reporting Services 139 - mysql # start MySQL 5.6 service 140 - postgresql # start PostgreSQL 9.5 service 141 - iis # start IIS 142 - msmq # start Queuing services 143 - mongodb # start MongoDB 144 145# scripts that run after cloning repository 146install: 147 # by default, all script lines are interpreted as batch 148 - echo This is batch 149 # to run script as a PowerShell command prepend it with ps: 150 - ps: Write-Host 'This is PowerShell' 151 # batch commands start from cmd: 152 - cmd: echo This is batch again 153 - cmd: set MY_VAR=12345 154 155# enable patching of AssemblyInfo.* files 156assembly_info: 157 patch: true 158 file: AssemblyInfo.* 159 assembly_version: "2.2.{build}" 160 assembly_file_version: "{version}" 161 assembly_informational_version: "{version}" 162 163# Automatically register private account and/or project AppVeyor NuGet feeds. 164nuget: 165 account_feed: true 166 project_feed: true 167 disable_publish_on_pr: true # disable publishing of .nupkg artifacts to account/project feeds for pull request builds 168 publish_wap_octopus: true # disable publishing of Octopus Deploy .nupkg artifacts to account/project feeds 169 170#---------------------------------# 171# build configuration # 172#---------------------------------# 173 174# build platform, i.e. x86, x64, Any CPU. This setting is optional. 175platform: Any CPU 176 177# to add several platforms to build matrix: 178#platform: 179# - x86 180# - Any CPU 181 182# build Configuration, i.e. Debug, Release, etc. 183configuration: Release 184 185# to add several configurations to build matrix: 186#configuration: 187# - Debug 188# - Release 189 190# Build settings, not to be confused with "before_build" and "after_build". 191# "project" is relative to the original build directory and not influenced by directory changes in "before_build". 192build: 193 parallel: true # enable MSBuild parallel builds 194 project: MyTestAzureCS.sln # path to Visual Studio solution or project 195 publish_wap: true # package Web Application Projects (WAP) for Web Deploy 196 publish_wap_xcopy: true # package Web Application Projects (WAP) for XCopy deployment 197 publish_wap_beanstalk: true # Package Web Applications for AWS Elastic Beanstalk deployment 198 publish_wap_octopus: true # Package Web Applications for Octopus deployment 199 publish_azure_webjob: true # Package Azure WebJobs for Zip Push deployment 200 publish_azure: true # package Azure Cloud Service projects and push to artifacts 201 publish_aspnet_core: true # Package ASP.NET Core projects 202 publish_core_console: true # Package .NET Core console projects 203 publish_nuget: true # package projects with .nuspec files and push to artifacts 204 publish_nuget_symbols: true # generate and publish NuGet symbol packages 205 include_nuget_references: true # add -IncludeReferencedProjects option while packaging NuGet artifacts 206 207 # MSBuild verbosity level 208 verbosity: quiet|minimal|normal|detailed 209 210# scripts to run before build 211before_build: 212 213# to run your custom scripts instead of automatic MSBuild 214build_script: 215 216# scripts to run after build (working directory and environment changes are persisted from the previous steps) 217after_build: 218 219# scripts to run *after* solution is built and *before* automatic packaging occurs (web apps, NuGet packages, Azure Cloud Services) 220before_package: 221 222# to disable automatic builds 223#build: off 224 225#---------------------------------# 226# tests configuration # 227#---------------------------------# 228 229# to run tests against only selected assemblies and/or categories 230test: 231 assemblies: 232 only: 233 - asm1.dll 234 - asm2.dll 235 236 categories: 237 only: 238 - UI 239 - E2E 240 241# to run tests against all except selected assemblies and/or categories 242#test: 243# assemblies: 244# except: 245# - asm1.dll 246# - asm2.dll 247# 248# categories: 249# except: 250# - UI 251# - E2E 252 253# to run tests from different categories as separate jobs in parallel 254#test: 255# categories: 256# - A # A category common for all jobs 257# - [UI] # 1st job 258# - [DAL, BL] # 2nd job 259 260# scripts to run before tests (working directory and environment changes are persisted from the previous steps such as "before_build") 261before_test: 262 - echo script1 263 - ps: Write-Host "script1" 264 265# to run your custom scripts instead of automatic tests 266test_script: 267 - echo This is my custom test script 268 269# scripts to run after tests 270after_test: 271 272# to disable automatic tests 273#test: off 274 275#---------------------------------# 276# artifacts configuration # 277#---------------------------------# 278 279artifacts: 280 # pushing a single file 281 - path: test.zip 282 283 # pushing a single file with environment variable in path and "Deployment name" specified 284 - path: MyProject\bin\$(configuration) 285 name: myapp 286 287 # pushing entire folder as a zip archive 288 - path: logs 289 290 # pushing all *.nupkg files in build directory recursively 291 - path: '**\*.nupkg' 292 293#---------------------------------# 294# deployment configuration # 295#---------------------------------# 296 297# providers: Local, FTP, WebDeploy, AzureCS, AzureBlob, S3, NuGet, Environment 298# provider names are case-sensitive! 299deploy: 300 # FTP deployment provider settings 301 - provider: FTP 302 protocol: ftp|ftps|sftp 303 host: ftp.myserver.com 304 username: admin 305 password: 306 secure: eYKZKFkkEvFYWX6NfjZIVw== 307 folder: 308 application: 309 active_mode: false 310 beta: true # enable alternative FTP library for 'ftp' and 'ftps' modes 311 debug: true # show complete FTP log 312 313 # Amazon S3 deployment provider settings 314 - provider: S3 315 access_key_id: 316 secure: ABcd== 317 secret_access_key: 318 secure: ABcd== 319 bucket: my_bucket 320 folder: 321 artifact: 322 set_public: false 323 324 # Azure Blob storage deployment provider settings 325 - provider: AzureBlob 326 storage_account_name: 327 secure: ABcd== 328 storage_access_key: 329 secure: ABcd== 330 container: my_container 331 folder: 332 artifact: 333 334 # Web Deploy deployment provider settings 335 - provider: WebDeploy 336 server: http://www.deploy.com/myendpoint 337 website: mywebsite 338 username: user 339 password: 340 secure: eYKZKFkkEvFYWX6NfjZIVw== 341 ntlm: false 342 remove_files: false 343 app_offline: false 344 do_not_use_checksum: true # do not use check sum for comparing source and destination files. By default checksums are used. 345 sync_retry_attempts: 2 # sync attempts, max 346 sync_retry_interval: 2000 # timeout between sync attempts, milliseconds 347 aspnet_core: true # artifact zip contains ASP.NET Core application 348 aspnet_core_force_restart: true # poke app's web.config before deploy to force application restart 349 skip_dirs: \\App_Data 350 skip_files: web.config 351 on: 352 branch: release 353 platform: x86 354 configuration: debug 355 356 # Deploying to Azure Cloud Service 357 - provider: AzureCS 358 subscription_id: 359 secure: fjZIVw== 360 subscription_certificate: 361 secure: eYKZKFkkEv...FYWX6NfjZIVw== 362 storage_account_name: my_storage 363 storage_access_key: 364 secure: ABcd== 365 service: my_service 366 slot: Production 367 target_profile: Cloud 368 artifact: MyPackage.cspkg 369 370 # Deploying to NuGet feed 371 - provider: NuGet 372 server: https://my.nuget.server/feed 373 api_key: 374 secure: FYWX6NfjZIVw== 375 skip_symbols: false 376 symbol_server: https://your.symbol.server/feed 377 artifact: MyPackage.nupkg 378 379 # Deploy to GitHub Releases 380 - provider: GitHub 381 artifact: /.*\.nupkg/ # upload all NuGet packages to release assets 382 draft: false 383 prerelease: false 384 on: 385 branch: master # release from master branch only 386 APPVEYOR_REPO_TAG: true # deploy on tag push only 387 388 # Deploying to a named environment 389 - provider: Environment 390 name: staging 391 on: 392 branch: staging 393 env_var1: value1 394 env_var2: value2 395 396# scripts to run before deployment 397before_deploy: 398 399# scripts to run after deployment 400after_deploy: 401 402# to run your custom scripts instead of provider deployments 403deploy_script: 404 405# to disable deployment 406#deploy: off 407 408#---------------------------------# 409# global handlers # 410#---------------------------------# 411 412# on successful build 413on_success: 414 - do something 415 416# on build failure 417on_failure: 418 - do something 419 420# after build failure or success 421on_finish: 422 - do something 423 424#---------------------------------# 425# notifications # 426#---------------------------------# 427 428notifications: 429 # Email 430 - provider: Email 431 to: 432 - user1@email.com 433 - user2@email.com 434 subject: "Build {{status}}" # optional 435 message: "{{message}}, {{commitId}}, ..." # optional 436 on_build_status_changed: true 437 438 # HipChat 439 - provider: HipChat 440 auth_token: 441 secure: RbOnSMSFKYzxzFRrxM1+XA== 442 room: ProjectA 443 template: "{message}, {commitId}, ..." 444 445 # Slack 446 - provider: Slack 447 incoming_webhook: http://incoming-webhook-url 448 449 # ...or using auth token 450 451 - provider: Slack 452 auth_token: 453 secure: kBl9BlxvRMr9liHmnBs14A== 454 channel: development 455 template: "{message}, {commitId}, ..." 456 457 # Campfire 458 - provider: Campfire 459 account: appveyor 460 auth_token: 461 secure: RifLRG8Vfyol+sNhj9u2JA== 462 room: ProjectA 463 template: "{message}, {commitId}, ..." 464 465 # Webhook 466 - provider: Webhook 467 url: http://www.myhook2.com 468 headers: 469 User-Agent: myapp 1.0 470 Authorization: 471 secure: GhD+5xhLz/tkYY6AO3fcfQ== 472 on_build_success: false 473 on_build_failure: true 474 on_build_status_changed: true

2020年04月06日 · 5 分钟 · 2066 字

Azure Pipelines

Azure Pipelines是一种云服务,可用于自动构建和测试您的代码项目并将其提供给其他用户。它几乎适用于任何语言或项目类型。 Azure Pipelines将持续集成(CI)和持续交付(CD)相结合,以持续不断地测试和构建您的代码并将其交付给任何目标。 ...

2020年04月06日 · 2 分钟 · 536 字

Rails Development

Webpacker Rails 6 版本开始依赖 Webpacker,在运行之前必须先安装 Webpacker 这玩意。 1rails webpacker:install 如果需要安装前端框架,请使用 yarn 来安装,这样部署的时候能享受到 webpacker 打包便利。 production Rails 6 启动时需要一串 Key 作为加密的 salt,key 不能随意生成。 生成 key 时,请删除 config 下的 credentials.enc.yml 和 master.key 文件。 然后运行 ...

2020年04月06日 · 1 分钟 · 236 字

The Framework a good design?

我第一次听到框架这个概念已经是在大学的时候了,当时我的老师和我提起。 一开始我非常不习惯在我不熟悉的上下文中编写程序的感觉。只能用四个字来形容寸步难行。 过了一段时间后,当你熟悉里这个框架提前为你所做的一切的时候,一切只能用四个字来形容素巴拉细(美妙)。 ...

2020年04月06日 · 2 分钟 · 545 字

领域逻辑的组织模式

目前领域逻辑的组织模式分为三种,“事务脚本”,“领域模型” 以及 “表模块”。 事务脚本类似于面向过程编程,事务脚本有以下优点: 它是一种大多数软件工程师都能理解的简单过程模型。 它能和一个行数据入口或表数据入口简单的数据源很好的协作。 非常容易设定事务的边界。 一个组数据源操作便是一个独立的事务脚本。 当然事务脚本也存在很大的缺陷,当领域逻辑开始变得复杂时,这些缺点就开始暴露出来。 当几个事务要执行类似的逻辑时,通常几个脚本中会含有某些相同的代码。 通过将这些代码提取出来,来形成公共的子例程,来消除这种情况。 但是,很多时候消除副本会变得棘手,而检测副本则更困难,倒是消除副本后的程序反而比以前还要杂乱无章,难以维护。 ...

2020年04月03日 · 2 分钟 · 988 字

只需要服务中心

目前,市面上以及出现了各种各样的适用于微服务(下面简称ms)的注册中心,配合其使用的还有各种ms框架,例如Alibaba的Dubbo。 微服务能通过分解服务粒度,然后针对特定服务进行性能扩展,来达到高性能的目的。 ...

2020年04月02日 · 1 分钟 · 496 字

Kratos 初始化流程源码解析

Kratos 是bilibili开源的一套Go微服务框架,包含大量微服务相关框架及工具。 名字来源于:《战神》游戏以希腊神话为背景,讲述由凡人成为战神的奎托斯(Kratos)成为战神并展开弑神屠杀的冒险历程。 好!开始吧! ...

2020年03月31日 · 7 分钟 · 3430 字

Protobuf 原理

protobuf 的 message 中有很多字段,每个字段的格式为: 修饰符 字段类型 字段名 = 域号; 在序列化时,protobuf 按照 TLV 的格式序列化每一个字段,T 即 Tag,也叫 Key;V 是该字段对应的值 v 省略。 序列化后的 Value 是按原样保存到字符串或者文件中,Key 按照一定的转换条件保存起来,序列化后的 message 中字段后面的域号与字段类型来转换。转换公式如下: ...

2020年03月30日 · 3 分钟 · 1439 字 · sdttttt

Protubuf 原理

protobuf 的 message 中有很多字段,每个字段的格式为: 修饰符 字段类型 字段名 = 域号; 在序列化时,protobuf 按照 TLV 的格式序列化每一个字段,T 即 Tag,也叫 Key;V 是该字段对应的值 v 省略。 序列化后的 Value 是按原样保存到字符串或者文件中,Key 按照一定的转换条件保存起来,序列化后的 message 中字段后面的域号与字段类型来转换。转换公式如下: ...

2020年03月30日 · 3 分钟 · 1405 字