├── .dockerignore
├── .github
├── ISSUE_TEMPLATE
│ ├── bug_report.md
│ ├── enhancement.md
│ ├── feature_request.md
│ ├── installation_bug_report.yml
│ └── question.md
├── labeler.yml
├── pull_request_template.md
└── workflows
│ └── labeler.yml
├── .gitignore
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING-zh-CN.md
├── CONTRIBUTING.md
├── GOVERNANCE.md
├── LICENSE
├── Makefile
├── README-zh-CN.md
├── README.md
├── System-Architecture-Overview-zh-CN.md
├── System-Architecture-Overview.md
├── Zadig-Business-Architecture-zh.jpg
├── Zadig-Business-Architecture.jpg
├── Zadig-System-Architecture.png
├── action.yml
├── cmd
├── aslan
│ └── main.go
├── cron
│ └── main.go
├── hub-agent
│ └── main.go
├── hub-server
│ └── main.go
├── init
│ └── main.go
├── jenkins-plugin
│ └── main.go
├── jobexecutor
│ └── main.go
├── packager-plugin
│ └── main.go
├── predator-plugin
│ └── main.go
├── reaper
│ └── main.go
├── ua
│ └── main.go
├── user
│ └── main.go
├── zadig-agent
│ └── main.go
└── zgctl
│ ├── cmd
│ ├── root.go
│ └── serve.go
│ └── main.go
├── community
├── dev
│ └── contributor-workflow.md
└── rfc
│ └── yyyy-MM-dd-my-design-template.md
├── debug
├── aslan-debug.yaml
├── build.sh
├── debug.sh
├── golang-debug.Dockerfile
└── run.sh
├── docker
├── aslan.Dockerfile
├── bionic-base.Dockerfile
├── cron.Dockerfile
├── executor.Dockerfile
├── focal-base.Dockerfile
├── hub-agent.Dockerfile
├── hub-server.Dockerfile
├── init.Dockerfile
├── jenkins-plugin.Dockerfile
├── packager-plugin.Dockerfile
├── predator-plugin.Dockerfile
├── resource-server.Dockerfile
├── ua.Dockerfile
├── user.Dockerfile
├── warpdrive.Dockerfile
├── xenial-base.Dockerfile
├── zadig-debug.Dockerfile
└── zgctl-sidecar.Dockerfile
├── examples
├── git-hook-demo
│ └── pre-commit
├── git-zadig-demo
│ └── default.xml
├── grayscale-demo
│ ├── LICENSE
│ ├── Makefile
│ ├── chart
│ │ ├── a
│ │ │ ├── .helmignore
│ │ │ ├── Chart.yaml
│ │ │ ├── templates
│ │ │ │ ├── deployment.yaml
│ │ │ │ └── service.yaml
│ │ │ └── values.yaml
│ │ ├── b
│ │ │ ├── .helmignore
│ │ │ ├── Chart.yaml
│ │ │ ├── templates
│ │ │ │ ├── deployment.yaml
│ │ │ │ └── service.yaml
│ │ │ └── values.yaml
│ │ └── c
│ │ │ ├── .helmignore
│ │ │ ├── Chart.yaml
│ │ │ ├── templates
│ │ │ ├── deployment.yaml
│ │ │ └── service.yaml
│ │ │ └── values.yaml
│ ├── cmd
│ │ ├── myapp-1
│ │ │ ├── Dockerfile
│ │ │ ├── app
│ │ │ │ ├── options.go
│ │ │ │ └── server.go
│ │ │ └── main.go
│ │ ├── myapp-2
│ │ │ ├── Dockerfile
│ │ │ ├── app
│ │ │ │ ├── options.go
│ │ │ │ └── server.go
│ │ │ └── main.go
│ │ └── myapp-3
│ │ │ ├── Dockerfile
│ │ │ ├── app
│ │ │ ├── options.go
│ │ │ └── server.go
│ │ │ └── main.go
│ ├── go.mod
│ ├── go.sum
│ ├── pkg
│ │ ├── protos
│ │ │ ├── myapp.pb.go
│ │ │ ├── myapp.proto
│ │ │ └── myapp_grpc.pb.go
│ │ └── version
│ │ │ └── version.go
│ └── yaml
│ │ ├── a.yaml
│ │ ├── b.yaml
│ │ └── c.yaml
├── jMeter-demo
│ └── demo.jmx
├── java-tomcat-demo
│ ├── Procfile
│ ├── README.md
│ ├── pom.xml
│ └── src
│ │ └── main
│ │ ├── java
│ │ ├── launch
│ │ │ └── Main.java
│ │ └── servlet
│ │ │ └── HelloServlet.java
│ │ └── webapp
│ │ └── index.jsp
├── microservice-demo
│ ├── README.md
│ ├── backend
│ │ ├── Dockerfile
│ │ ├── Makefile
│ │ ├── backend.go
│ │ └── go.mod
│ ├── chart
│ │ ├── .helmignore
│ │ ├── Chart.yaml
│ │ ├── templates
│ │ │ ├── _helpers.tpl
│ │ │ ├── backend.yaml
│ │ │ ├── frontend.yaml
│ │ │ ├── job.yaml
│ │ │ └── secret.yaml
│ │ └── values.yaml
│ ├── database-change
│ │ ├── flyway-conf
│ │ │ ├── flyway-dev.conf
│ │ │ ├── flyway-prod.conf
│ │ │ └── flyway-qa.conf
│ │ ├── liquibase-conf
│ │ │ ├── dev
│ │ │ │ ├── example-changelog.sql
│ │ │ │ └── liquibase.properties
│ │ │ ├── prod
│ │ │ │ ├── example-changelog.sql
│ │ │ │ └── liquibase.properties
│ │ │ └── qa
│ │ │ │ ├── example-changelog.sql
│ │ │ │ └── liquibase.properties
│ │ └── sql
│ │ │ ├── V1__Create_person_table.sql
│ │ │ ├── V2__Add_people.sql
│ │ │ ├── V3__Create_student_table.sql
│ │ │ └── put-your-sql-migrations-here.txt
│ ├── frontend
│ │ ├── .babelrc
│ │ ├── .editorconfig
│ │ ├── .gitignore
│ │ ├── .postcssrc.js
│ │ ├── Dockerfile
│ │ ├── Makefile
│ │ ├── README.md
│ │ ├── build
│ │ │ ├── build.js
│ │ │ ├── check-versions.js
│ │ │ ├── logo.png
│ │ │ ├── utils.js
│ │ │ ├── vue-loader.conf.js
│ │ │ ├── webpack.base.conf.js
│ │ │ ├── webpack.dev.conf.js
│ │ │ └── webpack.prod.conf.js
│ │ ├── config
│ │ │ ├── dev.env.js
│ │ │ ├── index.js
│ │ │ └── prod.env.js
│ │ ├── index.html
│ │ ├── nginx.conf
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── App.vue
│ │ │ ├── assets
│ │ │ │ └── logo.png
│ │ │ ├── components
│ │ │ │ ├── HelloWorld.vue
│ │ │ │ └── HelloWorld_rc.vue
│ │ │ ├── main.js
│ │ │ └── router
│ │ │ │ └── index.js
│ │ ├── static
│ │ │ └── .gitkeep
│ │ ├── vm
│ │ │ ├── Dockerfile
│ │ │ └── nginx.conf
│ │ └── yarn.lock
│ ├── k8s-yaml
│ │ ├── backend
│ │ │ ├── deployment.yaml
│ │ │ └── service.yaml
│ │ └── frontend
│ │ │ ├── deployment.yaml
│ │ │ ├── ingress.yaml
│ │ │ └── service.yaml
│ └── vm
│ │ ├── ansible
│ │ ├── ansible.Dockerfile
│ │ ├── hosts-dev
│ │ ├── hosts-qa
│ │ └── main.yaml
│ │ ├── backend_service.sh
│ │ ├── expect_scp
│ │ └── restart.sh
├── mse-demo
│ ├── nacos
│ │ └── nacos.yaml
│ ├── spring-a
│ │ └── spring-a.yaml
│ ├── spring-b
│ │ └── spring-b.yaml
│ └── spring-c
│ │ └── spring-c.yaml
├── multi-service-demo
│ ├── Dockerfile
│ ├── Makefile
│ ├── README.md
│ ├── base-chart
│ │ ├── Chart.yaml
│ │ ├── templates
│ │ │ ├── _helpers.tpl
│ │ │ ├── deployment.yaml
│ │ │ └── service.yaml
│ │ └── values.yaml
│ ├── full-charts
│ │ ├── service1
│ │ │ ├── Chart.yaml
│ │ │ ├── templates
│ │ │ │ ├── _helpers.tpl
│ │ │ │ ├── deployment.yaml
│ │ │ │ └── service.yaml
│ │ │ └── values.yaml
│ │ ├── service2
│ │ │ ├── Chart.yaml
│ │ │ ├── templates
│ │ │ │ ├── _helpers.tpl
│ │ │ │ ├── deployment.yaml
│ │ │ │ └── service.yaml
│ │ │ └── values.yaml
│ │ └── service3
│ │ │ ├── Chart.yaml
│ │ │ ├── templates
│ │ │ ├── _helpers.tpl
│ │ │ ├── deployment.yaml
│ │ │ └── service.yaml
│ │ │ └── values.yaml
│ ├── general-chart
│ │ ├── Chart.yaml
│ │ ├── templates
│ │ │ ├── _helpers.tpl
│ │ │ ├── deployment.yaml
│ │ │ └── service.yaml
│ │ └── values.yaml
│ ├── go.mod
│ ├── k8s-yaml
│ │ ├── service1
│ │ │ ├── deployment.yaml
│ │ │ └── service.yaml
│ │ ├── service2
│ │ │ ├── deployment.yaml
│ │ │ └── service.yaml
│ │ ├── service3
│ │ │ ├── deployment.yaml
│ │ │ └── service.yaml
│ │ └── template.yaml
│ ├── src
│ │ ├── service1
│ │ │ └── service1.go
│ │ ├── service2
│ │ │ └── service2.go
│ │ └── service3
│ │ │ └── service3.go
│ └── values
│ │ ├── service1.yaml
│ │ ├── service2.yaml
│ │ └── service3.yaml
├── nginx
│ ├── Dockerfile
│ ├── README.md
│ ├── index.html
│ └── yaml
│ │ ├── .gitkeep
│ │ ├── nginx.yaml
│ │ └── redis
│ │ ├── .gitkeep
│ │ └── redis.yaml
├── pytest-demo
│ ├── fail_test.py
│ └── pass_test.py
├── simple-service
│ ├── nginx-yaml
│ │ └── nginx.yaml
│ └── service-yaml
│ │ ├── a.yaml
│ │ ├── b.yaml
│ │ └── c.yaml
├── sonarqube-scanner-gradle
│ ├── README.md
│ ├── build.gradle
│ ├── gradle.properties
│ ├── gradle
│ │ └── wrapper
│ │ │ ├── gradle-wrapper.jar
│ │ │ └── gradle-wrapper.properties
│ ├── gradlew
│ ├── gradlew.bat
│ ├── settings.gradle
│ └── src
│ │ ├── main
│ │ └── java
│ │ │ └── com
│ │ │ └── acme
│ │ │ └── App.java
│ │ └── test
│ │ └── java
│ │ └── com
│ │ └── acme
│ │ └── AppTest.java
├── spring-boot-acme-financial
│ ├── acme-financial-account.yaml
│ ├── acme-financial-customer.yaml
│ ├── acme-financial-office.yaml
│ └── acme-financial-ui.yaml
├── spring-boot-demo
│ ├── Dockerfile
│ ├── pom.xml
│ ├── spring-boot-swagger.iml
│ └── src
│ │ ├── main
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── neo
│ │ │ │ ├── SwaggerApplication.java
│ │ │ │ ├── config
│ │ │ │ ├── BaseResult.java
│ │ │ │ └── SwaggerConfig.java
│ │ │ │ ├── controller
│ │ │ │ ├── MessageController.java
│ │ │ │ └── UserController.java
│ │ │ │ ├── model
│ │ │ │ ├── Message.java
│ │ │ │ └── User.java
│ │ │ │ └── repository
│ │ │ │ ├── InMemoryMessageRepository.java
│ │ │ │ └── MessageRepository.java
│ │ └── resources
│ │ │ ├── application.properties
│ │ │ └── logback.xml
│ │ └── test
│ │ └── java
│ │ └── com
│ │ └── neo
│ │ ├── SwaggerApplicationTests.java
│ │ └── web
│ │ └── MessageControllerTest.java
├── spring-cloud-grayscale-with-eureka
│ ├── eureka-server
│ │ ├── Dockerfile
│ │ ├── deploy
│ │ │ ├── deployment.yaml
│ │ │ ├── ingress.yaml
│ │ │ └── service.yaml
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ ├── java
│ │ │ └── org
│ │ │ │ └── example
│ │ │ │ └── EurekaServerApplication.java
│ │ │ └── resources
│ │ │ └── application.properties
│ ├── gateway
│ │ ├── Dockerfile
│ │ ├── deploy
│ │ │ ├── deployment.yaml
│ │ │ ├── ingress.yaml
│ │ │ └── service.yaml
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ ├── java
│ │ │ └── org
│ │ │ │ └── example
│ │ │ │ └── GatewayApplication.java
│ │ │ └── resources
│ │ │ └── application.yml
│ ├── pom.xml
│ ├── service1
│ │ ├── Dockerfile
│ │ ├── deploy
│ │ │ ├── grayscale
│ │ │ │ ├── deployment.yaml
│ │ │ │ └── service.yaml
│ │ │ └── production
│ │ │ │ ├── deployment.yaml
│ │ │ │ └── service.yaml
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ ├── java
│ │ │ └── org
│ │ │ │ └── example
│ │ │ │ ├── GreetingController.java
│ │ │ │ └── Service1Application.java
│ │ │ └── resources
│ │ │ └── application.properties
│ ├── service2
│ │ ├── Dockerfile
│ │ ├── deploy
│ │ │ ├── grayscale
│ │ │ │ ├── deployment.yaml
│ │ │ │ └── service.yaml
│ │ │ └── production
│ │ │ │ ├── deployment.yaml
│ │ │ │ └── service.yaml
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ ├── java
│ │ │ └── org
│ │ │ │ └── example
│ │ │ │ ├── GreetingClient.java
│ │ │ │ ├── GreetingController.java
│ │ │ │ └── Service2Application.java
│ │ │ └── resources
│ │ │ └── application.properties
│ └── service3
│ │ ├── Dockerfile
│ │ ├── deploy
│ │ ├── grayscale
│ │ │ ├── deployment.yaml
│ │ │ └── service.yaml
│ │ └── production
│ │ │ ├── deployment.yaml
│ │ │ └── service.yaml
│ │ ├── pom.xml
│ │ └── src
│ │ └── main
│ │ ├── java
│ │ └── org
│ │ │ └── example
│ │ │ ├── GreetingClient.java
│ │ │ ├── GreetingController.java
│ │ │ └── Service3Application.java
│ │ └── resources
│ │ └── application.properties
├── spring-cloud-piggymetrics
│ ├── account-mongodb-service
│ │ └── 7-account-mongodb-service.yaml
│ ├── account-service
│ │ └── 8-account-service.yaml
│ ├── auth-mongodb-service
│ │ └── 5-auth-mongodb-service.yaml
│ ├── auth-service
│ │ └── 6-auth-service.yaml
│ ├── config-service
│ │ └── 2-config-service.yaml
│ ├── gateway-service
│ │ └── 4-gateway-service.yaml
│ ├── monitoring-service
│ │ └── 13-monitoring-service.yaml
│ ├── notification-mongodb-service
│ │ └── 11-notification-mongodb-service.yaml
│ ├── notification-service
│ │ └── 12-notification-service.yaml
│ ├── rabbitmq-service
│ │ └── 1-rabbitmq-service.yaml
│ ├── registry-service
│ │ └── 3-registry-service.yaml
│ ├── statistics-mongodb-service
│ │ └── 9-statistics-mongodb-service.yaml
│ ├── statistics-services
│ │ └── 10-statistics-service.yaml
│ └── turbine-stream-service
│ │ └── 14-turbine-stream-service.yaml
├── test-demo
│ ├── go.mod
│ ├── go.sum
│ ├── test-multi-envs
│ │ └── multi_env_test.go
│ └── test
│ │ └── demo_test.go
├── version-demo
│ ├── Makefile
│ ├── README.md
│ ├── go.mod
│ ├── main.go
│ └── utils
│ │ └── version.go
├── voting-app
│ ├── .gitignore
│ ├── Dockerfile
│ ├── ExampleVotingApp.sln
│ ├── architecture.png
│ ├── chart
│ │ ├── Chart.yaml
│ │ ├── templates
│ │ │ ├── db.yaml
│ │ │ ├── redis.yaml
│ │ │ ├── result.yaml
│ │ │ ├── vote.yaml
│ │ │ └── worker.yaml
│ │ └── values.yaml
│ ├── freestyle-k8s-specifications
│ │ ├── db
│ │ │ ├── db-deployment.yaml
│ │ │ └── db-service.yaml
│ │ ├── redis
│ │ │ ├── redis-deployment.yaml
│ │ │ └── redis-service.yaml
│ │ ├── result
│ │ │ ├── result-deployment.yaml
│ │ │ └── result-service.yaml
│ │ ├── vote
│ │ │ ├── vote-deployment.yaml
│ │ │ └── vote-service.yaml
│ │ └── worker
│ │ │ └── worker-deployment.yaml
│ ├── function-test
│ │ ├── .gitkeep
│ │ ├── fail
│ │ │ ├── .gitkeep
│ │ │ ├── result_1.xml
│ │ │ ├── result_2.xml
│ │ │ └── result_fail.xml
│ │ ├── pass
│ │ │ ├── .gitkeep
│ │ │ ├── result_1.xml
│ │ │ └── result_2.xml
│ │ └── pass2
│ │ │ ├── .gitkeep
│ │ │ ├── error2total4.xml
│ │ │ ├── fail2total4.xml
│ │ │ └── skip2total8.xml
│ ├── result
│ │ ├── .dockerignore
│ │ ├── Dockerfile
│ │ ├── docker-compose.test.yml
│ │ ├── dotnet
│ │ │ ├── Dockerfile
│ │ │ ├── Dockerfile.1809
│ │ │ └── Result
│ │ │ │ ├── Data
│ │ │ │ ├── IResultData.cs
│ │ │ │ └── MySqlResultData.cs
│ │ │ │ ├── Hubs
│ │ │ │ └── ResultsHub.cs
│ │ │ │ ├── Models
│ │ │ │ └── ResultsModel.cs
│ │ │ │ ├── Pages
│ │ │ │ ├── Index.cshtml
│ │ │ │ └── Index.cshtml.cs
│ │ │ │ ├── Program.cs
│ │ │ │ ├── Properties
│ │ │ │ └── launchSettings.json
│ │ │ │ ├── Result.csproj
│ │ │ │ ├── Startup.cs
│ │ │ │ ├── Timers
│ │ │ │ └── PublishResultsTimer.cs
│ │ │ │ ├── appsettings.Development.json
│ │ │ │ ├── appsettings.json
│ │ │ │ ├── libman.json
│ │ │ │ └── wwwroot
│ │ │ │ ├── css
│ │ │ │ ├── site.css
│ │ │ │ └── site.min.css
│ │ │ │ └── js
│ │ │ │ └── results.js
│ │ ├── package-lock.json
│ │ ├── package.json
│ │ ├── server.js
│ │ ├── tests
│ │ │ ├── Dockerfile
│ │ │ ├── render.js
│ │ │ └── tests.sh
│ │ └── views
│ │ │ ├── angular.min.js
│ │ │ ├── app.js
│ │ │ ├── index.html
│ │ │ ├── socket.io.js
│ │ │ └── stylesheets
│ │ │ └── style.css
│ ├── vote
│ │ ├── Dockerfile
│ │ ├── app.py
│ │ ├── dotnet
│ │ │ ├── Dockerfile
│ │ │ ├── Dockerfile.1809
│ │ │ └── Vote
│ │ │ │ ├── Messaging
│ │ │ │ ├── IMessageQueue.cs
│ │ │ │ ├── MessageHelper.cs
│ │ │ │ ├── MessageQueue.cs
│ │ │ │ └── Messages
│ │ │ │ │ ├── Events
│ │ │ │ │ └── VoteCastEvent.cs
│ │ │ │ │ └── Message.cs
│ │ │ │ ├── Pages
│ │ │ │ ├── Index.cshtml
│ │ │ │ └── Index.cshtml.cs
│ │ │ │ ├── Program.cs
│ │ │ │ ├── Properties
│ │ │ │ └── launchSettings.json
│ │ │ │ ├── Startup.cs
│ │ │ │ ├── Vote.csproj
│ │ │ │ ├── Vote.sln
│ │ │ │ ├── appsettings.Development.json
│ │ │ │ ├── appsettings.json
│ │ │ │ └── wwwroot
│ │ │ │ ├── css
│ │ │ │ ├── site.css
│ │ │ │ └── site.min.css
│ │ │ │ └── js
│ │ │ │ └── jquery-1.11.1-min.js
│ │ ├── requirements.txt
│ │ ├── static
│ │ │ └── stylesheets
│ │ │ │ └── style.css
│ │ ├── templates
│ │ │ └── index.html
│ │ └── test_app.py
│ └── worker
│ │ ├── .classpath
│ │ ├── .gitignore
│ │ ├── .project
│ │ ├── .settings
│ │ ├── org.eclipse.jdt.apt.core.prefs
│ │ ├── org.eclipse.jdt.core.prefs
│ │ └── org.eclipse.m2e.core.prefs
│ │ ├── Dockerfile
│ │ ├── Dockerfile.j
│ │ ├── dotnet
│ │ ├── Dockerfile
│ │ ├── Dockerfile.1809
│ │ └── Worker
│ │ │ ├── Data
│ │ │ ├── IVoteData.cs
│ │ │ └── MySqlVoteData.cs
│ │ │ ├── Entities
│ │ │ ├── Vote.cs
│ │ │ └── VoteContext.cs
│ │ │ ├── Messaging
│ │ │ ├── IMessageQueue.cs
│ │ │ ├── MessageHelper.cs
│ │ │ ├── MessageQueue.cs
│ │ │ └── Messages
│ │ │ │ ├── Events
│ │ │ │ └── VoteCastEvent.cs
│ │ │ │ └── Message.cs
│ │ │ ├── Program.cs
│ │ │ ├── Worker.csproj
│ │ │ ├── Workers
│ │ │ └── QueueWorker.cs
│ │ │ └── appsettings.json
│ │ ├── pom.xml
│ │ ├── settings.xml
│ │ └── src
│ │ ├── Worker
│ │ ├── Program.cs
│ │ └── Worker.csproj
│ │ └── main
│ │ └── java
│ │ └── worker
│ │ └── Worker.java
├── webhook
│ └── trigger_example.yaml
└── website
│ ├── Dockerfile
│ ├── index.html
│ ├── nginx.conf
│ └── yaml
│ └── website-example.yaml
├── go.mod
├── go.sum
├── hack
├── boilerplate.go.txt
└── update-copyright.sh
├── pkg
├── cli
│ ├── initconfig
│ │ └── cmd
│ │ │ ├── healthz.go
│ │ │ ├── init.go
│ │ │ └── root.go
│ ├── upgradeassistant
│ │ ├── cmd
│ │ │ ├── migrate.go
│ │ │ ├── migrate
│ │ │ │ ├── 200.go
│ │ │ │ ├── 210.go
│ │ │ │ ├── 220.go
│ │ │ │ ├── 230.go
│ │ │ │ ├── 310.go
│ │ │ │ ├── 320.go
│ │ │ │ ├── 321.go
│ │ │ │ ├── 330.go
│ │ │ │ ├── 340.go
│ │ │ │ └── utils.go
│ │ │ └── root.go
│ │ ├── executor
│ │ │ └── executor.go
│ │ └── internal
│ │ │ ├── repository
│ │ │ ├── models
│ │ │ │ ├── basic_images.go
│ │ │ │ ├── build.go
│ │ │ │ ├── cluster.go
│ │ │ │ ├── codehost.go
│ │ │ │ ├── emailhost.go
│ │ │ │ ├── env_configs.go
│ │ │ │ ├── jenkins.go
│ │ │ │ ├── migration.go
│ │ │ │ ├── oldpolicy.go
│ │ │ │ ├── organization.go
│ │ │ │ ├── product.go
│ │ │ │ ├── project.go
│ │ │ │ ├── project_cluster_relation.go
│ │ │ │ ├── registry_namespace.go
│ │ │ │ ├── renderset.go
│ │ │ │ ├── scanning.go
│ │ │ │ ├── testing.go
│ │ │ │ ├── workflow.go
│ │ │ │ └── workflow_task_v4.go
│ │ │ ├── mongodb
│ │ │ │ ├── basic_images.go
│ │ │ │ ├── build.go
│ │ │ │ ├── cluster.go
│ │ │ │ ├── codehost.go
│ │ │ │ ├── emailhost.go
│ │ │ │ ├── env_resources.go
│ │ │ │ ├── jenkins.go
│ │ │ │ ├── migration.go
│ │ │ │ ├── organization.go
│ │ │ │ ├── product.go
│ │ │ │ ├── project.go
│ │ │ │ ├── project_cluster_relation.go
│ │ │ │ ├── registry_namespace.go
│ │ │ │ ├── render_set.go
│ │ │ │ ├── scanning.go
│ │ │ │ ├── testing.go
│ │ │ │ ├── workflow.go
│ │ │ │ └── workflow_task_v4.go
│ │ │ └── orm
│ │ │ │ ├── addmysql.sql
│ │ │ │ ├── db.go
│ │ │ │ └── dropmysql.sql
│ │ │ └── upgradepath
│ │ │ ├── dag.go
│ │ │ ├── dag_test.go
│ │ │ ├── upgradepath_suite_test.go
│ │ │ └── versions.go
│ └── zadig-agent
│ │ ├── command
│ │ ├── cmd
│ │ │ ├── agent
│ │ │ │ ├── agent.go
│ │ │ │ └── init.go
│ │ │ ├── info.go
│ │ │ ├── root.go
│ │ │ ├── start.go
│ │ │ ├── start
│ │ │ │ └── asker.go
│ │ │ ├── stop.go
│ │ │ └── version.go
│ │ └── executor.go
│ │ ├── config
│ │ ├── config.go
│ │ ├── dir.go
│ │ └── version.go
│ │ ├── helper
│ │ ├── error
│ │ │ └── error.go
│ │ ├── git
│ │ │ └── git.go
│ │ ├── log
│ │ │ ├── job_log.go
│ │ │ └── log.go
│ │ └── perforce
│ │ │ └── perforce.go
│ │ ├── internal
│ │ ├── agent
│ │ │ ├── agent.go
│ │ │ ├── job
│ │ │ │ ├── cache.go
│ │ │ │ └── job_executor.go
│ │ │ ├── reporter
│ │ │ │ └── reporter.go
│ │ │ └── step
│ │ │ │ ├── archive
│ │ │ │ ├── step_archive.go
│ │ │ │ ├── step_archive_html.go
│ │ │ │ ├── step_download_archive.go
│ │ │ │ └── step_tar_archive.go
│ │ │ │ ├── docker
│ │ │ │ └── step_docker_build.go
│ │ │ │ ├── git
│ │ │ │ └── step_git.go
│ │ │ │ ├── helper
│ │ │ │ └── step.go
│ │ │ │ ├── perforce
│ │ │ │ └── step_p4.go
│ │ │ │ ├── scanning
│ │ │ │ ├── step_sonar_check.go
│ │ │ │ └── step_sonar_get_metrics.go
│ │ │ │ ├── script
│ │ │ │ ├── step_batch_file.go
│ │ │ │ ├── step_powershell.go
│ │ │ │ └── step_shell.go
│ │ │ │ ├── step.go
│ │ │ │ └── testing
│ │ │ │ └── step_junit_report.go
│ │ ├── common
│ │ │ ├── command.go
│ │ │ ├── const.go
│ │ │ ├── repo.go
│ │ │ └── types
│ │ │ │ ├── job_result.go
│ │ │ │ └── types.go
│ │ ├── network
│ │ │ ├── connect.go
│ │ │ └── network.go
│ │ └── register
│ │ │ └── register.go
│ │ ├── pkg
│ │ ├── monitor
│ │ │ └── heart_beat.go
│ │ ├── uninstall
│ │ │ └── uninstall.go
│ │ └── updater
│ │ │ └── update.go
│ │ └── util
│ │ ├── client
│ │ ├── client.go
│ │ ├── client_options.go
│ │ ├── errors.go
│ │ └── request_options.go
│ │ ├── dir.go
│ │ ├── file
│ │ └── file.go
│ │ └── os
│ │ ├── cmd.go
│ │ ├── directory.go
│ │ ├── parameters.go
│ │ ├── parameters_test.go
│ │ ├── parameters_unix.go
│ │ └── parameters_windows.go
├── config
│ ├── config.go
│ └── init.go
├── handler
│ └── cache
│ │ ├── cache.go
│ │ ├── consts.go
│ │ ├── handler.go
│ │ ├── interface.go
│ │ ├── redis_cache.go
│ │ └── router.go
├── microservice
│ ├── aslan
│ │ ├── config
│ │ │ ├── config.go
│ │ │ └── consts.go
│ │ ├── core
│ │ │ ├── build
│ │ │ │ ├── handler
│ │ │ │ │ ├── build.go
│ │ │ │ │ ├── openapi.go
│ │ │ │ │ ├── router.go
│ │ │ │ │ └── target.go
│ │ │ │ └── service
│ │ │ │ │ ├── build.go
│ │ │ │ │ ├── openapi.go
│ │ │ │ │ ├── target.go
│ │ │ │ │ └── types.go
│ │ │ ├── clean_cache_files.go
│ │ │ ├── code
│ │ │ │ ├── client
│ │ │ │ │ ├── gerrit
│ │ │ │ │ │ └── gerrit.go
│ │ │ │ │ ├── gitee
│ │ │ │ │ │ ├── gitee.go
│ │ │ │ │ │ └── gitee_ee.go
│ │ │ │ │ ├── github
│ │ │ │ │ │ └── github.go
│ │ │ │ │ ├── gitlab
│ │ │ │ │ │ └── gitlab.go
│ │ │ │ │ ├── interface.go
│ │ │ │ │ └── open
│ │ │ │ │ │ └── open.go
│ │ │ │ ├── handler
│ │ │ │ │ ├── codehost.go
│ │ │ │ │ ├── router.go
│ │ │ │ │ └── workspace.go
│ │ │ │ └── service
│ │ │ │ │ ├── branch.go
│ │ │ │ │ ├── commit.go
│ │ │ │ │ ├── merge_request.go
│ │ │ │ │ ├── namespace.go
│ │ │ │ │ ├── project.go
│ │ │ │ │ ├── repo.go
│ │ │ │ │ ├── tag.go
│ │ │ │ │ └── workspace.go
│ │ │ ├── collaboration
│ │ │ │ ├── config
│ │ │ │ │ └── consts.go
│ │ │ │ ├── handler
│ │ │ │ │ ├── collaboration_instance.go
│ │ │ │ │ ├── collaboration_mode.go
│ │ │ │ │ └── router.go
│ │ │ │ ├── repository
│ │ │ │ │ ├── models
│ │ │ │ │ │ ├── collaboration_instance.go
│ │ │ │ │ │ └── collaboration_mode.go
│ │ │ │ │ └── mongodb
│ │ │ │ │ │ ├── collaboration_instance.go
│ │ │ │ │ │ └── collaboration_mode.go
│ │ │ │ └── service
│ │ │ │ │ ├── collaboration_instance.go
│ │ │ │ │ └── collaboration_mode.go
│ │ │ ├── common
│ │ │ │ ├── handler
│ │ │ │ │ ├── callback.go
│ │ │ │ │ ├── health.go
│ │ │ │ │ └── tool.go
│ │ │ │ ├── repository
│ │ │ │ │ ├── models
│ │ │ │ │ │ ├── ai
│ │ │ │ │ │ │ └── enviroment_analysis.go
│ │ │ │ │ │ ├── approval_ticket.go
│ │ │ │ │ │ ├── basic_images.go
│ │ │ │ │ │ ├── build.go
│ │ │ │ │ │ ├── build_template.go
│ │ │ │ │ │ ├── callback_request.go
│ │ │ │ │ │ ├── chart.go
│ │ │ │ │ │ ├── configuration_management.go
│ │ │ │ │ │ ├── counter.go
│ │ │ │ │ │ ├── cronjob.go
│ │ │ │ │ │ ├── custom_workflow_test_report.go
│ │ │ │ │ │ ├── dashboard_config.go
│ │ │ │ │ │ ├── db_instance.go
│ │ │ │ │ │ ├── delivery_activity.go
│ │ │ │ │ │ ├── delivery_artifact.go
│ │ │ │ │ │ ├── delivery_build.go
│ │ │ │ │ │ ├── delivery_deploy.go
│ │ │ │ │ │ ├── delivery_distribute.go
│ │ │ │ │ │ ├── delivery_security.go
│ │ │ │ │ │ ├── delivery_testing.go
│ │ │ │ │ │ ├── delivery_version.go
│ │ │ │ │ │ ├── diff_note.go
│ │ │ │ │ │ ├── dind_clean.go
│ │ │ │ │ │ ├── dockerfile.go
│ │ │ │ │ │ ├── env_info.go
│ │ │ │ │ │ ├── env_resource.go
│ │ │ │ │ │ ├── env_svc_depend.go
│ │ │ │ │ │ ├── env_svc_version.go
│ │ │ │ │ │ ├── external_link.go
│ │ │ │ │ │ ├── external_system.go
│ │ │ │ │ │ ├── favorite_pipeline.go
│ │ │ │ │ │ ├── github_app.go
│ │ │ │ │ │ ├── helm_repo.go
│ │ │ │ │ │ ├── im_app.go
│ │ │ │ │ │ ├── image_tags.go
│ │ │ │ │ │ ├── install.go
│ │ │ │ │ │ ├── it_report.go
│ │ │ │ │ │ ├── jenkins.go
│ │ │ │ │ │ ├── job_info.go
│ │ │ │ │ │ ├── k8s_cluster.go
│ │ │ │ │ │ ├── labelbinding.go
│ │ │ │ │ │ ├── labels.go
│ │ │ │ │ │ ├── llm_integration.go
│ │ │ │ │ │ ├── msg_queue
│ │ │ │ │ │ │ ├── msg_queue_common.go
│ │ │ │ │ │ │ └── msg_queue_pipeline_task.go
│ │ │ │ │ │ ├── notification.go
│ │ │ │ │ │ ├── notify.go
│ │ │ │ │ │ ├── observability.go
│ │ │ │ │ │ ├── pipeline.go
│ │ │ │ │ │ ├── plugin_repo.go
│ │ │ │ │ │ ├── private_key.go
│ │ │ │ │ │ ├── product.go
│ │ │ │ │ │ ├── project_cluster_relation.go
│ │ │ │ │ │ ├── project_group.go
│ │ │ │ │ │ ├── project_management.go
│ │ │ │ │ │ ├── proxy.go
│ │ │ │ │ │ ├── queue.go
│ │ │ │ │ │ ├── registry_namespace.go
│ │ │ │ │ │ ├── release_plan.go
│ │ │ │ │ │ ├── release_plan_template.go
│ │ │ │ │ │ ├── render_set.go
│ │ │ │ │ │ ├── s3.go
│ │ │ │ │ │ ├── sae.go
│ │ │ │ │ │ ├── sae_env.go
│ │ │ │ │ │ ├── scanning.go
│ │ │ │ │ │ ├── scanning_template.go
│ │ │ │ │ │ ├── service.go
│ │ │ │ │ │ ├── services_in_external_env.go
│ │ │ │ │ │ ├── settings.go
│ │ │ │ │ │ ├── sonar.go
│ │ │ │ │ │ ├── sprint.go
│ │ │ │ │ │ ├── sprint_template.go
│ │ │ │ │ │ ├── sprint_workitem.go
│ │ │ │ │ │ ├── sprint_workitem_activity.go
│ │ │ │ │ │ ├── sprint_workitem_task.go
│ │ │ │ │ │ ├── stat_dashboard_config.go
│ │ │ │ │ │ ├── stats.go
│ │ │ │ │ │ ├── strategy.go
│ │ │ │ │ │ ├── subscription.go
│ │ │ │ │ │ ├── task
│ │ │ │ │ │ │ ├── artifact.go
│ │ │ │ │ │ │ ├── artifact_package.go
│ │ │ │ │ │ │ ├── build.go
│ │ │ │ │ │ │ ├── deploy.go
│ │ │ │ │ │ │ ├── distribute.go
│ │ │ │ │ │ │ ├── docker_build.go
│ │ │ │ │ │ │ ├── extension.go
│ │ │ │ │ │ │ ├── jenkins.go
│ │ │ │ │ │ │ ├── jira.go
│ │ │ │ │ │ │ ├── model.go
│ │ │ │ │ │ │ ├── release_image.go
│ │ │ │ │ │ │ ├── scanning.go
│ │ │ │ │ │ │ ├── security.go
│ │ │ │ │ │ │ ├── testing.go
│ │ │ │ │ │ │ ├── trigger.go
│ │ │ │ │ │ │ └── warpdrive.go
│ │ │ │ │ │ ├── template
│ │ │ │ │ │ │ └── product.go
│ │ │ │ │ │ ├── test_task_stat.go
│ │ │ │ │ │ ├── testing.go
│ │ │ │ │ │ ├── user_stat.go
│ │ │ │ │ │ ├── variable.go
│ │ │ │ │ │ ├── vm
│ │ │ │ │ │ │ └── vm_job.go
│ │ │ │ │ │ ├── webhook.go
│ │ │ │ │ │ ├── wokflow_task_v4.go
│ │ │ │ │ │ ├── workflow.go
│ │ │ │ │ │ ├── workflow_queue.go
│ │ │ │ │ │ ├── workflow_stat.go
│ │ │ │ │ │ ├── workflow_task_revert.go
│ │ │ │ │ │ ├── workflow_template.go
│ │ │ │ │ │ ├── workflow_v4.go
│ │ │ │ │ │ ├── workflow_view.go
│ │ │ │ │ │ ├── workload_stat.go
│ │ │ │ │ │ └── yaml_template.go
│ │ │ │ │ └── mongodb
│ │ │ │ │ │ ├── ai
│ │ │ │ │ │ └── EnvAIAnalysis.go
│ │ │ │ │ │ ├── approval_ticket.go
│ │ │ │ │ │ ├── basic_images.go
│ │ │ │ │ │ ├── build.go
│ │ │ │ │ │ ├── build_template.go
│ │ │ │ │ │ ├── callback_request.go
│ │ │ │ │ │ ├── chart.go
│ │ │ │ │ │ ├── configuration_management.go
│ │ │ │ │ │ ├── counter.go
│ │ │ │ │ │ ├── cronjob.go
│ │ │ │ │ │ ├── custom_workflow_test_report.go
│ │ │ │ │ │ ├── dashboard_config.go
│ │ │ │ │ │ ├── db_instance.go
│ │ │ │ │ │ ├── delivery_activity.go
│ │ │ │ │ │ ├── delivery_artifact.go
│ │ │ │ │ │ ├── delivery_build.go
│ │ │ │ │ │ ├── delivery_deploy.go
│ │ │ │ │ │ ├── delivery_distribute.go
│ │ │ │ │ │ ├── delivery_security.go
│ │ │ │ │ │ ├── delivery_testing.go
│ │ │ │ │ │ ├── delivery_version.go
│ │ │ │ │ │ ├── diff_note.go
│ │ │ │ │ │ ├── dind_clean.go
│ │ │ │ │ │ ├── dockerfile.go
│ │ │ │ │ │ ├── env_info.go
│ │ │ │ │ │ ├── env_resource.go
│ │ │ │ │ │ ├── env_svc_depend.go
│ │ │ │ │ │ ├── env_svc_version.go
│ │ │ │ │ │ ├── external_link.go
│ │ │ │ │ │ ├── external_system.go
│ │ │ │ │ │ ├── favorite_pipeline.go
│ │ │ │ │ │ ├── github_app.go
│ │ │ │ │ │ ├── helm_repo.go
│ │ │ │ │ │ ├── im_app.go
│ │ │ │ │ │ ├── image_tags.go
│ │ │ │ │ │ ├── install.go
│ │ │ │ │ │ ├── it_report.go
│ │ │ │ │ │ ├── jenkins.go
│ │ │ │ │ │ ├── job_info.go
│ │ │ │ │ │ ├── k8s_cluster.go
│ │ │ │ │ │ ├── label.go
│ │ │ │ │ │ ├── labelbinding.go
│ │ │ │ │ │ ├── llm_integration.go
│ │ │ │ │ │ ├── msg_queue_common.go
│ │ │ │ │ │ ├── msg_queue_pipeline_task.go
│ │ │ │ │ │ ├── notification.go
│ │ │ │ │ │ ├── notify.go
│ │ │ │ │ │ ├── observability.go
│ │ │ │ │ │ ├── pipeline.go
│ │ │ │ │ │ ├── plugin_repo.go
│ │ │ │ │ │ ├── private_key.go
│ │ │ │ │ │ ├── product.go
│ │ │ │ │ │ ├── production_service.go
│ │ │ │ │ │ ├── project_cluster_relation.go
│ │ │ │ │ │ ├── project_group.go
│ │ │ │ │ │ ├── project_management.go
│ │ │ │ │ │ ├── proxy.go
│ │ │ │ │ │ ├── queue.go
│ │ │ │ │ │ ├── registry_namespace.go
│ │ │ │ │ │ ├── release_plan.go
│ │ │ │ │ │ ├── release_plan_log.go
│ │ │ │ │ │ ├── release_plan_template.go
│ │ │ │ │ │ ├── render_set.go
│ │ │ │ │ │ ├── s3.go
│ │ │ │ │ │ ├── sae.go
│ │ │ │ │ │ ├── sae_env.go
│ │ │ │ │ │ ├── scanning.go
│ │ │ │ │ │ ├── scanning_template.go
│ │ │ │ │ │ ├── service.go
│ │ │ │ │ │ ├── services_in_external_env.go
│ │ │ │ │ │ ├── settings.go
│ │ │ │ │ │ ├── sonar.go
│ │ │ │ │ │ ├── sprint.go
│ │ │ │ │ │ ├── sprint_template.go
│ │ │ │ │ │ ├── sprint_workitem.go
│ │ │ │ │ │ ├── sprint_workitem_activity.go
│ │ │ │ │ │ ├── sprint_workitem_task.go
│ │ │ │ │ │ ├── stat_dashboard_config.go
│ │ │ │ │ │ ├── stats.go
│ │ │ │ │ │ ├── strategy.go
│ │ │ │ │ │ ├── subscription.go
│ │ │ │ │ │ ├── task.go
│ │ │ │ │ │ ├── template
│ │ │ │ │ │ └── product.go
│ │ │ │ │ │ ├── test_task_stat.go
│ │ │ │ │ │ ├── testing.go
│ │ │ │ │ │ ├── user_stat.go
│ │ │ │ │ │ ├── variable_set.go
│ │ │ │ │ │ ├── vm
│ │ │ │ │ │ └── vm_job.go
│ │ │ │ │ │ ├── webhook.go
│ │ │ │ │ │ ├── workflow.go
│ │ │ │ │ │ ├── workflow_queue.go
│ │ │ │ │ │ ├── workflow_stat.go
│ │ │ │ │ │ ├── workflow_task_revert.go
│ │ │ │ │ │ ├── workflow_task_v4.go
│ │ │ │ │ │ ├── workflow_template.go
│ │ │ │ │ │ ├── workflow_v4.go
│ │ │ │ │ │ ├── workflow_view.go
│ │ │ │ │ │ ├── workload_stat.go
│ │ │ │ │ │ └── yaml_template.go
│ │ │ │ ├── service
│ │ │ │ │ ├── approval
│ │ │ │ │ │ └── approval.go
│ │ │ │ │ ├── artifact.go
│ │ │ │ │ ├── base
│ │ │ │ │ │ └── convert.go
│ │ │ │ │ ├── build.go
│ │ │ │ │ ├── callback.go
│ │ │ │ │ ├── collaboration
│ │ │ │ │ │ └── collaboration_mode.go
│ │ │ │ │ ├── collie
│ │ │ │ │ │ ├── client.go
│ │ │ │ │ │ ├── github.go
│ │ │ │ │ │ ├── gitlab.go
│ │ │ │ │ │ └── pipeline.go
│ │ │ │ │ ├── command
│ │ │ │ │ │ └── git_cmd.go
│ │ │ │ │ ├── config_payload.go
│ │ │ │ │ ├── cronjob.go
│ │ │ │ │ ├── dbinstance.go
│ │ │ │ │ ├── delivery.go
│ │ │ │ │ ├── dingtalk
│ │ │ │ │ │ ├── crypto.go
│ │ │ │ │ │ ├── dingtalk.go
│ │ │ │ │ │ └── webhook.go
│ │ │ │ │ ├── environment.go
│ │ │ │ │ ├── favorite.go
│ │ │ │ │ ├── fs
│ │ │ │ │ │ ├── file.go
│ │ │ │ │ │ ├── file_info.go
│ │ │ │ │ │ ├── git.go
│ │ │ │ │ │ └── s3.go
│ │ │ │ │ ├── gerrit
│ │ │ │ │ │ └── gerrit.go
│ │ │ │ │ ├── git
│ │ │ │ │ │ ├── hook.go
│ │ │ │ │ │ ├── parse.go
│ │ │ │ │ │ └── types.go
│ │ │ │ │ ├── gitee
│ │ │ │ │ │ ├── client.go
│ │ │ │ │ │ ├── comment.go
│ │ │ │ │ │ └── webhook.go
│ │ │ │ │ ├── github
│ │ │ │ │ │ ├── checks.go
│ │ │ │ │ │ ├── client.go
│ │ │ │ │ │ ├── repository.go
│ │ │ │ │ │ ├── status.go
│ │ │ │ │ │ └── webhook.go
│ │ │ │ │ ├── gitlab
│ │ │ │ │ │ ├── client.go
│ │ │ │ │ │ ├── repository.go
│ │ │ │ │ │ └── webhook.go
│ │ │ │ │ ├── helm
│ │ │ │ │ │ ├── helm.go
│ │ │ │ │ │ └── util.go
│ │ │ │ │ ├── imnotify
│ │ │ │ │ │ ├── dingTalk.go
│ │ │ │ │ │ ├── imnotify_service.go
│ │ │ │ │ │ ├── lark.go
│ │ │ │ │ │ └── wechatwork.go
│ │ │ │ │ ├── instantmessage
│ │ │ │ │ │ ├── dingTalk.go
│ │ │ │ │ │ ├── lark.go
│ │ │ │ │ │ ├── mail.go
│ │ │ │ │ │ ├── msteams.go
│ │ │ │ │ │ ├── notification.html
│ │ │ │ │ │ ├── service.go
│ │ │ │ │ │ ├── wechatwork.go
│ │ │ │ │ │ └── workflow_task.go
│ │ │ │ │ ├── it_report.go
│ │ │ │ │ ├── jira
│ │ │ │ │ │ └── jira.go
│ │ │ │ │ ├── kube
│ │ │ │ │ │ ├── actions.go
│ │ │ │ │ │ ├── apply.go
│ │ │ │ │ │ ├── helm.go
│ │ │ │ │ │ ├── istio_grayscale.go
│ │ │ │ │ │ ├── parse.go
│ │ │ │ │ │ ├── render.go
│ │ │ │ │ │ ├── service.go
│ │ │ │ │ │ ├── share_env.go
│ │ │ │ │ │ ├── share_env_utils.go
│ │ │ │ │ │ ├── status.go
│ │ │ │ │ │ ├── types.go
│ │ │ │ │ │ ├── utils.go
│ │ │ │ │ │ └── workloads.go
│ │ │ │ │ ├── lark
│ │ │ │ │ │ ├── lark.go
│ │ │ │ │ │ └── webhook.go
│ │ │ │ │ ├── llm.go
│ │ │ │ │ ├── llm_test.go
│ │ │ │ │ ├── nacos.go
│ │ │ │ │ ├── notify
│ │ │ │ │ │ ├── client.go
│ │ │ │ │ │ └── message.go
│ │ │ │ │ ├── nsq
│ │ │ │ │ │ └── nsq.go
│ │ │ │ │ ├── pipeline.go
│ │ │ │ │ ├── pm
│ │ │ │ │ │ └── env_status.go
│ │ │ │ │ ├── product.go
│ │ │ │ │ ├── queue.go
│ │ │ │ │ ├── registry.go
│ │ │ │ │ ├── registry
│ │ │ │ │ │ ├── service.go
│ │ │ │ │ │ ├── service_test.go
│ │ │ │ │ │ └── types.go
│ │ │ │ │ ├── render.go
│ │ │ │ │ ├── render
│ │ │ │ │ │ └── renderset.go
│ │ │ │ │ ├── repository.go
│ │ │ │ │ ├── repository
│ │ │ │ │ │ └── service.go
│ │ │ │ │ ├── s3
│ │ │ │ │ │ └── s3.go
│ │ │ │ │ ├── sae
│ │ │ │ │ │ ├── client.go
│ │ │ │ │ │ └── sae.go
│ │ │ │ │ ├── scanning.go
│ │ │ │ │ ├── scmnotify
│ │ │ │ │ │ ├── client.go
│ │ │ │ │ │ └── scmnotify.go
│ │ │ │ │ ├── service.go
│ │ │ │ │ ├── sets.go
│ │ │ │ │ ├── stats.go
│ │ │ │ │ ├── task.go
│ │ │ │ │ ├── template
│ │ │ │ │ │ ├── dockerfile.go
│ │ │ │ │ │ ├── types.go
│ │ │ │ │ │ └── yaml.go
│ │ │ │ │ ├── template_product.go
│ │ │ │ │ ├── template_store.go
│ │ │ │ │ ├── testing.go
│ │ │ │ │ ├── utils.go
│ │ │ │ │ ├── version.go
│ │ │ │ │ ├── webhook
│ │ │ │ │ │ ├── client.go
│ │ │ │ │ │ ├── controller.go
│ │ │ │ │ │ └── types.go
│ │ │ │ │ ├── webhooknotify
│ │ │ │ │ │ ├── client.go
│ │ │ │ │ │ └── types.go
│ │ │ │ │ ├── workflow.go
│ │ │ │ │ ├── workflow_v4.go
│ │ │ │ │ ├── workflowcontroller
│ │ │ │ │ │ ├── jobcontroller
│ │ │ │ │ │ │ ├── job.go
│ │ │ │ │ │ │ ├── job_apollo.go
│ │ │ │ │ │ │ ├── job_approval.go
│ │ │ │ │ │ │ ├── job_blue_green_deploy.go
│ │ │ │ │ │ │ ├── job_blue_green_deploy_v2.go
│ │ │ │ │ │ │ ├── job_blue_green_release.go
│ │ │ │ │ │ │ ├── job_blue_green_release_v2.go
│ │ │ │ │ │ │ ├── job_blueking.go
│ │ │ │ │ │ │ ├── job_canary_deploy.go
│ │ │ │ │ │ │ ├── job_canary_release.go
│ │ │ │ │ │ │ ├── job_custom_deploy.go
│ │ │ │ │ │ │ ├── job_deploy.go
│ │ │ │ │ │ │ ├── job_env.go
│ │ │ │ │ │ │ ├── job_freestyle.go
│ │ │ │ │ │ │ ├── job_grafana.go
│ │ │ │ │ │ │ ├── job_gray_release.go
│ │ │ │ │ │ │ ├── job_gray_rollback.go
│ │ │ │ │ │ │ ├── job_guanceyun.go
│ │ │ │ │ │ │ ├── job_helm_chart_deploy.go
│ │ │ │ │ │ │ ├── job_helm_deploy.go
│ │ │ │ │ │ │ ├── job_istio_release.go
│ │ │ │ │ │ │ ├── job_istio_rollback.go
│ │ │ │ │ │ │ ├── job_jenkins.go
│ │ │ │ │ │ │ ├── job_jira.go
│ │ │ │ │ │ │ ├── job_k8s_patch.go
│ │ │ │ │ │ │ ├── job_meego_transition.go
│ │ │ │ │ │ │ ├── job_mse_gray_offline.go
│ │ │ │ │ │ │ ├── job_mse_gray_release.go
│ │ │ │ │ │ │ ├── job_nacos.go
│ │ │ │ │ │ │ ├── job_notification.go
│ │ │ │ │ │ │ ├── job_offline_service.go
│ │ │ │ │ │ │ ├── job_plugin.go
│ │ │ │ │ │ │ ├── job_sae_deploy.go
│ │ │ │ │ │ │ ├── job_sql.go
│ │ │ │ │ │ │ ├── job_update_env_istio_config.go
│ │ │ │ │ │ │ ├── job_workflow_trigger.go
│ │ │ │ │ │ │ ├── kubernetes.go
│ │ │ │ │ │ │ ├── types.go
│ │ │ │ │ │ │ └── vm.go
│ │ │ │ │ │ ├── queue.go
│ │ │ │ │ │ ├── stage.go
│ │ │ │ │ │ ├── stage_custom.go
│ │ │ │ │ │ ├── stepcontroller
│ │ │ │ │ │ │ ├── step.go
│ │ │ │ │ │ │ ├── step_archive.go
│ │ │ │ │ │ │ ├── step_archive_html.go
│ │ │ │ │ │ │ ├── step_batch_file.go
│ │ │ │ │ │ │ ├── step_debug.go
│ │ │ │ │ │ │ ├── step_distribute_image.go
│ │ │ │ │ │ │ ├── step_docker_build.go
│ │ │ │ │ │ │ ├── step_download_achive.go
│ │ │ │ │ │ │ ├── step_git.go
│ │ │ │ │ │ │ ├── step_junit_report.go
│ │ │ │ │ │ │ ├── step_p4.go
│ │ │ │ │ │ │ ├── step_powershell.go
│ │ │ │ │ │ │ ├── step_shell.go
│ │ │ │ │ │ │ ├── step_sonar_check.go
│ │ │ │ │ │ │ ├── step_sonar_get_metrics.go
│ │ │ │ │ │ │ ├── step_tar_archive.go
│ │ │ │ │ │ │ └── step_tool_install.go
│ │ │ │ │ │ ├── workflow.go
│ │ │ │ │ │ └── workflow_env.go
│ │ │ │ │ ├── workflowstat
│ │ │ │ │ │ └── workflow_stat.go
│ │ │ │ │ └── workwx
│ │ │ │ │ │ ├── webhook.go
│ │ │ │ │ │ └── workwx.go
│ │ │ │ ├── types
│ │ │ │ │ ├── service.go
│ │ │ │ │ ├── service_variable.go
│ │ │ │ │ ├── service_variable_test.go
│ │ │ │ │ └── types_suite_test.go
│ │ │ │ └── util
│ │ │ │ │ ├── enviroment.go
│ │ │ │ │ ├── helm.go
│ │ │ │ │ ├── istio_grayscale.go
│ │ │ │ │ ├── jenkins.go
│ │ │ │ │ ├── kubernetes.go
│ │ │ │ │ ├── openapi.go
│ │ │ │ │ ├── registry.go
│ │ │ │ │ ├── rsa_key.go
│ │ │ │ │ ├── service.go
│ │ │ │ │ ├── template.go
│ │ │ │ │ ├── user.go
│ │ │ │ │ ├── validate.go
│ │ │ │ │ ├── variables.go
│ │ │ │ │ ├── version.go
│ │ │ │ │ └── workflow.go
│ │ │ ├── cron
│ │ │ │ ├── handler
│ │ │ │ │ ├── cron.go
│ │ │ │ │ └── router.go
│ │ │ │ └── service
│ │ │ │ │ ├── cron.go
│ │ │ │ │ └── cronjob.go
│ │ │ ├── delivery
│ │ │ │ ├── handler
│ │ │ │ │ ├── artifact.go
│ │ │ │ │ ├── openapi.go
│ │ │ │ │ ├── router.go
│ │ │ │ │ └── version.go
│ │ │ │ └── service
│ │ │ │ │ ├── artifact.go
│ │ │ │ │ ├── build.go
│ │ │ │ │ ├── deploy.go
│ │ │ │ │ ├── distribute.go
│ │ │ │ │ ├── openapi.go
│ │ │ │ │ ├── security.go
│ │ │ │ │ ├── testing.go
│ │ │ │ │ └── version.go
│ │ │ ├── environment
│ │ │ │ ├── handler
│ │ │ │ │ ├── common_env_cfg.go
│ │ │ │ │ ├── configmap.go
│ │ │ │ │ ├── debug.go
│ │ │ │ │ ├── diff.go
│ │ │ │ │ ├── environment.go
│ │ │ │ │ ├── export.go
│ │ │ │ │ ├── helm.go
│ │ │ │ │ ├── ide.go
│ │ │ │ │ ├── image.go
│ │ │ │ │ ├── ingress.go
│ │ │ │ │ ├── istio_grayscale.go
│ │ │ │ │ ├── kube.go
│ │ │ │ │ ├── openapi.go
│ │ │ │ │ ├── operation.go
│ │ │ │ │ ├── pm_exec.go
│ │ │ │ │ ├── product.go
│ │ │ │ │ ├── pvc.go
│ │ │ │ │ ├── renderset.go
│ │ │ │ │ ├── revision.go
│ │ │ │ │ ├── router.go
│ │ │ │ │ ├── secret.go
│ │ │ │ │ ├── service.go
│ │ │ │ │ ├── share_env.go
│ │ │ │ │ └── version.go
│ │ │ │ └── service
│ │ │ │ │ ├── common_env_cfg.go
│ │ │ │ │ ├── common_env_cfg_informer.go
│ │ │ │ │ ├── configmap.go
│ │ │ │ │ ├── debug.go
│ │ │ │ │ ├── diff.go
│ │ │ │ │ ├── env.go
│ │ │ │ │ ├── environment.go
│ │ │ │ │ ├── environment_copy.go
│ │ │ │ │ ├── environment_creation.go
│ │ │ │ │ ├── environment_creator.go
│ │ │ │ │ ├── environment_define.go
│ │ │ │ │ ├── environment_group.go
│ │ │ │ │ ├── environment_update.go
│ │ │ │ │ ├── export.go
│ │ │ │ │ ├── helm.go
│ │ │ │ │ ├── ide.go
│ │ │ │ │ ├── image.go
│ │ │ │ │ ├── ingress.go
│ │ │ │ │ ├── istio_grayscale.go
│ │ │ │ │ ├── k8s.go
│ │ │ │ │ ├── kube.go
│ │ │ │ │ ├── kube_fetcher.go
│ │ │ │ │ ├── kube_test.go
│ │ │ │ │ ├── openapi.go
│ │ │ │ │ ├── pm.go
│ │ │ │ │ ├── pm_exec.go
│ │ │ │ │ ├── product.go
│ │ │ │ │ ├── production_environment.go
│ │ │ │ │ ├── pvc.go
│ │ │ │ │ ├── renderset.go
│ │ │ │ │ ├── revision.go
│ │ │ │ │ ├── sae_env.go
│ │ │ │ │ ├── secret.go
│ │ │ │ │ ├── service.go
│ │ │ │ │ ├── service_suite_test.go
│ │ │ │ │ ├── share_env.go
│ │ │ │ │ ├── share_env_utils.go
│ │ │ │ │ └── types.go
│ │ │ ├── log
│ │ │ │ ├── handler
│ │ │ │ │ ├── ai.go
│ │ │ │ │ ├── log.go
│ │ │ │ │ ├── router.go
│ │ │ │ │ └── sse.go
│ │ │ │ └── service
│ │ │ │ │ ├── ai
│ │ │ │ │ ├── build.go
│ │ │ │ │ └── type.go
│ │ │ │ │ ├── log.go
│ │ │ │ │ └── sse.go
│ │ │ ├── multicluster
│ │ │ │ ├── handler
│ │ │ │ │ ├── cache.go
│ │ │ │ │ ├── clusters.go
│ │ │ │ │ ├── router.go
│ │ │ │ │ └── share_env.go
│ │ │ │ └── service
│ │ │ │ │ ├── cache.go
│ │ │ │ │ ├── clusters.go
│ │ │ │ │ ├── constants.go
│ │ │ │ │ └── share_env.go
│ │ │ ├── project
│ │ │ │ ├── handler
│ │ │ │ │ ├── host.go
│ │ │ │ │ ├── integration.go
│ │ │ │ │ ├── openapi.go
│ │ │ │ │ ├── product.go
│ │ │ │ │ ├── project.go
│ │ │ │ │ ├── router.go
│ │ │ │ │ └── variable.go
│ │ │ │ └── service
│ │ │ │ │ ├── bizdir.go
│ │ │ │ │ ├── integration.go
│ │ │ │ │ ├── openapi.go
│ │ │ │ │ ├── product.go
│ │ │ │ │ ├── project.go
│ │ │ │ │ ├── testing.go
│ │ │ │ │ ├── types.go
│ │ │ │ │ └── variable_set.go
│ │ │ ├── release_plan
│ │ │ │ ├── handler
│ │ │ │ │ ├── openapi.go
│ │ │ │ │ ├── release_plan.go
│ │ │ │ │ └── router.go
│ │ │ │ └── service
│ │ │ │ │ ├── approval.go
│ │ │ │ │ ├── approval.html
│ │ │ │ │ ├── errors.go
│ │ │ │ │ ├── execute.go
│ │ │ │ │ ├── lint.go
│ │ │ │ │ ├── lock.go
│ │ │ │ │ ├── openapi.go
│ │ │ │ │ ├── release_plan.go
│ │ │ │ │ ├── skip.go
│ │ │ │ │ ├── update.go
│ │ │ │ │ └── watcher.go
│ │ │ ├── service.go
│ │ │ ├── service
│ │ │ │ ├── handler
│ │ │ │ │ ├── environment.go
│ │ │ │ │ ├── harbor.go
│ │ │ │ │ ├── helm.go
│ │ │ │ │ ├── loader.go
│ │ │ │ │ ├── openapi.go
│ │ │ │ │ ├── router.go
│ │ │ │ │ ├── service.go
│ │ │ │ │ ├── version.go
│ │ │ │ │ └── yaml_template.go
│ │ │ │ └── service
│ │ │ │ │ ├── environment.go
│ │ │ │ │ ├── harbor.go
│ │ │ │ │ ├── helm.go
│ │ │ │ │ ├── label.go
│ │ │ │ │ ├── loader.go
│ │ │ │ │ ├── new_loader.go
│ │ │ │ │ ├── openapi.go
│ │ │ │ │ ├── pm.go
│ │ │ │ │ ├── service.go
│ │ │ │ │ ├── template.go
│ │ │ │ │ ├── types.go
│ │ │ │ │ └── version.go
│ │ │ ├── sprint_management
│ │ │ │ ├── handler
│ │ │ │ │ ├── router.go
│ │ │ │ │ ├── sprint.go
│ │ │ │ │ ├── sprint_template.go
│ │ │ │ │ └── sprint_workitem.go
│ │ │ │ └── service
│ │ │ │ │ ├── lock.go
│ │ │ │ │ ├── sprint.go
│ │ │ │ │ ├── sprint_template.go
│ │ │ │ │ ├── sprint_workitem.go
│ │ │ │ │ └── watcher.go
│ │ │ ├── stat
│ │ │ │ ├── handler
│ │ │ │ │ ├── build.go
│ │ │ │ │ ├── build_stat.go
│ │ │ │ │ ├── deploy.go
│ │ │ │ │ ├── deploy_stat.go
│ │ │ │ │ ├── deploy_stat_v2.go
│ │ │ │ │ ├── openapi.go
│ │ │ │ │ ├── overview.go
│ │ │ │ │ ├── release.go
│ │ │ │ │ ├── router.go
│ │ │ │ │ ├── stat_v2.go
│ │ │ │ │ ├── test.go
│ │ │ │ │ └── test_stat.go
│ │ │ │ ├── repository
│ │ │ │ │ ├── models
│ │ │ │ │ │ ├── build.go
│ │ │ │ │ │ ├── deploy.go
│ │ │ │ │ │ ├── deploy_stat_weekly.go
│ │ │ │ │ │ ├── release_stat_monthly.go
│ │ │ │ │ │ └── test.go
│ │ │ │ │ └── mongodb
│ │ │ │ │ │ ├── build.go
│ │ │ │ │ │ ├── deploy.go
│ │ │ │ │ │ ├── deploy_stat_monthly.go
│ │ │ │ │ │ ├── deploy_stat_weekly.go
│ │ │ │ │ │ ├── release_stat_monthly.go
│ │ │ │ │ │ └── test.go
│ │ │ │ └── service
│ │ │ │ │ ├── ai
│ │ │ │ │ ├── ai_analysis.go
│ │ │ │ │ ├── build.go
│ │ │ │ │ ├── deploy.go
│ │ │ │ │ ├── stat_prompt.go
│ │ │ │ │ ├── test.go
│ │ │ │ │ └── types.go
│ │ │ │ │ ├── build.go
│ │ │ │ │ ├── build_stat.go
│ │ │ │ │ ├── deploy.go
│ │ │ │ │ ├── deploy_stat.go
│ │ │ │ │ ├── deploy_stat_v2.go
│ │ │ │ │ ├── overview.go
│ │ │ │ │ ├── release.go
│ │ │ │ │ ├── rollback.go
│ │ │ │ │ ├── stat_calculator.go
│ │ │ │ │ ├── stat_v2.go
│ │ │ │ │ ├── test.go
│ │ │ │ │ ├── test_stat.go
│ │ │ │ │ └── types.go
│ │ │ ├── system
│ │ │ │ ├── handler
│ │ │ │ │ ├── announcement.go
│ │ │ │ │ ├── approval.go
│ │ │ │ │ ├── basic_images.go
│ │ │ │ │ ├── blueking.go
│ │ │ │ │ ├── capacity.go
│ │ │ │ │ ├── cicd_tools.go
│ │ │ │ │ ├── concurrency.go
│ │ │ │ │ ├── configuration_management.go
│ │ │ │ │ ├── custom_theme.go
│ │ │ │ │ ├── dashboard.go
│ │ │ │ │ ├── database.go
│ │ │ │ │ ├── dingtalk.go
│ │ │ │ │ ├── external_link.go
│ │ │ │ │ ├── external_system.go
│ │ │ │ │ ├── favorite.go
│ │ │ │ │ ├── grafana.go
│ │ │ │ │ ├── guanceyun.go
│ │ │ │ │ ├── helm.go
│ │ │ │ │ ├── initialization.go
│ │ │ │ │ ├── install.go
│ │ │ │ │ ├── jenkins.go
│ │ │ │ │ ├── labels.go
│ │ │ │ │ ├── lark.go
│ │ │ │ │ ├── llm.go
│ │ │ │ │ ├── login.go
│ │ │ │ │ ├── meego.go
│ │ │ │ │ ├── middleware.go
│ │ │ │ │ ├── nacos.go
│ │ │ │ │ ├── notify.go
│ │ │ │ │ ├── observability.go
│ │ │ │ │ ├── openapi.go
│ │ │ │ │ ├── operation.go
│ │ │ │ │ ├── private_key.go
│ │ │ │ │ ├── project_management.go
│ │ │ │ │ ├── proxy.go
│ │ │ │ │ ├── registry.go
│ │ │ │ │ ├── resp.go
│ │ │ │ │ ├── response.go
│ │ │ │ │ ├── router.go
│ │ │ │ │ ├── rsa_key.go
│ │ │ │ │ ├── s3.go
│ │ │ │ │ ├── sae.go
│ │ │ │ │ ├── security.go
│ │ │ │ │ ├── sonar.go
│ │ │ │ │ ├── system_cache.go
│ │ │ │ │ ├── webhook.go
│ │ │ │ │ └── workwx.go
│ │ │ │ ├── repository
│ │ │ │ │ ├── models
│ │ │ │ │ │ ├── announcement.go
│ │ │ │ │ │ └── operation_log.go
│ │ │ │ │ └── mongodb
│ │ │ │ │ │ ├── announcement.go
│ │ │ │ │ │ └── operation_log.go
│ │ │ │ └── service
│ │ │ │ │ ├── announcement.go
│ │ │ │ │ ├── basic_images.go
│ │ │ │ │ ├── blueking.go
│ │ │ │ │ ├── capacity.go
│ │ │ │ │ ├── cicd_tools.go
│ │ │ │ │ ├── concurrency.go
│ │ │ │ │ ├── configuration_management.go
│ │ │ │ │ ├── custom_theme.go
│ │ │ │ │ ├── dashboard.go
│ │ │ │ │ ├── external_link.go
│ │ │ │ │ ├── external_system.go
│ │ │ │ │ ├── github_app.go
│ │ │ │ │ ├── grafana.go
│ │ │ │ │ ├── guanceyun.go
│ │ │ │ │ ├── helm.go
│ │ │ │ │ ├── im_app.go
│ │ │ │ │ ├── initialization.go
│ │ │ │ │ ├── install.go
│ │ │ │ │ ├── jenkins.go
│ │ │ │ │ ├── labels.go
│ │ │ │ │ ├── llm.go
│ │ │ │ │ ├── login.go
│ │ │ │ │ ├── meego.go
│ │ │ │ │ ├── notify.go
│ │ │ │ │ ├── observablilty.go
│ │ │ │ │ ├── openapi.go
│ │ │ │ │ ├── operation.go
│ │ │ │ │ ├── private_key.go
│ │ │ │ │ ├── project_management.go
│ │ │ │ │ ├── proxy.go
│ │ │ │ │ ├── registry.go
│ │ │ │ │ ├── s3.go
│ │ │ │ │ ├── security.go
│ │ │ │ │ ├── sonar.go
│ │ │ │ │ ├── system_cache.go
│ │ │ │ │ ├── types.go
│ │ │ │ │ ├── webhook.go
│ │ │ │ │ └── workwx.go
│ │ │ ├── templatestore
│ │ │ │ ├── handler
│ │ │ │ │ ├── build.go
│ │ │ │ │ ├── chart.go
│ │ │ │ │ ├── dockerfile.go
│ │ │ │ │ ├── release_plan.go
│ │ │ │ │ ├── router.go
│ │ │ │ │ ├── scanning.go
│ │ │ │ │ ├── workflow.go
│ │ │ │ │ └── yaml.go
│ │ │ │ └── service
│ │ │ │ │ ├── build.go
│ │ │ │ │ ├── chart.go
│ │ │ │ │ ├── dockerfile.go
│ │ │ │ │ ├── release_plan.go
│ │ │ │ │ ├── scanning.go
│ │ │ │ │ ├── types.go
│ │ │ │ │ ├── workflow.go
│ │ │ │ │ └── yaml.go
│ │ │ ├── ticket
│ │ │ │ ├── handler
│ │ │ │ │ ├── approval_ticket.go
│ │ │ │ │ ├── openapi.go
│ │ │ │ │ └── router.go
│ │ │ │ └── service
│ │ │ │ │ └── approval_ticket.go
│ │ │ ├── vm
│ │ │ │ ├── handler
│ │ │ │ │ ├── router.go
│ │ │ │ │ └── vm.go
│ │ │ │ └── service
│ │ │ │ │ ├── log.go
│ │ │ │ │ ├── types.go
│ │ │ │ │ └── vm.go
│ │ │ └── workflow
│ │ │ │ ├── handler
│ │ │ │ ├── build.go
│ │ │ │ ├── favorate_pipeline.go
│ │ │ │ ├── openapi.go
│ │ │ │ ├── pipeline.go
│ │ │ │ ├── pipeline_status.go
│ │ │ │ ├── pipeline_task.go
│ │ │ │ ├── plugin_repo.go
│ │ │ │ ├── router.go
│ │ │ │ ├── service_task.go
│ │ │ │ ├── sse.go
│ │ │ │ ├── webhook.go
│ │ │ │ ├── workflow.go
│ │ │ │ ├── workflow_task.go
│ │ │ │ ├── workflow_task_v4.go
│ │ │ │ ├── workflow_v4.go
│ │ │ │ └── workflow_view.go
│ │ │ │ ├── service
│ │ │ │ ├── webhook
│ │ │ │ │ ├── auto_cancel_task.go
│ │ │ │ │ ├── gerrit.go
│ │ │ │ │ ├── gerrit_workflow_task.go
│ │ │ │ │ ├── gerrit_workflowv4_task.go
│ │ │ │ │ ├── gitee.go
│ │ │ │ │ ├── gitee_testing_task.go
│ │ │ │ │ ├── gitee_workflow_task.go
│ │ │ │ │ ├── gitee_workflowv4_task.go
│ │ │ │ │ ├── github.go
│ │ │ │ │ ├── github_scanning_task.go
│ │ │ │ │ ├── github_testing_task.go
│ │ │ │ │ ├── github_workflow_task.go
│ │ │ │ │ ├── github_workflowv4_task.go
│ │ │ │ │ ├── gitlab.go
│ │ │ │ │ ├── gitlab_scanning_task.go
│ │ │ │ │ ├── gitlab_testing_task.go
│ │ │ │ │ ├── gitlab_workflow_task.go
│ │ │ │ │ ├── gitlab_workflowv4_task.go
│ │ │ │ │ ├── trigger_yaml.go
│ │ │ │ │ ├── utils.go
│ │ │ │ │ └── webhook_suite_test.go
│ │ │ │ └── workflow
│ │ │ │ │ ├── artifact_task.go
│ │ │ │ │ ├── cache_manager.go
│ │ │ │ │ ├── controller
│ │ │ │ │ ├── job
│ │ │ │ │ │ ├── dynamic_variable.go
│ │ │ │ │ │ ├── interface.go
│ │ │ │ │ │ ├── job_apollo.go
│ │ │ │ │ │ ├── job_approval.go
│ │ │ │ │ │ ├── job_blue_green_deploy.go
│ │ │ │ │ │ ├── job_blue_green_release.go
│ │ │ │ │ │ ├── job_blueking.go
│ │ │ │ │ │ ├── job_build.go
│ │ │ │ │ │ ├── job_canary_deploy.go
│ │ │ │ │ │ ├── job_canary_release.go
│ │ │ │ │ │ ├── job_custom_deploy.go
│ │ │ │ │ │ ├── job_deploy.go
│ │ │ │ │ │ ├── job_distribute_image.go
│ │ │ │ │ │ ├── job_freestyle.go
│ │ │ │ │ │ ├── job_grafana.go
│ │ │ │ │ │ ├── job_gray_release.go
│ │ │ │ │ │ ├── job_gray_rollback.go
│ │ │ │ │ │ ├── job_helm_chart_deploy.go
│ │ │ │ │ │ ├── job_istio_release.go
│ │ │ │ │ │ ├── job_istio_rollback.go
│ │ │ │ │ │ ├── job_jenkins.go
│ │ │ │ │ │ ├── job_jira.go
│ │ │ │ │ │ ├── job_k8s_patch.go
│ │ │ │ │ │ ├── job_meego_transition.go
│ │ │ │ │ │ ├── job_mse_gray_offline.go
│ │ │ │ │ │ ├── job_mse_gray_release.go
│ │ │ │ │ │ ├── job_nacos.go
│ │ │ │ │ │ ├── job_notification.go
│ │ │ │ │ │ ├── job_offline_service.go
│ │ │ │ │ │ ├── job_plugin.go
│ │ │ │ │ │ ├── job_sae_deploy.go
│ │ │ │ │ │ ├── job_scanning.go
│ │ │ │ │ │ ├── job_sql.go
│ │ │ │ │ │ ├── job_testing.go
│ │ │ │ │ │ ├── job_update_env_istio_config.go
│ │ │ │ │ │ ├── job_vm_deploy.go
│ │ │ │ │ │ ├── job_workflow_trigger.go
│ │ │ │ │ │ ├── types.go
│ │ │ │ │ │ └── utils.go
│ │ │ │ │ ├── utils.go
│ │ │ │ │ └── workflow.go
│ │ │ │ │ ├── convert.go
│ │ │ │ │ ├── cronjob.go
│ │ │ │ │ ├── favorite_pipeline.go
│ │ │ │ │ ├── gerrit.go
│ │ │ │ │ ├── github.go
│ │ │ │ │ ├── nsq_handlers.go
│ │ │ │ │ ├── openapi.go
│ │ │ │ │ ├── pipeline.go
│ │ │ │ │ ├── pipeline_cleaner.go
│ │ │ │ │ ├── pipeline_controller.go
│ │ │ │ │ ├── pipeline_queue.go
│ │ │ │ │ ├── pipeline_status.go
│ │ │ │ │ ├── pipeline_task.go
│ │ │ │ │ ├── pipeline_validation.go
│ │ │ │ │ ├── plugin_repo.go
│ │ │ │ │ ├── plugins
│ │ │ │ │ ├── README.md
│ │ │ │ │ └── jira-updater
│ │ │ │ │ │ └── v0.0.1
│ │ │ │ │ │ ├── Dockerfile
│ │ │ │ │ │ ├── Makefile
│ │ │ │ │ │ ├── jira-updater.yaml
│ │ │ │ │ │ └── main.go
│ │ │ │ │ ├── service_task.go
│ │ │ │ │ ├── sort.go
│ │ │ │ │ ├── sse.go
│ │ │ │ │ ├── types.go
│ │ │ │ │ ├── utils.go
│ │ │ │ │ ├── utils_test.go
│ │ │ │ │ ├── workflow.go
│ │ │ │ │ ├── workflow_suite_test.go
│ │ │ │ │ ├── workflow_task.go
│ │ │ │ │ ├── workflow_task_v4.go
│ │ │ │ │ ├── workflow_v4.go
│ │ │ │ │ └── workflow_view.go
│ │ │ │ └── testing
│ │ │ │ ├── handler
│ │ │ │ ├── it_report.go
│ │ │ │ ├── openapi.go
│ │ │ │ ├── quality_center.go
│ │ │ │ ├── router.go
│ │ │ │ ├── scanning.go
│ │ │ │ ├── test_detail.go
│ │ │ │ ├── test_stat.go
│ │ │ │ ├── test_task.go
│ │ │ │ ├── testing.go
│ │ │ │ └── workspace.go
│ │ │ │ └── service
│ │ │ │ ├── it_report.go
│ │ │ │ ├── openapi.go
│ │ │ │ ├── quality_center.go
│ │ │ │ ├── scanning.go
│ │ │ │ ├── test_detail.go
│ │ │ │ ├── test_stat.go
│ │ │ │ ├── test_task.go
│ │ │ │ ├── testing.go
│ │ │ │ ├── types.go
│ │ │ │ └── workspace.go
│ │ ├── doc.go
│ │ └── server
│ │ │ ├── rest
│ │ │ ├── router.go
│ │ │ └── server.go
│ │ │ └── server.go
│ ├── cron
│ │ ├── config
│ │ │ └── config.go
│ │ ├── core
│ │ │ └── service
│ │ │ │ ├── client
│ │ │ │ ├── caller.go
│ │ │ │ ├── client.go
│ │ │ │ ├── collie_client.go
│ │ │ │ ├── collie_pipeline.go
│ │ │ │ ├── cronjob.go
│ │ │ │ ├── env.go
│ │ │ │ ├── operation.go
│ │ │ │ ├── pipeline.go
│ │ │ │ ├── pm.go
│ │ │ │ ├── stat.go
│ │ │ │ └── workflow.go
│ │ │ │ ├── cronjob.go
│ │ │ │ ├── scheduler
│ │ │ │ ├── cronjob_handler.go
│ │ │ │ ├── schedule_env.go
│ │ │ │ ├── schedule_env_update.go
│ │ │ │ ├── schedule_pipeline.go
│ │ │ │ ├── schedule_pm.go
│ │ │ │ ├── schedule_workflow.go
│ │ │ │ ├── scheduler.go
│ │ │ │ └── shedule_env_resource_update.go
│ │ │ │ ├── service.go
│ │ │ │ └── types.go
│ │ └── server
│ │ │ └── server.go
│ ├── hubagent
│ │ ├── config
│ │ │ └── config.go
│ │ ├── core
│ │ │ └── service
│ │ │ │ └── client.go
│ │ └── server
│ │ │ ├── rest
│ │ │ ├── router.go
│ │ │ └── server.go
│ │ │ └── server.go
│ ├── hubserver
│ │ ├── config
│ │ │ ├── config.go
│ │ │ └── consts.go
│ │ ├── core
│ │ │ ├── handler
│ │ │ │ └── handler.go
│ │ │ ├── repository
│ │ │ │ ├── models
│ │ │ │ │ └── models.go
│ │ │ │ └── mongodb
│ │ │ │ │ └── k8scluster.go
│ │ │ └── service
│ │ │ │ ├── cluster.go
│ │ │ │ ├── init.go
│ │ │ │ ├── service.go
│ │ │ │ └── types.go
│ │ └── server
│ │ │ ├── rest
│ │ │ └── server.go
│ │ │ └── server.go
│ ├── jenkinsplugin
│ │ ├── config
│ │ │ └── config.go
│ │ ├── core
│ │ │ └── service
│ │ │ │ └── jenkins.go
│ │ └── executor
│ │ │ └── executor.go
│ ├── jobexecutor
│ │ ├── config
│ │ │ └── config.go
│ │ ├── core
│ │ │ └── service
│ │ │ │ ├── cmd
│ │ │ │ ├── cmd.go
│ │ │ │ ├── git.go
│ │ │ │ └── perforce.go
│ │ │ │ ├── configmap
│ │ │ │ └── configmap.go
│ │ │ │ ├── job.go
│ │ │ │ ├── meta
│ │ │ │ └── types.go
│ │ │ │ └── step
│ │ │ │ ├── step.go
│ │ │ │ ├── step_archive.go
│ │ │ │ ├── step_archive_html.go
│ │ │ │ ├── step_debug.go
│ │ │ │ ├── step_distribute_image.go
│ │ │ │ ├── step_docker_build.go
│ │ │ │ ├── step_download_archive.go
│ │ │ │ ├── step_git.go
│ │ │ │ ├── step_junit_report.go
│ │ │ │ ├── step_p4.go
│ │ │ │ ├── step_shell.go
│ │ │ │ ├── step_sonar_check.go
│ │ │ │ ├── step_sonar_get_metrics.go
│ │ │ │ ├── step_tar_archive.go
│ │ │ │ └── step_tool_install.go
│ │ └── executor
│ │ │ └── executor.go
│ ├── packager
│ │ ├── config
│ │ │ └── config.go
│ │ ├── core
│ │ │ └── service
│ │ │ │ ├── packager.go
│ │ │ │ └── service.go
│ │ └── executor
│ │ │ └── executor.go
│ ├── picket
│ │ ├── client
│ │ │ ├── aslan
│ │ │ │ ├── artifact.go
│ │ │ │ ├── client.go
│ │ │ │ ├── delivery.go
│ │ │ │ ├── kubeconfig.go
│ │ │ │ ├── project.go
│ │ │ │ ├── testing.go
│ │ │ │ └── workflow.go
│ │ │ ├── opa
│ │ │ │ ├── client.go
│ │ │ │ ├── evaluate.go
│ │ │ │ └── input.go
│ │ │ └── policy
│ │ │ │ ├── client.go
│ │ │ │ └── rolebinding.go
│ │ ├── config
│ │ │ └── consts.go
│ │ └── core
│ │ │ ├── evaluation
│ │ │ ├── handler
│ │ │ │ ├── evaluate.go
│ │ │ │ └── router.go
│ │ │ └── service
│ │ │ │ └── evaluate.go
│ │ │ ├── filter
│ │ │ ├── handler
│ │ │ │ ├── kubeconfig.go
│ │ │ │ ├── project.go
│ │ │ │ ├── rolebinding.go
│ │ │ │ ├── router.go
│ │ │ │ ├── testing.go
│ │ │ │ ├── users.go
│ │ │ │ └── workflow.go
│ │ │ └── service
│ │ │ │ ├── kubeconfig.go
│ │ │ │ ├── project.go
│ │ │ │ ├── rolebinding.go
│ │ │ │ ├── testing.go
│ │ │ │ ├── users.go
│ │ │ │ └── workflow.go
│ │ │ └── public
│ │ │ ├── handler
│ │ │ ├── public.go
│ │ │ └── router.go
│ │ │ └── service
│ │ │ └── public.go
│ ├── podexec
│ │ ├── config
│ │ │ └── config.go
│ │ └── core
│ │ │ └── service
│ │ │ ├── pod_server_ws.go
│ │ │ ├── types.go
│ │ │ ├── ws_terminal.go
│ │ │ └── ws_terminal_test.go
│ ├── predator
│ │ ├── config
│ │ │ └── config.go
│ │ ├── core
│ │ │ └── service
│ │ │ │ ├── docker.go
│ │ │ │ ├── predator.go
│ │ │ │ └── service.go
│ │ └── executor
│ │ │ └── executor.go
│ ├── reaper
│ │ ├── config
│ │ │ ├── config.go
│ │ │ └── const.go
│ │ ├── core
│ │ │ └── service
│ │ │ │ ├── archive
│ │ │ │ └── file_archive.go
│ │ │ │ ├── cmd
│ │ │ │ ├── cmd.go
│ │ │ │ ├── git.go
│ │ │ │ └── git_test.go
│ │ │ │ ├── meta
│ │ │ │ ├── const.go
│ │ │ │ ├── test_suite.go
│ │ │ │ ├── type_test.go
│ │ │ │ └── types.go
│ │ │ │ └── reaper
│ │ │ │ ├── archive.go
│ │ │ │ ├── artifact.go
│ │ │ │ ├── cachemanager.go
│ │ │ │ ├── cachemanager_test.go
│ │ │ │ ├── docker.go
│ │ │ │ ├── ginkgo.go
│ │ │ │ ├── ginkgo_test.go
│ │ │ │ ├── git.go
│ │ │ │ ├── git_test.go
│ │ │ │ ├── jmeter.go
│ │ │ │ ├── reaper.go
│ │ │ │ ├── reaper_test.go
│ │ │ │ ├── script.go
│ │ │ │ ├── utilis_test.go
│ │ │ │ └── utils.go
│ │ ├── executor
│ │ │ └── executor.go
│ │ └── internal
│ │ │ └── s3
│ │ │ └── s3.go
│ ├── systemconfig
│ │ ├── config
│ │ │ ├── config.go
│ │ │ └── consts.go
│ │ └── core
│ │ │ ├── codehost
│ │ │ ├── handler
│ │ │ │ ├── codehost.go
│ │ │ │ └── router.go
│ │ │ ├── internal
│ │ │ │ └── oauth
│ │ │ │ │ └── oauth.go
│ │ │ ├── repository
│ │ │ │ ├── models
│ │ │ │ │ └── codehost.go
│ │ │ │ └── mongodb
│ │ │ │ │ └── codehost.go
│ │ │ └── service
│ │ │ │ └── codehost.go
│ │ │ ├── connector
│ │ │ ├── handler
│ │ │ │ ├── connector.go
│ │ │ │ └── router.go
│ │ │ └── service
│ │ │ │ ├── connector.go
│ │ │ │ └── types.go
│ │ │ ├── email
│ │ │ ├── handler
│ │ │ │ ├── email.go
│ │ │ │ └── router.go
│ │ │ ├── repository
│ │ │ │ ├── models
│ │ │ │ │ ├── emailhost.go
│ │ │ │ │ └── emailservice.go
│ │ │ │ └── mongodb
│ │ │ │ │ ├── emailhost.go
│ │ │ │ │ └── emailservice.go
│ │ │ └── service
│ │ │ │ └── email.go
│ │ │ ├── features
│ │ │ ├── handler
│ │ │ │ ├── features.go
│ │ │ │ └── router.go
│ │ │ ├── repository
│ │ │ │ ├── models
│ │ │ │ │ └── feature.go
│ │ │ │ └── mongodb
│ │ │ │ │ └── feature.go
│ │ │ └── service
│ │ │ │ └── feature.go
│ │ │ └── repository
│ │ │ ├── models
│ │ │ └── connector.go
│ │ │ └── orm
│ │ │ └── connector.go
│ ├── user
│ │ ├── config
│ │ │ ├── config.go
│ │ │ └── consts.go
│ │ ├── core
│ │ │ ├── handler
│ │ │ │ ├── healthz.go
│ │ │ │ ├── login
│ │ │ │ │ ├── local.go
│ │ │ │ │ └── third_party.go
│ │ │ │ ├── permission
│ │ │ │ │ ├── internal.go
│ │ │ │ │ ├── permission.go
│ │ │ │ │ ├── resource.go
│ │ │ │ │ ├── role.go
│ │ │ │ │ └── role_binding.go
│ │ │ │ ├── router.go
│ │ │ │ └── user
│ │ │ │ │ ├── authz.go
│ │ │ │ │ ├── user.go
│ │ │ │ │ └── user_group.go
│ │ │ ├── init
│ │ │ │ ├── action_initialization.sql
│ │ │ │ ├── dex_database.sql
│ │ │ │ ├── dm_action_initialization.sql
│ │ │ │ ├── dm_mysql.sql
│ │ │ │ ├── dm_role_template_initialization.sql
│ │ │ │ ├── mysql.sql
│ │ │ │ └── role_template_initialization.sql
│ │ │ ├── repository
│ │ │ │ ├── instance.go
│ │ │ │ ├── models
│ │ │ │ │ ├── action.go
│ │ │ │ │ ├── base.go
│ │ │ │ │ ├── collaboration_instance.go
│ │ │ │ │ ├── collaboration_mode.go
│ │ │ │ │ ├── connector.go
│ │ │ │ │ ├── group_binding.go
│ │ │ │ │ ├── group_role_binding.go
│ │ │ │ │ ├── project.go
│ │ │ │ │ ├── role.go
│ │ │ │ │ ├── role_action_binding.go
│ │ │ │ │ ├── role_binding.go
│ │ │ │ │ ├── role_template.go
│ │ │ │ │ ├── role_template_action_binding.go
│ │ │ │ │ ├── role_template_binding.go
│ │ │ │ │ ├── user.go
│ │ │ │ │ ├── user_group.go
│ │ │ │ │ ├── user_login.go
│ │ │ │ │ └── user_setting.go
│ │ │ │ ├── mongodb
│ │ │ │ │ ├── collaboration_instance.go
│ │ │ │ │ ├── collaboration_mode.go
│ │ │ │ │ ├── project.go
│ │ │ │ │ ├── role.go
│ │ │ │ │ ├── role_binding.go
│ │ │ │ │ └── user_setting.go
│ │ │ │ └── orm
│ │ │ │ │ ├── action.go
│ │ │ │ │ ├── connector.go
│ │ │ │ │ ├── group_binding.go
│ │ │ │ │ ├── group_role_binding.go
│ │ │ │ │ ├── role.go
│ │ │ │ │ ├── role_action_binding.go
│ │ │ │ │ ├── role_binding.go
│ │ │ │ │ ├── role_template.go
│ │ │ │ │ ├── role_template_action_binding.go
│ │ │ │ │ ├── role_template_binding.go
│ │ │ │ │ ├── user.go
│ │ │ │ │ ├── user_group.go
│ │ │ │ │ └── user_login.go
│ │ │ ├── service.go
│ │ │ └── service
│ │ │ │ ├── common
│ │ │ │ └── user_group.go
│ │ │ │ ├── login
│ │ │ │ ├── local.go
│ │ │ │ ├── third_party.go
│ │ │ │ └── token.go
│ │ │ │ └── permission
│ │ │ │ ├── authn.go
│ │ │ │ ├── authz.go
│ │ │ │ ├── internal.go
│ │ │ │ ├── permission.go
│ │ │ │ ├── resource.go
│ │ │ │ ├── retrieve.html
│ │ │ │ ├── role.go
│ │ │ │ ├── role_binding.go
│ │ │ │ ├── role_template.go
│ │ │ │ ├── types.go
│ │ │ │ ├── user.go
│ │ │ │ └── user_group.go
│ │ └── server
│ │ │ ├── grpc
│ │ │ └── server.go
│ │ │ ├── rest
│ │ │ ├── router.go
│ │ │ └── server.go
│ │ │ └── server.go
│ └── zgctl
│ │ ├── handler.go
│ │ ├── interface.go
│ │ ├── router.go
│ │ ├── template.go
│ │ ├── utils.go
│ │ └── zgctl.go
├── middleware
│ └── gin
│ │ ├── audit_log.go
│ │ ├── collaboration.go
│ │ ├── license.go
│ │ ├── request_id.go
│ │ ├── request_log.go
│ │ ├── request_metrics.go
│ │ └── response.go
├── setting
│ ├── consts.go
│ ├── regexp.go
│ └── types.go
├── shared
│ ├── client
│ │ ├── aslan
│ │ │ ├── client.go
│ │ │ ├── environment.go
│ │ │ ├── healthz.go
│ │ │ ├── login.go
│ │ │ ├── logs.go
│ │ │ ├── multicluster.go
│ │ │ ├── registries.go
│ │ │ ├── rsa_key.go
│ │ │ ├── system.go
│ │ │ ├── testing.go
│ │ │ ├── types.go
│ │ │ └── workflow.go
│ │ ├── label
│ │ │ ├── client.go
│ │ │ ├── label.go
│ │ │ └── label_binding.go
│ │ ├── plutusvendor
│ │ │ ├── client.go
│ │ │ └── plutusvendor.go
│ │ ├── systemconfig
│ │ │ ├── client.go
│ │ │ ├── codehost.go
│ │ │ ├── connector.go
│ │ │ └── email.go
│ │ └── user
│ │ │ ├── client.go
│ │ │ ├── project.go
│ │ │ ├── role.go
│ │ │ ├── user.go
│ │ │ ├── user_auth.go
│ │ │ └── user_group.go
│ ├── config
│ │ ├── client.go
│ │ └── features.go
│ ├── handler
│ │ ├── base.go
│ │ ├── handler_suite_test.go
│ │ ├── options_test.go
│ │ ├── repository
│ │ │ └── models
│ │ │ │ └── user.go
│ │ └── sse.go
│ └── kube
│ │ ├── client
│ │ └── version.go
│ │ ├── resource
│ │ ├── configmap.go
│ │ ├── cron_job.go
│ │ ├── event.go
│ │ ├── ingress.go
│ │ ├── job.go
│ │ ├── namespace.go
│ │ ├── node.go
│ │ ├── pod.go
│ │ ├── service.go
│ │ └── workload.go
│ │ └── wrapper
│ │ ├── apireference.go
│ │ ├── cloneset.go
│ │ ├── configmap.go
│ │ ├── cronjob.go
│ │ ├── daemonset.go
│ │ ├── deployment.go
│ │ ├── event.go
│ │ ├── ingress.go
│ │ ├── job.go
│ │ ├── namespace.go
│ │ ├── pod.go
│ │ ├── service.go
│ │ ├── statefulset.go
│ │ └── utils.go
├── tool
│ ├── analysis
│ │ ├── analysis.go
│ │ ├── analysis_test.go
│ │ ├── cronjob.go
│ │ ├── cronjob_test.go
│ │ ├── deployment.go
│ │ ├── deployment_test.go
│ │ ├── events.go
│ │ ├── hpa.go
│ │ ├── hpaAnalyzer_test.go
│ │ ├── ianalyzer.go
│ │ ├── ingress.go
│ │ ├── ingress_test.go
│ │ ├── kubernetes.go
│ │ ├── netpol.go
│ │ ├── netpol_test.go
│ │ ├── node.go
│ │ ├── node_test.go
│ │ ├── output.go
│ │ ├── pdb.go
│ │ ├── pod.go
│ │ ├── pod_test.go
│ │ ├── pvc.go
│ │ ├── rs.go
│ │ ├── service.go
│ │ ├── service_test.go
│ │ ├── statefulset.go
│ │ ├── statefulset_test.go
│ │ └── utils.go
│ ├── apollo
│ │ ├── apollo.go
│ │ └── client.go
│ ├── blueking
│ │ ├── cc.go
│ │ ├── client.go
│ │ ├── jobv3.go
│ │ ├── types.go
│ │ └── utils.go
│ ├── cache
│ │ ├── icache.go
│ │ ├── lock.go
│ │ ├── mem_cache.go
│ │ ├── redis_cache.go
│ │ └── redis_lock_test.go
│ ├── clientmanager
│ │ └── kube.go
│ ├── crypto
│ │ ├── aes.go
│ │ ├── aes_test.go
│ │ └── sha1.go
│ ├── dingtalk
│ │ ├── approval.go
│ │ ├── cache.go
│ │ ├── client.go
│ │ ├── contact.go
│ │ ├── error.go
│ │ ├── ratelimit.go
│ │ └── validate.go
│ ├── dockerhost
│ │ └── docker_host.go
│ ├── errors
│ │ ├── const.go
│ │ ├── custom_errors.go
│ │ ├── errors.go
│ │ ├── errors_test.go
│ │ └── http_errors.go
│ ├── eventbus
│ │ └── redis
│ │ │ └── client.go
│ ├── gerrit
│ │ ├── client.go
│ │ ├── client_test.go
│ │ └── http_client.go
│ ├── git
│ │ ├── config.go
│ │ ├── github
│ │ │ ├── apps.go
│ │ │ ├── checks.go
│ │ │ ├── client.go
│ │ │ ├── git.go
│ │ │ ├── organizations.go
│ │ │ ├── pull_requests.go
│ │ │ ├── repositories.go
│ │ │ └── users.go
│ │ ├── gitlab
│ │ │ ├── branch.go
│ │ │ ├── client.go
│ │ │ ├── commit.go
│ │ │ ├── group_project.go
│ │ │ ├── merge_request.go
│ │ │ ├── namespace.go
│ │ │ ├── project.go
│ │ │ ├── repo.go
│ │ │ ├── tag.go
│ │ │ └── token.go
│ │ └── hook.go
│ ├── gitee
│ │ ├── branch.go
│ │ ├── client.go
│ │ ├── comment.go
│ │ ├── event_parsing.go
│ │ ├── organizations.go
│ │ ├── pull_requests.go
│ │ ├── repositories.go
│ │ ├── tag.go
│ │ └── users.go
│ ├── gorm
│ │ ├── client.go
│ │ ├── opendb.go
│ │ └── opendb_darwin.go
│ ├── grafana
│ │ ├── client.go
│ │ ├── client_test.go
│ │ └── grafana.go
│ ├── guanceyun
│ │ ├── client.go
│ │ ├── event.go
│ │ └── monitor.go
│ ├── helmclient
│ │ └── helmclient.go
│ ├── httpclient
│ │ ├── client.go
│ │ ├── client_options.go
│ │ ├── errors.go
│ │ └── request_options.go
│ ├── jenkins
│ │ ├── client.go
│ │ └── job.go
│ ├── jira
│ │ ├── board.go
│ │ ├── client.go
│ │ ├── issue.go
│ │ ├── platform.go
│ │ ├── project.go
│ │ ├── sprint.go
│ │ └── types.go
│ ├── klock
│ │ ├── error.go
│ │ └── klock.go
│ ├── kodo
│ │ ├── config.go
│ │ ├── form_upload.go
│ │ ├── qbox
│ │ │ └── qbox_auth.go
│ │ ├── token.go
│ │ ├── upload_client.go
│ │ └── zone.go
│ ├── kube
│ │ ├── client
│ │ │ └── cluster.go
│ │ ├── containerlog
│ │ │ └── log.go
│ │ ├── getter
│ │ │ ├── base.go
│ │ │ ├── configmap.go
│ │ │ ├── cronjob.go
│ │ │ ├── daemonset.go
│ │ │ ├── deployment.go
│ │ │ ├── event.go
│ │ │ ├── ingress.go
│ │ │ ├── job.go
│ │ │ ├── namespace.go
│ │ │ ├── node.go
│ │ │ ├── pod.go
│ │ │ ├── pvc.go
│ │ │ ├── replicaset.go
│ │ │ ├── role.go
│ │ │ ├── secrets.go
│ │ │ ├── service.go
│ │ │ └── statefulset.go
│ │ ├── label
│ │ │ └── label.go
│ │ ├── multicluster
│ │ │ ├── hub_api.go
│ │ │ └── service.go
│ │ ├── patcher
│ │ │ └── patcher.go
│ │ ├── podexec
│ │ │ └── exec.go
│ │ ├── serializer
│ │ │ ├── decoder.go
│ │ │ ├── decoder_test.go
│ │ │ └── serializer_suite_test.go
│ │ ├── updater
│ │ │ ├── base.go
│ │ │ ├── cloneset.go
│ │ │ ├── clusterrole.go
│ │ │ ├── configmap.go
│ │ │ ├── cronjob.go
│ │ │ ├── deployment.go
│ │ │ ├── ingress.go
│ │ │ ├── job.go
│ │ │ ├── namespace.go
│ │ │ ├── pod.go
│ │ │ ├── pv.go
│ │ │ ├── pvc.go
│ │ │ ├── replicaset.go
│ │ │ ├── role.go
│ │ │ ├── rolebinding.go
│ │ │ ├── secret.go
│ │ │ ├── service.go
│ │ │ ├── serviceaccount.go
│ │ │ ├── statefulset.go
│ │ │ └── unstructured.go
│ │ ├── util
│ │ │ ├── apply.go
│ │ │ ├── meta.go
│ │ │ ├── time.go
│ │ │ └── utils.go
│ │ └── watcher
│ │ │ ├── pod.go
│ │ │ └── wait.go
│ ├── lark
│ │ ├── approval.go
│ │ ├── chats.go
│ │ ├── client.go
│ │ ├── const.go
│ │ ├── contact.go
│ │ ├── im.go
│ │ ├── model.go
│ │ ├── tool.go
│ │ └── validate.go
│ ├── llm
│ │ ├── illm.go
│ │ ├── openai.go
│ │ └── options.go
│ ├── log
│ │ └── log.go
│ ├── mail
│ │ └── mail.go
│ ├── math
│ │ └── math.go
│ ├── meego
│ │ ├── client.go
│ │ ├── comment.go
│ │ ├── consts.go
│ │ ├── project.go
│ │ ├── types.go
│ │ └── work_item.go
│ ├── metrics
│ │ └── prometheus.go
│ ├── mongo
│ │ ├── client.go
│ │ ├── mongo_suite_test.go
│ │ ├── options.go
│ │ └── options_test.go
│ ├── nacos
│ │ └── client.go
│ ├── opa
│ │ └── bundle.go
│ ├── openapi
│ │ └── conversion.go
│ ├── registries
│ │ ├── dind.go
│ │ └── types.go
│ ├── remotedialer
│ │ ├── client.go
│ │ ├── client_dialer.go
│ │ ├── connection.go
│ │ ├── dialer.go
│ │ ├── message.go
│ │ ├── peer.go
│ │ ├── readbuffer.go
│ │ ├── server.go
│ │ ├── session.go
│ │ ├── session_manager.go
│ │ ├── types.go
│ │ └── wsconn.go
│ ├── rsa
│ │ ├── rsa.go
│ │ ├── rsa_test.go
│ │ ├── transport.go
│ │ └── verify.go
│ ├── s3
│ │ ├── client.go
│ │ └── client_test.go
│ ├── sonar
│ │ └── sonar.go
│ ├── ssh
│ │ └── ssh.go
│ ├── tar
│ │ └── tar.go
│ ├── workflow
│ │ └── manual_error_handling.go
│ ├── workwx
│ │ ├── client.go
│ │ ├── department.go
│ │ ├── encoding.go
│ │ ├── oa.go
│ │ ├── types.go
│ │ ├── user.go
│ │ └── validate.go
│ └── wsconn
│ │ └── wsconn.go
├── types
│ ├── authz.go
│ ├── build.go
│ ├── cache.go
│ ├── cron.go
│ ├── dto
│ │ └── workflowtask.go
│ ├── env.go
│ ├── file.go
│ ├── git.go
│ ├── ide.go
│ ├── job.go
│ ├── job
│ │ └── job.go
│ ├── labels.go
│ ├── nacos.go
│ ├── object_storage.go
│ ├── openapi.go
│ ├── policy.go
│ ├── private_key.go
│ ├── reaper.go
│ ├── repo.go
│ ├── role.go
│ ├── role_template.go
│ ├── share_storage.go
│ ├── step
│ │ ├── common.go
│ │ ├── step_archive.go
│ │ ├── step_archive_html.go
│ │ ├── step_batch_file.go
│ │ ├── step_distribute_image.go
│ │ ├── step_docker_build.go
│ │ ├── step_download_archive.go
│ │ ├── step_git.go
│ │ ├── step_junit_report.go
│ │ ├── step_p4.go
│ │ ├── step_powershell.go
│ │ ├── step_shell.go
│ │ ├── step_sonar_check.go
│ │ ├── step_sonar_get_metrics.go
│ │ ├── step_tar_archive.go
│ │ └── step_tool_install.go
│ ├── system_settings.go
│ ├── user.go
│ ├── user_group.go
│ ├── workflow.go
│ └── workload.go
└── util
│ ├── array.go
│ ├── boolptr
│ └── boolptr.go
│ ├── clear.go
│ ├── converter
│ ├── converter_suite_test.go
│ ├── flaten_test.go
│ ├── flatten.go
│ └── strcase.go
│ ├── deep_copy.go
│ ├── file.go
│ ├── fs
│ ├── file.go
│ ├── file_test.go
│ ├── fs.go
│ ├── fs_suite_test.go
│ ├── hash.go
│ └── root.go
│ ├── ginzap
│ └── context.go
│ ├── go.go
│ ├── helm.go
│ ├── json.go
│ ├── json
│ └── strvals.go
│ ├── key_val.go
│ ├── kubernetes.go
│ ├── net.go
│ ├── pointer.go
│ ├── rand
│ └── rand.go
│ ├── random.go
│ ├── request.go
│ ├── sign.go
│ ├── strings.go
│ ├── testing
│ └── init.go
│ ├── time.go
│ ├── url.go
│ ├── validator
│ ├── image.go
│ └── image_test.go
│ ├── variables.go
│ ├── yaml.go
│ └── yaml
│ ├── compare.go
│ ├── compare_test.go
│ ├── gotemplate.go
│ ├── gotemplate_test.go
│ ├── merge.go
│ ├── merge_test.go
│ ├── path_search.go
│ ├── path_search_test.go
│ └── yaml_suite_test.go
├── resource-server-nginx.conf
├── ut.file
└── zadig-ci.yaml
/.dockerignore:
--------------------------------------------------------------------------------
1 | /*
2 | !/cmd
3 | !/pkg
4 | !/go.mod
5 | !/go.sum
6 | !/resource-server-nginx.conf
7 | !/version
8 | !/docker
9 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/enhancement.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Enhancement
3 | about: Suggest enhancements to existing features
4 | title: "[enhancement]"
5 | labels: enhancement
6 | assignees: lilianzhu
7 |
8 | ---
9 |
10 | **Is your enhancement proposal related to a problem? Please describe.**
11 | [A clear and concise description of what the problem is.]
12 |
13 | **Describe the solution you'd like**
14 | [A clear and concise description of what you want to happen.]
15 |
16 |
17 | **Describe alternatives you've considered**
18 | [A clear and concise description of any alternative solutions or features you've considered.]
19 |
20 | **Additional context**
21 | [Add any other context or graphics about the feature request here.]
22 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: "[feature]"
5 | labels: feature request
6 | assignees: lilianzhu
7 |
8 | ---
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | [A clear and concise description of what the problem is. Ex. I'm always frustrated when ... ]
12 |
13 |
14 | **Describe the feature you'd like**
15 | [A clear and concise description of what you want to happen.]
16 |
17 |
18 | **Describe alternatives you've considered**
19 | [A clear and concise description of any alternative solutions or features you've considered.]
20 |
21 |
22 | **Additional context**
23 | [Add any other context or screenshots about the feature request here.]
24 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/question.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Ask a Question
3 | about: I want to ask a question.
4 | title: "[Question]"
5 | labels: question
6 | assignees: jamsman94
7 |
8 | ---
9 |
10 | ## General Question
11 |
12 |
20 |
--------------------------------------------------------------------------------
/.github/labeler.yml:
--------------------------------------------------------------------------------
1 | # Add 'service' label to any change to microservice files within the source dir
2 | service/aslan:
3 | - pkg/microservice/aslan/**/*
4 | - pkg/microservice/picket/**/*
5 | - pkg/microservice/user/**/*
6 | - pkg/microservice/policy/**/*
7 | - pkg/microservice/systemconfig/**/*
8 |
9 | service/cron:
10 | - pkg/microservice/cron/**/*
11 |
12 | service/predator:
13 | - pkg/microservice/predator/**/*
14 |
15 | service/reaper:
16 | - pkg/microservice/reaper/**/*
17 | - pkg/microservice/jobexecutor/**/*
18 |
19 | service/warpdrive:
20 | - pkg/microservice/warpdrive/**/*
21 |
22 | service/hubserver:
23 | - pkg/microservice/hubserver/**/*
24 |
25 | service/hubagent:
26 | - pkg/microservice/hubagent/**/*
27 |
28 | service/upgradeassistant:
29 | - pkg/microservice/upgradeassistant/**/*
30 |
31 | common:
32 | - pkg/config/**/*
33 | - pkg/middleware/**/*
34 | - pkg/setting/**/*
35 | - pkg/shared/**/*
36 | - pkg/tool/**/*
37 | - pkg/util/**/*
38 |
--------------------------------------------------------------------------------
/.github/pull_request_template.md:
--------------------------------------------------------------------------------
1 | ### What this PR does / Why we need it:
2 |
3 |
4 | ### What is changed and how it works?
5 |
6 |
7 | ### Does this PR introduce a user-facing change?
8 |
9 | - [ ] API change
10 | - [ ] database schema change
11 | - [ ] upgrade assistant change
12 | - [ ] change in non-functional attributes such as efficiency or availability
13 | - [ ] fix of a previous issue
14 |
--------------------------------------------------------------------------------
/.github/workflows/labeler.yml:
--------------------------------------------------------------------------------
1 | name: "Pull Request Labeler"
2 | on:
3 | - pull_request_target
4 |
5 | jobs:
6 | triage:
7 | runs-on: ubuntu-latest
8 | steps:
9 | - uses: actions/labeler@v3
10 | with:
11 | repo-token: "${{ secrets.GITHUB_TOKEN }}"
12 |
--------------------------------------------------------------------------------
/System-Architecture-Overview-zh-CN.md:
--------------------------------------------------------------------------------
1 | # Zadig 系统架构简介
2 |
3 | ## 系统架构图
4 |
5 | 
6 |
7 | ## 核心组件介绍
8 | 用户入口:
9 | - zadig-portal:Zadig 前端组件
10 | - Zadig Toolkit:vscode 开发者插件
11 |
12 | API 网关:
13 | - [Gloo Edge](https://github.com/solo-io/gloo):Zadig 的 API 网关组件
14 | - Zadig User Service:用户认证和授权组件
15 | - [Dex](https://github.com/dexidp/dex):Zadig 的身份认证服务,用于连接其他第三方认证系统,比如 AD,LDAP,OAuth2,GitHub,...
16 |
17 | Zadig 核心业务:
18 | - Aslan:项目,环境,服务,工作流,构建配置,系统配置等系统功能
19 | - Workflow Runner:
20 | - job-executor:用于在 K8s Pod 上执行自定义工作流任务的组件
21 | - Job-agent: 用于在虚拟机上执行自定义工作流任务的组件
22 | - Cron:定时任务,包括环境的回收,K8s 资源的清理等
23 | - NSQ:消息队列(第三方组件)
24 |
25 | 数据平面:
26 | - MongoDB:业务数据数据库
27 | - MySQL:存储 dex 配置、用户信息的数据库
28 |
29 | K8s 集群:
30 | - Zadig 业务运行在各种云厂商的标准 K8s 集群
31 |
--------------------------------------------------------------------------------
/Zadig-Business-Architecture-zh.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koderover/zadig/2995eacaea155ad93f66a78a072a036ecba503a6/Zadig-Business-Architecture-zh.jpg
--------------------------------------------------------------------------------
/Zadig-Business-Architecture.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koderover/zadig/2995eacaea155ad93f66a78a072a036ecba503a6/Zadig-Business-Architecture.jpg
--------------------------------------------------------------------------------
/Zadig-System-Architecture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koderover/zadig/2995eacaea155ad93f66a78a072a036ecba503a6/Zadig-System-Architecture.png
--------------------------------------------------------------------------------
/action.yml:
--------------------------------------------------------------------------------
1 | name: 'Labeler'
2 | description: 'Automatically label new pull requests based on the paths of files being changed'
3 | author: 'GitHub'
4 | inputs:
5 | repo-token:
6 | description: 'The GITHUB_TOKEN secret'
7 | configuration-path:
8 | description: 'The path for the label configurations'
9 | default: '.github/labeler.yml'
10 | required: false
11 | sync-labels:
12 | description: 'Whether or not to remove labels when matching files are reverted'
13 | default: false
14 | required: false
15 |
16 | runs:
17 | using: 'node12'
18 | main: 'dist/index.js'
19 |
--------------------------------------------------------------------------------
/cmd/init/main.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2021 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package main
18 |
19 | import (
20 | "github.com/koderover/zadig/v2/pkg/cli/initconfig/cmd"
21 | )
22 |
23 | func main() {
24 | cmd.Execute()
25 | }
26 |
--------------------------------------------------------------------------------
/cmd/jenkins-plugin/main.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2021 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package main
18 |
19 | import (
20 | "log"
21 |
22 | "github.com/koderover/zadig/v2/pkg/microservice/jenkinsplugin/executor"
23 | )
24 |
25 | func main() {
26 | if err := executor.Execute(); err != nil {
27 | log.Fatalf("Failed to run jenkins plugin, the error is: %+v", err)
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/cmd/packager-plugin/main.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2021 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package main
18 |
19 | import (
20 | "log"
21 |
22 | "github.com/koderover/zadig/v2/pkg/microservice/packager/executor"
23 | )
24 |
25 | func main() {
26 | if err := executor.Execute(); err != nil {
27 | log.Fatalf("Failed to run packager, the error is: %+v", err)
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/cmd/predator-plugin/main.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2021 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package main
18 |
19 | import (
20 | "log"
21 |
22 | "github.com/koderover/zadig/v2/pkg/microservice/predator/executor"
23 | )
24 |
25 | func main() {
26 | if err := executor.Execute(); err != nil {
27 | log.Fatalf("Failed to run predator, the error is: %+v", err)
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/cmd/reaper/main.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2021 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package main
18 |
19 | import (
20 | "log"
21 |
22 | "github.com/koderover/zadig/v2/pkg/microservice/reaper/executor"
23 | )
24 |
25 | func main() {
26 | if err := executor.Execute(); err != nil {
27 | log.Fatalf("Failed to run reaper, the error is: %+v", err)
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/cmd/ua/main.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2021 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package main
18 |
19 | import (
20 | "log"
21 |
22 | "github.com/koderover/zadig/v2/pkg/cli/upgradeassistant/executor"
23 | )
24 |
25 | func main() {
26 | if err := executor.Execute(); err != nil {
27 | log.Fatalf("Failed to run upgrade asssistant, error: %s", err)
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/cmd/zgctl/main.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2022 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package main
18 |
19 | import (
20 | "github.com/koderover/zadig/v2/cmd/zgctl/cmd"
21 | )
22 |
23 | func main() {
24 | cmd.Execute()
25 | }
26 |
--------------------------------------------------------------------------------
/debug/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | export CGO_ENABLED=0 GOOS=linux GOARCH=amd64
3 | export GOPROXY=https://goproxy.cn,direct
4 |
5 | # 检查是否提供了服务名参数
6 | if [ -z "$1" ]; then
7 | echo "请提供服务名参数"
8 | exit 1
9 | fi
10 |
11 | SERVICE_NAME=$1
12 |
13 | cd "$(dirname "$0")"
14 | cd ..
15 | go mod download
16 | go build -v -gcflags="all=-trimpath=$PWD -N -l" -asmflags "all=-trimpath=$PWD" -o ./debug/$SERVICE_NAME ./cmd/$SERVICE_NAME/main.go
17 | # docker build --platform linux/amd64 -t koderover.tencentcloudcr.com/test/golang-debug:latest . -f ./debug/golang-debug.Dockerfile --push
--------------------------------------------------------------------------------
/debug/debug.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # 检查是否提供了服务名参数
3 | if [ -z "$1" ]; then
4 | echo "请提供服务名参数"
5 | exit 1
6 | fi
7 |
8 | SERVICE_NAME=$1
9 | cd "$(dirname "$0")"
10 | # ./build.sh $SERVICE_NAME
11 | dlv --headless --log --listen :9009 --api-version 2 --accept-multiclient --wd=$(pwd)/.. exec ./$SERVICE_NAME &
12 |
13 | # 获取Delve进程的PID
14 | DLV_PID=$!
15 |
16 | # 捕获Ctrl-C信号并终止Delve进程
17 | trap "pkill -9 dlv $SERVICE_NAME"
18 |
19 | # 等待Delve进程结束
20 | wait $DLV_PID
--------------------------------------------------------------------------------
/debug/run.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # 检查是否提供了服务名参数
3 | if [ -z "$1" ]; then
4 | echo "请提供服务名参数"
5 | exit 1
6 | fi
7 |
8 | SERVICE_NAME=$1
9 | cd "$(dirname "$0")"
10 | # ./build.sh $SERVICE_NAME
11 | ./$SERVICE_NAME
--------------------------------------------------------------------------------
/docker/cron.Dockerfile:
--------------------------------------------------------------------------------
1 | FROM golang:1.24.1-alpine as build
2 |
3 | WORKDIR /app
4 |
5 | ENV CGO_ENABLED=0 GOOS=linux
6 | ENV GOPROXY=https://goproxy.cn,direct
7 | ENV GOCACHE=/gocache
8 |
9 | COPY go.mod go.sum ./
10 | COPY cmd cmd
11 | COPY pkg pkg
12 |
13 | RUN go mod download
14 |
15 | RUN --mount=type=cache,id=gobuild,target=/gocache \
16 | go build -v -o /cron ./cmd/cron/main.go
17 |
18 | FROM alpine/git:v2.30.2
19 |
20 | # https://wiki.alpinelinux.org/wiki/Setting_the_timezone
21 | RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
22 | apk add tzdata && \
23 | cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
24 | echo Asia/Shanghai > /etc/timezone && \
25 | apk del tzdata
26 |
27 | WORKDIR /app
28 |
29 | COPY --from=build /cron .
30 |
31 | ENTRYPOINT ["/app/cron"]
32 |
--------------------------------------------------------------------------------
/docker/executor.Dockerfile:
--------------------------------------------------------------------------------
1 | FROM golang:1.24.1-alpine as build
2 |
3 | WORKDIR /app
4 |
5 | ENV CGO_ENABLED=0 GOOS=linux
6 | ENV GOPROXY=https://goproxy.cn,direct
7 | ENV GOCACHE=/gocache
8 |
9 | COPY go.mod go.sum ./
10 | COPY cmd cmd
11 | COPY pkg pkg
12 |
13 | RUN go mod download
14 |
15 | RUN --mount=type=cache,id=gobuild,target=/gocache \
16 | go build -v -o /reaper ./cmd/reaper/main.go
17 | RUN --mount=type=cache,id=gobuild,target=/gocache \
18 | go build -v -o /jobexecutor ./cmd/jobexecutor/main.go
19 |
20 | FROM alpine:3.18.0
21 |
22 | WORKDIR /app
23 |
24 | # https://wiki.alpinelinux.org/wiki/Setting_the_timezone
25 | RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
26 | apk add tzdata && \
27 | cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
28 | echo Asia/Shanghai > /etc/timezone && \
29 | apk del tzdata
30 |
31 | COPY --from=build /reaper .
32 | COPY --from=build /jobexecutor .
33 |
--------------------------------------------------------------------------------
/docker/hub-agent.Dockerfile:
--------------------------------------------------------------------------------
1 | FROM golang:1.24.1-alpine as build
2 |
3 | WORKDIR /app
4 |
5 | ENV CGO_ENABLED=0 GOOS=linux
6 | ENV GOPROXY=https://goproxy.cn,direct
7 | ENV GOCACHE=/gocache
8 |
9 | COPY go.mod go.sum ./
10 | COPY cmd cmd
11 | COPY pkg pkg
12 |
13 | RUN go mod download
14 |
15 | RUN --mount=type=cache,id=gobuild,target=/gocache \
16 | go build -v -o /hub-agent ./cmd/hub-agent/main.go
17 |
18 | FROM alpine/git:v2.30.2
19 |
20 | # https://wiki.alpinelinux.org/wiki/Setting_the_timezone
21 | RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
22 | apk add tzdata && \
23 | cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
24 | echo Asia/Shanghai > /etc/timezone && \
25 | apk del tzdata
26 |
27 | WORKDIR /app
28 |
29 | COPY --from=build /hub-agent .
30 |
31 | ENTRYPOINT ["/app/hub-agent"]
32 |
--------------------------------------------------------------------------------
/docker/hub-server.Dockerfile:
--------------------------------------------------------------------------------
1 | FROM golang:1.24.1-alpine as build
2 |
3 | WORKDIR /app
4 |
5 | ENV CGO_ENABLED=0 GOOS=linux
6 | ENV GOPROXY=https://goproxy.cn,direct
7 | ENV GOCACHE=/gocache
8 |
9 | COPY go.mod go.sum ./
10 | COPY cmd cmd
11 | COPY pkg pkg
12 |
13 | RUN go mod download
14 |
15 | RUN --mount=type=cache,id=gobuild,target=/gocache \
16 | go build -v -o /hub-server ./cmd/hub-server/main.go
17 |
18 | FROM alpine:3.13.5
19 |
20 | # https://wiki.alpinelinux.org/wiki/Setting_the_timezone
21 | RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
22 | apk add tzdata && \
23 | cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
24 | echo Asia/Shanghai > /etc/timezone && \
25 | apk del tzdata
26 |
27 | WORKDIR /app
28 |
29 | COPY --from=build /hub-server .
30 |
31 | ENTRYPOINT ["/app/hub-server"]
32 |
--------------------------------------------------------------------------------
/docker/init.Dockerfile:
--------------------------------------------------------------------------------
1 | FROM golang:1.24.1-alpine as build
2 |
3 | WORKDIR /app
4 |
5 | ENV CGO_ENABLED=0 GOOS=linux
6 | ENV GOPROXY=https://goproxy.cn,direct
7 | ENV GOCACHE=/gocache
8 |
9 | COPY go.mod go.sum ./
10 | COPY cmd cmd
11 | COPY pkg pkg
12 |
13 | RUN go mod download
14 |
15 | RUN --mount=type=cache,id=gobuild,target=/gocache \
16 | go build -v -o /init ./cmd/init/main.go
17 |
18 | FROM alpine:3.13.5
19 |
20 | # https://wiki.alpinelinux.org/wiki/Setting_the_timezone
21 | RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
22 | apk add tzdata && \
23 | cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
24 | echo Asia/Shanghai > /etc/timezone && \
25 | apk del tzdata
26 |
27 | WORKDIR /app
28 |
29 | COPY --from=build /init .
30 |
31 | ENTRYPOINT ["/app/init"]
32 |
--------------------------------------------------------------------------------
/docker/jenkins-plugin.Dockerfile:
--------------------------------------------------------------------------------
1 | FROM golang:1.24.1-alpine as build
2 |
3 | WORKDIR /app
4 |
5 | ENV CGO_ENABLED=0 GOOS=linux
6 | ENV GOPROXY=https://goproxy.cn,direct
7 | ENV GOCACHE=/gocache
8 |
9 | COPY go.mod go.sum ./
10 | COPY cmd cmd
11 | COPY pkg pkg
12 |
13 | RUN go mod download
14 |
15 | RUN --mount=type=cache,id=gobuild,target=/gocache \
16 | go build -v -o /jenkins-plugin ./cmd/jenkins-plugin/main.go
17 |
18 | FROM alpine:3.13.5
19 |
20 | # https://wiki.alpinelinux.org/wiki/Setting_the_timezone
21 | RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
22 | apk add tzdata && \
23 | cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
24 | echo Asia/Shanghai > /etc/timezone && \
25 | apk del tzdata
26 |
27 |
28 | WORKDIR /app
29 |
30 | COPY --from=build /jenkins-plugin .
31 |
32 | ENTRYPOINT ["/app/jenkins-plugin"]
33 |
--------------------------------------------------------------------------------
/docker/packager-plugin.Dockerfile:
--------------------------------------------------------------------------------
1 | FROM golang:1.24.1-alpine as build
2 |
3 | WORKDIR /app
4 |
5 | ENV CGO_ENABLED=0 GOOS=linux
6 | ENV GOPROXY=https://goproxy.cn,direct
7 | ENV GOCACHE=/gocache
8 |
9 | COPY go.mod go.sum ./
10 | COPY cmd cmd
11 | COPY pkg pkg
12 |
13 | RUN go mod download
14 |
15 | RUN --mount=type=cache,id=gobuild,target=/gocache \
16 | go build -v -o /packager-plugin ./cmd/packager-plugin/main.go
17 |
18 | FROM alpine:3.13.5
19 |
20 | # https://wiki.alpinelinux.org/wiki/Setting_the_timezone
21 | RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
22 | apk add tzdata && \
23 | cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
24 | echo Asia/Shanghai > /etc/timezone && \
25 | apk del tzdata
26 |
27 | WORKDIR /app
28 |
29 | COPY --from=build /packager-plugin .
30 |
31 | ENTRYPOINT ["/app/packager-plugin"]
32 |
--------------------------------------------------------------------------------
/docker/predator-plugin.Dockerfile:
--------------------------------------------------------------------------------
1 | FROM golang:1.24.1-alpine as build
2 |
3 | WORKDIR /app
4 |
5 | ENV CGO_ENABLED=0 GOOS=linux
6 | ENV GOPROXY=https://goproxy.cn,direct
7 | ENV GOCACHE=/gocache
8 |
9 | COPY go.mod go.sum ./
10 | COPY cmd cmd
11 | COPY pkg pkg
12 |
13 | RUN go mod download
14 |
15 | RUN --mount=type=cache,id=gobuild,target=/gocache \
16 | go build -v -o /predator-plugin ./cmd/predator-plugin/main.go
17 |
18 | FROM koderover.tencentcloudcr.com/koderover-public/build-base:focal
19 |
20 | WORKDIR /app
21 |
22 | COPY --from=build /predator-plugin .
23 |
24 | ENTRYPOINT ["/app/predator-plugin"]
25 |
--------------------------------------------------------------------------------
/docker/resource-server.Dockerfile:
--------------------------------------------------------------------------------
1 | FROM golang:1.24.1-alpine as build
2 |
3 | WORKDIR /app
4 |
5 | ENV CGO_ENABLED=0 GOOS=linux
6 | ENV GOPROXY=https://goproxy.cn,direct
7 | ENV GOCACHE=/gocache
8 |
9 | COPY go.mod go.sum ./
10 | COPY cmd cmd
11 | COPY pkg pkg
12 |
13 | RUN go mod download
14 |
15 | RUN --mount=type=cache,id=gobuild,target=/gocache \
16 | go build -v -o /reaper ./cmd/reaper/main.go
17 | RUN --mount=type=cache,id=gobuild,target=/gocache \
18 | go build -v -o /jobexecutor ./cmd/jobexecutor/main.go
19 |
20 | FROM nginx
21 |
22 | WORKDIR /app
23 |
24 | ADD resource-server-nginx.conf /etc/nginx/conf.d/default.conf
25 | COPY --from=build /reaper .
26 | COPY --from=build /jobexecutor .
27 |
28 | EXPOSE 80
29 |
--------------------------------------------------------------------------------
/docker/ua.Dockerfile:
--------------------------------------------------------------------------------
1 | FROM golang:1.24.1-alpine as build
2 |
3 | WORKDIR /app
4 |
5 | ENV CGO_ENABLED=0 GOOS=linux
6 | ENV GOPROXY=https://goproxy.cn,direct
7 | ENV GOCACHE=/gocache
8 |
9 | COPY go.mod go.sum ./
10 | COPY cmd cmd
11 | COPY pkg pkg
12 |
13 | RUN go mod download
14 |
15 | RUN --mount=type=cache,id=gobuild,target=/gocache \
16 | go build -v -o /ua ./cmd/ua/main.go
17 |
18 | FROM alpine:3.13.5
19 |
20 | # https://wiki.alpinelinux.org/wiki/Setting_the_timezone
21 | RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
22 | apk add tzdata && \
23 | cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
24 | echo Asia/Shanghai > /etc/timezone && \
25 | apk del tzdata
26 |
27 |
28 | WORKDIR /app
29 |
30 | COPY --from=build /ua .
31 |
32 | ENTRYPOINT ["/app/ua"]
--------------------------------------------------------------------------------
/docker/user.Dockerfile:
--------------------------------------------------------------------------------
1 | FROM golang:1.24.1-alpine as build
2 |
3 | WORKDIR /app
4 |
5 | ENV CGO_ENABLED=0 GOOS=linux
6 | ENV GOPROXY=https://goproxy.cn,direct
7 | ENV GOCACHE=/gocache
8 |
9 | COPY go.mod go.sum ./
10 | COPY cmd cmd
11 | COPY pkg pkg
12 |
13 | RUN go mod download
14 |
15 | RUN --mount=type=cache,id=gobuild,target=/gocache \
16 | go build -v -o /user ./cmd/user/main.go
17 |
18 | FROM alpine/git:v2.36.3
19 |
20 | # https://wiki.alpinelinux.org/wiki/Setting_the_timezone
21 | RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
22 | apk add tzdata && \
23 | cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
24 | echo Asia/Shanghai > /etc/timezone && \
25 | apk del tzdata
26 |
27 | WORKDIR /app
28 |
29 | COPY --from=build /user .
30 |
31 | ENTRYPOINT ["/app/user"]
32 |
--------------------------------------------------------------------------------
/docker/warpdrive.Dockerfile:
--------------------------------------------------------------------------------
1 | FROM golang:1.24.1-alpine as build
2 |
3 | WORKDIR /app
4 |
5 | ENV CGO_ENABLED=0 GOOS=linux
6 | ENV GOPROXY=https://goproxy.cn,direct
7 | ENV GOCACHE=/gocache
8 |
9 | COPY go.mod go.sum ./
10 | COPY cmd cmd
11 | COPY pkg pkg
12 |
13 | RUN go mod download
14 |
15 | RUN --mount=type=cache,id=gobuild,target=/gocache \
16 | go build -v -o /warpdrive ./cmd/warpdrive/main.go
17 |
18 | FROM alpine:3.13.5
19 |
20 | # https://wiki.alpinelinux.org/wiki/Setting_the_timezone
21 | RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
22 | apk add tzdata && \
23 | cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
24 | echo Asia/Shanghai > /etc/timezone && \
25 | apk del tzdata
26 |
27 | WORKDIR /app
28 |
29 | COPY --from=build /warpdrive .
30 |
31 | ENTRYPOINT ["/app/warpdrive"]
32 |
--------------------------------------------------------------------------------
/docker/xenial-base.Dockerfile:
--------------------------------------------------------------------------------
1 | FROM ubuntu:xenial
2 |
3 | RUN sed -i -E "s/[a-zA-Z0-9]+.ubuntu.com/mirrors.aliyun.com/g" /etc/apt/sources.list
4 | RUN apt-get clean && apt-get update && apt-get install -y apt-transport-https ca-certificates
5 | RUN DEBIAN_FRONTEND=noninteractive apt install -y tzdata
6 | RUN apt-get clean && apt-get update && apt-get install -y \
7 | curl \
8 | netcat-openbsd \
9 | wget \
10 | build-essential \
11 | libfontconfig \
12 | libsasl2-dev \
13 | libfreetype6-dev \
14 | libpcre3-dev \
15 | pkg-config \
16 | cmake \
17 | python \
18 | librrd-dev \
19 | python \
20 | net-tools \
21 | dnsutils \
22 | ca-certificates \
23 | lsof \
24 | telnet \
25 | sudo \
26 | git
27 |
28 | # Change timezone to Asia/Shanghai
29 | RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
30 |
31 | # Install docker client
32 | RUN curl -fsSL https://get.docker.com | bash
33 |
--------------------------------------------------------------------------------
/docker/zadig-debug.Dockerfile:
--------------------------------------------------------------------------------
1 | FROM alpine:3.13.5
2 |
3 | RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
4 |
5 | RUN apk update
6 | RUN apk upgrade
7 | RUN apk add bash curl wget iputils busybox-extras bind-tools tcpdump net-tools procps sysstat
8 |
--------------------------------------------------------------------------------
/docker/zgctl-sidecar.Dockerfile:
--------------------------------------------------------------------------------
1 | FROM syncthing/syncthing:1.20.1
2 |
3 | WORKDIR /home/syncthing
4 |
--------------------------------------------------------------------------------
/examples/git-zadig-demo/default.xml:
--------------------------------------------------------------------------------
1 |
2 | change-history
3 | https://gitlab.com/kr-poc/manifest-repo
4 |
8 |
9 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/examples/grayscale-demo/chart/a/.helmignore:
--------------------------------------------------------------------------------
1 | # Patterns to ignore when building packages.
2 | # This supports shell glob matching, relative path matching, and
3 | # negation (prefixed with !). Only one pattern per line.
4 | .DS_Store
5 | # Common VCS dirs
6 | .git/
7 | .gitignore
8 | .bzr/
9 | .bzrignore
10 | .hg/
11 | .hgignore
12 | .svn/
13 | # Common backup files
14 | *.swp
15 | *.bak
16 | *.tmp
17 | *.orig
18 | *~
19 | # Various IDEs
20 | .project
21 | .idea/
22 | *.tmproj
23 | .vscode/
24 |
--------------------------------------------------------------------------------
/examples/grayscale-demo/chart/a/templates/service.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Service
3 | metadata:
4 | name: {{ .Chart.Name }}
5 | labels:
6 | app: {{ .Chart.Name }}
7 | spec:
8 | type: {{ .Values.service.type }}
9 | ports:
10 | - port: {{ .Values.service.port }}
11 | targetPort: {{ .Values.service.targetPort }}
12 | protocol: TCP
13 | name: http
14 | selector:
15 | app: {{ .Chart.Name }}
16 |
--------------------------------------------------------------------------------
/examples/grayscale-demo/chart/a/values.yaml:
--------------------------------------------------------------------------------
1 | # Default values for a.
2 | # This is a YAML-formatted file.
3 | # Declare variables to be passed into your templates.
4 |
5 | replicaCount: 1
6 |
7 | image:
8 | repository: koderover.tencentcloudcr.com/koderover-demo/myapp-1
9 | pullPolicy: Always
10 | tag: v0.1.1
11 |
12 | service:
13 | type: ClusterIP
14 | port: 80
15 | targetPort: 8080
16 |
17 | resources:
18 | limits:
19 | cpu: 100m
20 | memory: 128Mi
21 | requests:
22 | cpu: 100m
23 | memory: 128Mi
24 |
25 | imagePullSecrets:
26 | - name: qn-registry-secret
27 |
--------------------------------------------------------------------------------
/examples/grayscale-demo/chart/b/.helmignore:
--------------------------------------------------------------------------------
1 | # Patterns to ignore when building packages.
2 | # This supports shell glob matching, relative path matching, and
3 | # negation (prefixed with !). Only one pattern per line.
4 | .DS_Store
5 | # Common VCS dirs
6 | .git/
7 | .gitignore
8 | .bzr/
9 | .bzrignore
10 | .hg/
11 | .hgignore
12 | .svn/
13 | # Common backup files
14 | *.swp
15 | *.bak
16 | *.tmp
17 | *.orig
18 | *~
19 | # Various IDEs
20 | .project
21 | .idea/
22 | *.tmproj
23 | .vscode/
24 |
--------------------------------------------------------------------------------
/examples/grayscale-demo/chart/b/templates/service.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Service
3 | metadata:
4 | name: {{ .Chart.Name }}
5 | labels:
6 | app: {{ .Chart.Name }}
7 | spec:
8 | type: {{ .Values.service.type }}
9 | ports:
10 | - port: {{ .Values.service.port }}
11 | targetPort: {{ .Values.service.targetPort }}
12 | protocol: TCP
13 | name: http
14 | selector:
15 | app: {{ .Chart.Name }}
16 |
--------------------------------------------------------------------------------
/examples/grayscale-demo/chart/b/values.yaml:
--------------------------------------------------------------------------------
1 | # Default values for a.
2 | # This is a YAML-formatted file.
3 | # Declare variables to be passed into your templates.
4 |
5 | replicaCount: 1
6 |
7 | image:
8 | repository: koderover.tencentcloudcr.com/koderover-demo/myapp-2
9 | pullPolicy: Always
10 | tag: v0.1.1
11 |
12 | service:
13 | type: ClusterIP
14 | port: 80
15 | targetPort: 8081
16 |
17 | resources:
18 | limits:
19 | cpu: 100m
20 | memory: 128Mi
21 | requests:
22 | cpu: 100m
23 | memory: 128Mi
24 |
25 | imagePullSecrets:
26 | - name: qn-registry-secret
27 |
--------------------------------------------------------------------------------
/examples/grayscale-demo/chart/c/.helmignore:
--------------------------------------------------------------------------------
1 | # Patterns to ignore when building packages.
2 | # This supports shell glob matching, relative path matching, and
3 | # negation (prefixed with !). Only one pattern per line.
4 | .DS_Store
5 | # Common VCS dirs
6 | .git/
7 | .gitignore
8 | .bzr/
9 | .bzrignore
10 | .hg/
11 | .hgignore
12 | .svn/
13 | # Common backup files
14 | *.swp
15 | *.bak
16 | *.tmp
17 | *.orig
18 | *~
19 | # Various IDEs
20 | .project
21 | .idea/
22 | *.tmproj
23 | .vscode/
24 |
--------------------------------------------------------------------------------
/examples/grayscale-demo/chart/c/templates/deployment.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: apps/v1
2 | kind: Deployment
3 | metadata:
4 | name: {{ .Chart.Name }}
5 | labels:
6 | app: {{ .Chart.Name }}
7 | spec:
8 | selector:
9 | matchLabels:
10 | app: {{ .Chart.Name }}
11 | replicas: {{ .Values.replicaCount }}
12 | template:
13 | metadata:
14 | labels:
15 | app: {{ .Chart.Name }}
16 | spec:
17 | {{- with .Values.imagePullSecrets }}
18 | imagePullSecrets:
19 | {{- toYaml . | nindent 8 }}
20 | {{- end}}
21 | containers:
22 | - name: {{ .Chart.Name }}
23 | image: {{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}
24 | imagePullPolicy: {{ .Values.image.pullPolicy }}
25 | command: ["/myapp-3"]
26 | ports:
27 | - containerPort: {{ .Values.service.targetPort }}
28 | resources:
29 | {{- toYaml .Values.resources | nindent 12 }}
30 |
--------------------------------------------------------------------------------
/examples/grayscale-demo/chart/c/templates/service.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Service
3 | metadata:
4 | name: {{ .Chart.Name }}
5 | labels:
6 | app: {{ .Chart.Name }}
7 | spec:
8 | type: {{ .Values.service.type }}
9 | ports:
10 | - port: {{ .Values.service.port }}
11 | targetPort: {{ .Values.service.targetPort }}
12 | protocol: TCP
13 | name: http
14 | selector:
15 | app: {{ .Chart.Name }}
16 |
--------------------------------------------------------------------------------
/examples/grayscale-demo/chart/c/values.yaml:
--------------------------------------------------------------------------------
1 | # Default values for a.
2 | # This is a YAML-formatted file.
3 | # Declare variables to be passed into your templates.
4 |
5 | replicaCount: 1
6 |
7 | image:
8 | repository: koderover.tencentcloudcr.com/koderover-demo/myapp-3
9 | pullPolicy: Always
10 | tag: v0.1.1
11 |
12 | service:
13 | type: ClusterIP
14 | port: 80
15 | targetPort: 8082
16 |
17 | resources:
18 | limits:
19 | cpu: 100m
20 | memory: 128Mi
21 | requests:
22 | cpu: 100m
23 | memory: 128Mi
24 |
25 | imagePullSecrets:
26 | - name: qn-registry-secret
27 |
--------------------------------------------------------------------------------
/examples/grayscale-demo/cmd/myapp-1/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM alpine/git:v2.36.3
2 |
3 | COPY myapp-1 /myapp-1
4 |
5 | RUN apk add --no-cache curl
6 |
7 | # This would be nicer as `nobody:nobody` but distroless has no such entries.
8 | USER 65535:65535
9 | ENV HOME /
10 |
11 | ENTRYPOINT ["/myapp-1"]
12 |
--------------------------------------------------------------------------------
/examples/grayscale-demo/cmd/myapp-1/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "os"
5 |
6 | "github.com/spf13/pflag"
7 | "k8s.io/component-base/cli/flag"
8 | "k8s.io/component-base/logs"
9 | "k8s.io/klog/v2"
10 |
11 | "github.com/koderover/demo/cmd/myapp-1/app"
12 | "github.com/koderover/demo/pkg/version"
13 | )
14 |
15 | func main() {
16 | op := app.NewOptions()
17 | op.AddFlags(pflag.CommandLine)
18 |
19 | flag.InitFlags()
20 | logs.InitLogs()
21 | defer logs.FlushLogs()
22 |
23 | if op.PrintVersion {
24 | klog.InfoS("Version", "version", version.Version)
25 | os.Exit(0)
26 | }
27 |
28 | if err := app.Run(op); err != nil {
29 | klog.ErrorS(err, "Failed to run app")
30 | os.Exit(1)
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/examples/grayscale-demo/cmd/myapp-2/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM alpine/git:v2.36.3
2 |
3 | COPY myapp-2 /myapp-2
4 |
5 | RUN apk add --no-cache curl
6 |
7 | # This would be nicer as `nobody:nobody` but distroless has no such entries.
8 | USER 65535:65535
9 | ENV HOME /
10 |
11 | ENTRYPOINT ["/myapp-2"]
12 |
--------------------------------------------------------------------------------
/examples/grayscale-demo/cmd/myapp-2/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "os"
5 |
6 | "github.com/spf13/pflag"
7 | "k8s.io/component-base/cli/flag"
8 | "k8s.io/component-base/logs"
9 | "k8s.io/klog/v2"
10 |
11 | "github.com/koderover/demo/cmd/myapp-2/app"
12 | "github.com/koderover/demo/pkg/version"
13 | )
14 |
15 | func main() {
16 | op := app.NewOptions()
17 | op.AddFlags(pflag.CommandLine)
18 |
19 | flag.InitFlags()
20 | logs.InitLogs()
21 | defer logs.FlushLogs()
22 |
23 | if op.PrintVersion {
24 | klog.InfoS("Version", "version", version.Version)
25 | os.Exit(0)
26 | }
27 |
28 | if err := app.Run(op); err != nil {
29 | klog.ErrorS(err, "Failed to run app")
30 | os.Exit(1)
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/examples/grayscale-demo/cmd/myapp-3/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM alpine/git:v2.36.3
2 |
3 | COPY myapp-3 /myapp-3
4 |
5 | RUN apk add --no-cache curl
6 |
7 | # This would be nicer as `nobody:nobody` but distroless has no such entries.
8 | USER 65535:65535
9 | ENV HOME /
10 |
11 | ENTRYPOINT ["/myapp-3"]
--------------------------------------------------------------------------------
/examples/grayscale-demo/cmd/myapp-3/app/options.go:
--------------------------------------------------------------------------------
1 | package app
2 |
3 | import (
4 | "github.com/spf13/pflag"
5 | )
6 |
7 | // Options is the configuration of demo.
8 | type Options struct {
9 | ListenAddr string
10 | PrintVersion bool
11 | }
12 |
13 | // NewOptions news configurations of demo.
14 | func NewOptions() *Options {
15 | return &Options{}
16 | }
17 |
18 | // AddFlags adds flag options.
19 | func (op *Options) AddFlags(fs *pflag.FlagSet) {
20 | fs.StringVar(&op.ListenAddr, "listen-addr", "0.0.0.0:8082", "listen addr")
21 | fs.BoolVar(&op.PrintVersion, "version", false, "Print version info and quit")
22 | }
23 |
--------------------------------------------------------------------------------
/examples/grayscale-demo/cmd/myapp-3/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "os"
5 |
6 | "github.com/spf13/pflag"
7 | "k8s.io/component-base/cli/flag"
8 | "k8s.io/component-base/logs"
9 | "k8s.io/klog/v2"
10 |
11 | "github.com/koderover/demo/cmd/myapp-3/app"
12 | "github.com/koderover/demo/pkg/version"
13 | )
14 |
15 | func main() {
16 | op := app.NewOptions()
17 | op.AddFlags(pflag.CommandLine)
18 |
19 | flag.InitFlags()
20 | logs.InitLogs()
21 | defer logs.FlushLogs()
22 |
23 | if op.PrintVersion {
24 | klog.InfoS("Version", "version", version.Version)
25 | os.Exit(0)
26 | }
27 |
28 | if err := app.Run(op); err != nil {
29 | klog.ErrorS(err, "Failed to run app")
30 | os.Exit(1)
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/examples/grayscale-demo/pkg/protos/myapp.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | option go_package = "github.com/koderover/demo/pkg/protos";
4 |
5 | package protos;
6 |
7 | service Demo {
8 | rpc GetInfo (InfoRequest) returns (InfoReply) {}
9 | }
10 |
11 | message InfoRequest {
12 | }
13 |
14 | message InfoReply {
15 | string message = 1;
16 | }
17 |
--------------------------------------------------------------------------------
/examples/grayscale-demo/pkg/version/version.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2016 The Kubernetes Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package version
18 |
19 | // Version is the app-global version string, which should be substituted with a
20 | // real value during build.
21 | var Version = "UNKNOWN"
22 |
--------------------------------------------------------------------------------
/examples/grayscale-demo/yaml/c.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Service
3 | metadata:
4 | name: c
5 | labels:
6 | app: c
7 | spec:
8 | ports:
9 | - name: http
10 | port: 80
11 | targetPort: 8082
12 | selector:
13 | app: c
14 | ---
15 | apiVersion: apps/v1
16 | kind: Deployment
17 | metadata:
18 | name: c
19 | labels:
20 | app: c
21 | spec:
22 | selector:
23 | matchLabels:
24 | app: c
25 | replicas: 1
26 | template:
27 | metadata:
28 | labels:
29 | app: c
30 | spec:
31 | containers:
32 | - name: myapp-3
33 | image: koderover.tencentcloudcr.com/koderover-demo/myapp-3:v0.1.1
34 | imagePullPolicy: Always
35 | command: ["/myapp-3"]
36 | ports:
37 | - containerPort: 8082
38 | resources:
39 | limits:
40 | cpu: 100m
41 | memory: 100Mi
42 |
--------------------------------------------------------------------------------
/examples/java-tomcat-demo/Procfile:
--------------------------------------------------------------------------------
1 | web: sh target/bin/webapp
2 |
--------------------------------------------------------------------------------
/examples/java-tomcat-demo/README.md:
--------------------------------------------------------------------------------
1 | To run locally after cloning the repo,
2 |
3 | 1. mvn package
4 | 2. sh target/bin/webapp
5 |
6 |
--------------------------------------------------------------------------------
/examples/java-tomcat-demo/src/main/java/servlet/HelloServlet.java:
--------------------------------------------------------------------------------
1 | package servlet;
2 | import java.io.IOException;
3 |
4 | import javax.servlet.ServletException;
5 | import javax.servlet.ServletOutputStream;
6 | import javax.servlet.annotation.WebServlet;
7 | import javax.servlet.http.HttpServlet;
8 | import javax.servlet.http.HttpServletRequest;
9 | import javax.servlet.http.HttpServletResponse;
10 |
11 | @WebServlet(
12 | name = "MyServlet",
13 | urlPatterns = {"/hello"}
14 | )
15 | public class HelloServlet extends HttpServlet {
16 |
17 | @Override
18 | protected void doGet(HttpServletRequest req, HttpServletResponse resp)
19 | throws ServletException, IOException {
20 | ServletOutputStream out = resp.getOutputStream();
21 | out.write("hello world".getBytes());
22 | out.flush();
23 | out.close();
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/examples/java-tomcat-demo/src/main/webapp/index.jsp:
--------------------------------------------------------------------------------
1 |
2 |
3 | Hello world!
4 |
5 |
6 |
--------------------------------------------------------------------------------
/examples/microservice-demo/README.md:
--------------------------------------------------------------------------------
1 | # Golang + Vue.js
2 |
3 |
--------------------------------------------------------------------------------
/examples/microservice-demo/backend/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM koderover.tencentcloudcr.com/koderover-demo/ubuntu:20.04
2 |
3 | WORKDIR /workspace
4 |
5 | COPY backend /workspace/backend
6 |
7 | CMD [ "./backend" ]
--------------------------------------------------------------------------------
/examples/microservice-demo/backend/Makefile:
--------------------------------------------------------------------------------
1 |
2 | build-backend:
3 | go clean && GOOS=linux GOARCH=amd64 go build -o backend -ldflags="-X main.BuildStamp=`date +%Y-%m-%d.%H:%M:%S`" backend.go
4 |
--------------------------------------------------------------------------------
/examples/microservice-demo/backend/go.mod:
--------------------------------------------------------------------------------
1 | module microservice-demo/backend
2 |
3 | go 1.17
4 |
--------------------------------------------------------------------------------
/examples/microservice-demo/chart/.helmignore:
--------------------------------------------------------------------------------
1 | # Patterns to ignore when building packages.
2 | # This supports shell glob matching, relative path matching, and
3 | # negation (prefixed with !). Only one pattern per line.
4 | .DS_Store
5 | # Common VCS dirs
6 | .git/
7 | .gitignore
8 | .bzr/
9 | .bzrignore
10 | .hg/
11 | .hgignore
12 | .svn/
13 | # Common backup files
14 | *.swp
15 | *.bak
16 | *.tmp
17 | *.orig
18 | *~
19 | # Various IDEs
20 | .project
21 | .idea/
22 | *.tmproj
23 | .vscode/
24 |
--------------------------------------------------------------------------------
/examples/microservice-demo/chart/templates/job.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: batch/v1
2 | kind: Job
3 | metadata:
4 | name: pi
5 | annotations:
6 | "helm.sh/hook": post-install
7 | "helm.sh/hook-weight": "-5"
8 | spec:
9 | template:
10 | spec:
11 | containers:
12 | - name: pi
13 | image: perl
14 | command: ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"]
15 | restartPolicy: Never
16 | backoffLimit: 4
--------------------------------------------------------------------------------
/examples/microservice-demo/chart/templates/secret.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | data:
3 | .dockercfg: {{ .Values.registrySecret }}
4 | kind: Secret
5 | metadata:
6 | name: registry-secret
7 | type: kubernetes.io/dockercfg
--------------------------------------------------------------------------------
/examples/microservice-demo/chart/values.yaml:
--------------------------------------------------------------------------------
1 | # Default values for chart.
2 | # This is a YAML-formatted file.
3 | # Declare variables to be passed into your templates.
4 |
5 | ingressClass: kr-nginx
6 | Backend:
7 | replicaCount: 1
8 | image:
9 | repository: koderover.tencentcloudcr.com/koderover-demo/backend
10 | tag: "latest"
11 |
12 | Frontend:
13 | replicaCount: 1
14 | image:
15 | repository: koderover.tencentcloudcr.com/koderover-demo/frontend
16 | tag: "latest"
17 |
18 | domain: demo.domain.com
19 | port: 20219
20 |
21 | resources:
22 | limits:
23 | cpu: 50m
24 | memory: 50Mi
25 |
26 | registrySecret: ""
27 |
--------------------------------------------------------------------------------
/examples/microservice-demo/database-change/sql/V1__Create_person_table.sql:
--------------------------------------------------------------------------------
1 | create table PERSON (
2 | ID int not null,
3 | NAME varchar(100) not null
4 | );
--------------------------------------------------------------------------------
/examples/microservice-demo/database-change/sql/V2__Add_people.sql:
--------------------------------------------------------------------------------
1 | insert into PERSON (ID, NAME) values (1, 'Axel');
2 | insert into PERSON (ID, NAME) values (2, 'Mr. Foo');
3 | insert into PERSON (ID, NAME) values (3, 'Ms. Bar');
--------------------------------------------------------------------------------
/examples/microservice-demo/database-change/sql/V3__Create_student_table.sql:
--------------------------------------------------------------------------------
1 | create table student (
2 | ID int not null,
3 | NAME varchar(100) not null
4 | );
--------------------------------------------------------------------------------
/examples/microservice-demo/database-change/sql/put-your-sql-migrations-here.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koderover/zadig/2995eacaea155ad93f66a78a072a036ecba503a6/examples/microservice-demo/database-change/sql/put-your-sql-migrations-here.txt
--------------------------------------------------------------------------------
/examples/microservice-demo/frontend/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | ["env", {
4 | "modules": false,
5 | "targets": {
6 | "browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
7 | }
8 | }],
9 | "stage-2"
10 | ],
11 | "plugins": ["transform-vue-jsx", "transform-runtime"]
12 | }
13 |
--------------------------------------------------------------------------------
/examples/microservice-demo/frontend/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | charset = utf-8
5 | indent_style = space
6 | indent_size = 2
7 | end_of_line = lf
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 |
--------------------------------------------------------------------------------
/examples/microservice-demo/frontend/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules/
3 | /dist/
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 |
8 | # Editor directories and files
9 | .idea
10 | .vscode
11 | *.suo
12 | *.ntvs*
13 | *.njsproj
14 | *.sln
15 |
--------------------------------------------------------------------------------
/examples/microservice-demo/frontend/.postcssrc.js:
--------------------------------------------------------------------------------
1 | // https://github.com/michael-ciniawsky/postcss-load-config
2 |
3 | module.exports = {
4 | "plugins": {
5 | "postcss-import": {},
6 | "postcss-url": {},
7 | // to edit target browsers: use "browserslist" field in package.json
8 | "autoprefixer": {}
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/examples/microservice-demo/frontend/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM koderover.tencentcloudcr.com/koderover-demo/frontend-base:0.1 As builder
2 |
3 | WORKDIR /frontend
4 |
5 | COPY . /frontend
6 |
7 | RUN make install-frontend-dep build-frontend
8 |
9 |
10 | FROM koderover.tencentcloudcr.com/koderover-demo/nginx:1.16.0
11 |
12 | WORKDIR /frontend
13 |
14 | COPY --from=builder /frontend/dist /frontend/
15 |
16 | COPY --from=builder /frontend/nginx.conf /etc/nginx/conf.d/default.conf
17 |
18 | EXPOSE 80
--------------------------------------------------------------------------------
/examples/microservice-demo/frontend/Makefile:
--------------------------------------------------------------------------------
1 | build-frontend:
2 | yarn run build
3 |
4 |
5 | install-frontend-dep:
6 | yarn config set registry https://registry.npmmirror.com
7 | yarn install
8 |
--------------------------------------------------------------------------------
/examples/microservice-demo/frontend/README.md:
--------------------------------------------------------------------------------
1 | # frontend
2 |
3 | > 容器化前端项目
4 |
5 | ## Build Setup
6 |
7 | ``` bash
8 | # install dependencies
9 | npm install
10 |
11 | # serve with hot reload at localhost:8080
12 | npm run dev
13 |
14 | # build for production with minification
15 | npm run build
16 |
17 | # build for production and view the bundle analyzer report
18 | npm run build --report
19 | ```
20 |
21 | For a detailed explanation on how things work, check out the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader).
22 |
--------------------------------------------------------------------------------
/examples/microservice-demo/frontend/build/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koderover/zadig/2995eacaea155ad93f66a78a072a036ecba503a6/examples/microservice-demo/frontend/build/logo.png
--------------------------------------------------------------------------------
/examples/microservice-demo/frontend/build/vue-loader.conf.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | const utils = require('./utils')
3 | const config = require('../config')
4 | const isProduction = process.env.NODE_ENV === 'production'
5 | const sourceMapEnabled = isProduction
6 | ? config.build.productionSourceMap
7 | : config.dev.cssSourceMap
8 |
9 | module.exports = {
10 | loaders: utils.cssLoaders({
11 | sourceMap: sourceMapEnabled,
12 | extract: isProduction
13 | }),
14 | cssSourceMap: sourceMapEnabled,
15 | cacheBusting: config.dev.cacheBusting,
16 | transformToRequire: {
17 | video: ['src', 'poster'],
18 | source: 'src',
19 | img: 'src',
20 | image: 'xlink:href'
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/examples/microservice-demo/frontend/config/dev.env.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | const merge = require('webpack-merge')
3 | const prodEnv = require('./prod.env')
4 |
5 | module.exports = merge(prodEnv, {
6 | NODE_ENV: '"development"'
7 |
8 | })
9 |
--------------------------------------------------------------------------------
/examples/microservice-demo/frontend/config/prod.env.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | module.exports = {
3 | NODE_ENV: '"production"'
4 | }
5 |
--------------------------------------------------------------------------------
/examples/microservice-demo/frontend/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | frontend
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/examples/microservice-demo/frontend/src/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |

4 |
5 |
6 |
7 |
8 |
13 |
14 |
24 |
--------------------------------------------------------------------------------
/examples/microservice-demo/frontend/src/assets/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koderover/zadig/2995eacaea155ad93f66a78a072a036ecba503a6/examples/microservice-demo/frontend/src/assets/logo.png
--------------------------------------------------------------------------------
/examples/microservice-demo/frontend/src/main.js:
--------------------------------------------------------------------------------
1 | // The Vue build version to load with the `import` command
2 | // (runtime-only or standalone) has been set in webpack.base.conf with an alias.
3 | import Vue from 'vue'
4 | import App from './App'
5 | import router from './router'
6 |
7 |
8 | Vue.config.productionTip = false
9 |
10 | /* eslint-disable no-new */
11 | new Vue({
12 | el: '#app',
13 | router,
14 | components: { App },
15 | template: ''
16 | })
17 |
18 |
--------------------------------------------------------------------------------
/examples/microservice-demo/frontend/src/router/index.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import Router from 'vue-router'
3 | import HelloWorld from '@/components/HelloWorld'
4 |
5 |
6 |
7 | Vue.use(Router)
8 |
9 | export default new Router({
10 | routes: [
11 | {
12 | path: '/',
13 | name: 'HelloWorld',
14 | component: HelloWorld
15 | }
16 | ]
17 | })
18 |
19 |
--------------------------------------------------------------------------------
/examples/microservice-demo/frontend/static/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koderover/zadig/2995eacaea155ad93f66a78a072a036ecba503a6/examples/microservice-demo/frontend/static/.gitkeep
--------------------------------------------------------------------------------
/examples/microservice-demo/frontend/vm/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM nginx:1.16.0
2 |
3 | WORKDIR /frontend
4 |
5 | ADD dist/ /frontend/
6 |
7 | ADD nginx.conf /etc/nginx/conf.d/default.conf
8 |
9 | EXPOSE 80
--------------------------------------------------------------------------------
/examples/microservice-demo/k8s-yaml/backend/service.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Service
3 | metadata:
4 | name: backend
5 | labels:
6 | app.kubernetes.io/name: demo
7 | app.kubernetes.io/instance: backend
8 | spec:
9 | type: NodePort
10 | ports:
11 | - protocol: TCP
12 | port: 20219
13 | targetPort: 20219
--------------------------------------------------------------------------------
/examples/microservice-demo/k8s-yaml/frontend/ingress.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: networking.k8s.io/v1
2 | kind: Ingress
3 | metadata:
4 | name: frontend
5 | annotations:
6 | nginx.ingress.kubernetes.io/proxy-body-size: 100m
7 | labels:
8 | app.kubernetes.io/instance: frontend
9 | app.kubernetes.io/name: demo
10 | spec:
11 | rules:
12 | - host: {{.demo_domain}}
13 | http:
14 | paths:
15 | - path: /
16 | pathType: Prefix
17 | backend:
18 | service:
19 | name: frontend
20 | port:
21 | number: 80
--------------------------------------------------------------------------------
/examples/microservice-demo/k8s-yaml/frontend/service.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Service
3 | metadata:
4 | name: frontend
5 | labels:
6 | app.kubernetes.io/instance: frontend
7 | app.kubernetes.io/name: demo
8 | spec:
9 | type: NodePort
10 | ports:
11 | - protocol: TCP
12 | port: 80
13 | targetPort: 80
--------------------------------------------------------------------------------
/examples/microservice-demo/vm/ansible/ansible.Dockerfile:
--------------------------------------------------------------------------------
1 | FROM ubuntu:focal
2 |
3 | RUN apt update
4 | RUN apt install -y software-properties-common
5 | RUN add-apt-repository --yes --update ppa:ansible/ansible
6 | RUN apt install -y ansible
7 |
8 | # 以下是 Zadig 所需要的依赖
9 |
10 | # 安装工具 curl git tzdata
11 | RUN sed -i -E "s/[a-zA-Z0-9]+.ubuntu.com/mirrors.aliyun.com/g" /etc/apt/sources.list
12 | RUN apt-get clean && apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y curl git tzdata
13 |
14 | # 修改时区
15 | RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
16 |
17 | # 安装 docker client
18 | RUN curl -fsSL "http://resources.koderover.com/docker-cli-v19.03.2.tar.gz" -o docker.tgz &&\
19 | tar -xvzf docker.tgz &&\
20 | mv docker/* /usr/local/bin
21 |
22 | RUN apt install -y build-essential net-tools
23 |
--------------------------------------------------------------------------------
/examples/microservice-demo/vm/ansible/hosts-dev:
--------------------------------------------------------------------------------
1 | [servers]
2 | 220.16.0.1
3 | 220.16.0.2
4 | 220.16.0.3
5 | 220.16.0.4
6 |
--------------------------------------------------------------------------------
/examples/microservice-demo/vm/ansible/hosts-qa:
--------------------------------------------------------------------------------
1 | [servers]
2 | 220.16.0.11
3 | 220.16.0.12
4 | 220.16.0.13
5 | 220.16.0.14
6 |
--------------------------------------------------------------------------------
/examples/microservice-demo/vm/ansible/main.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | - hosts: servers
3 | remote_user: ubuntu
4 | tasks:
5 | - name: "copy file to remote servers"
6 | copy:
7 | src: "{{ PKG_FILE }}"
8 | dest: "/home/ubuntu/microservice-demo/{{ PKG_FILE }}"
9 | - name: "unzip file"
10 | shell:
11 | chdir: /home/ubuntu/microservice-demo
12 | cmd: tar -xvf /home/ubuntu/microservice-demo/{{ PKG_FILE }}
13 | - name: "deploy backend service"
14 | command: /home/ubuntu/microservice-demo/restart.sh /home/ubuntu/microservice-demo/{{ PKG_FILE }}
15 |
--------------------------------------------------------------------------------
/examples/microservice-demo/vm/expect_scp:
--------------------------------------------------------------------------------
1 | #!/usr/bin/expect
2 | set timeout 10
3 | set host [lindex $argv 0]
4 | set username [lindex $argv 1]
5 | set password [lindex $argv 2]
6 | set src_file [lindex $argv 3]
7 | set dest_file [lindex $argv 4]
8 | spawn scp $src_file $username@$host:$dest_file
9 | expect {
10 | "(yes/no)?"
11 | {
12 | send "yes
13 | "
14 | expect "*assword:" { send "$password
15 | "}
16 | }
17 | "*assword:"
18 | {
19 | send "$password
20 | "
21 | }
22 | }
23 | expect "100%"
24 | expect eof
25 |
--------------------------------------------------------------------------------
/examples/microservice-demo/vm/restart.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -e
4 |
5 | backend_port=20219
6 |
7 | check_port() {
8 | echo "正在检测端口。。。"
9 | netstat -tlpn | grep $backend_port
10 | }
11 |
12 | if [ -f "backend" ];then
13 | rm backend
14 | fi
15 |
16 | if check_port;then
17 | kill -9 $(lsof -i tcp:$backend_port -t)
18 | fi
19 |
20 | tar xvf $1
21 |
22 | nohup ./backend > /dev/null 2> /dev/null &
23 |
24 | rm $1
25 |
--------------------------------------------------------------------------------
/examples/mse-demo/nacos/nacos.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: apps/v1
2 | kind: Deployment
3 | metadata:
4 | name: nacos-server
5 | spec:
6 | replicas: 1
7 | selector:
8 | matchLabels:
9 | app: nacos-server
10 | template:
11 | metadata:
12 | labels:
13 | app: nacos-server
14 | spec:
15 | containers:
16 | - env:
17 | - name: MODE
18 | value: standalone
19 | image: nacos/nacos-server:v2.2.0
20 | imagePullPolicy: Always
21 | name: nacos-server
22 | dnsPolicy: ClusterFirst
23 | restartPolicy: Always
24 |
25 | # Nacos Server Service 配置
26 | ---
27 | apiVersion: v1
28 | kind: Service
29 | metadata:
30 | name: nacos-server
31 | spec:
32 | ports:
33 | - port: 8848
34 | protocol: TCP
35 | targetPort: 8848
36 | selector:
37 | app: nacos-server
38 | type: ClusterIP
--------------------------------------------------------------------------------
/examples/mse-demo/spring-b/spring-b.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: apps/v1
2 | kind: Deployment
3 | metadata:
4 | name: spring-cloud-b
5 | spec:
6 | replicas: 1
7 | selector:
8 | matchLabels:
9 | app: spring-cloud-b
10 | zadigx-release-version: original
11 | strategy:
12 | template:
13 | metadata:
14 | labels:
15 | msePilotCreateAppName: spring-cloud-b
16 | app: spring-cloud-b
17 | zadigx-release-version: original
18 | spec:
19 | containers:
20 | - env:
21 | - name: JAVA_HOME
22 | value: /usr/lib/jvm/java-1.8-openjdk/jre
23 | image: koderover.tencentcloudcr.com/koderover-demo/spring-cloud-b:0.1-SNAPSHOT
24 | imagePullPolicy: Always
25 | name: spring-cloud-b
26 | ports:
27 | - containerPort: 8080
28 | livenessProbe:
29 | tcpSocket:
30 | port: 20002
31 | initialDelaySeconds: 10
32 | periodSeconds: 30
--------------------------------------------------------------------------------
/examples/mse-demo/spring-c/spring-c.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: apps/v1
2 | kind: Deployment
3 | metadata:
4 | name: spring-cloud-c
5 | spec:
6 | replicas: 1
7 | selector:
8 | matchLabels:
9 | app: spring-cloud-c
10 | zadigx-release-version: original
11 | template:
12 | metadata:
13 | labels:
14 | msePilotCreateAppName: spring-cloud-c
15 | app: spring-cloud-c
16 | zadigx-release-version: original
17 | spec:
18 | containers:
19 | - env:
20 | - name: JAVA_HOME
21 | value: /usr/lib/jvm/java-1.8-openjdk/jre
22 | image: koderover.tencentcloudcr.com/koderover-demo/spring-cloud-c:0.1-SNAPSHOT
23 | imagePullPolicy: Always
24 | name: spring-cloud-c
25 | ports:
26 | - containerPort: 8080
27 | livenessProbe:
28 | tcpSocket:
29 | port: 20003
30 | initialDelaySeconds: 10
31 | periodSeconds: 30
--------------------------------------------------------------------------------
/examples/multi-service-demo/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM koderover.tencentcloudcr.com/koderover-demo/ubuntu:20.04
2 |
3 | ARG service
4 |
5 | WORKDIR /workspace
6 |
7 | COPY src/${service}/${service} /workspace/${service}
--------------------------------------------------------------------------------
/examples/multi-service-demo/Makefile:
--------------------------------------------------------------------------------
1 | build-service1:
2 | cd src/service1 && go clean && GOOS=linux GOARCH=amd64 go build -o service1 service1.go
3 |
4 |
5 | build-service2:
6 | cd src/service2 && go clean && GOOS=linux GOARCH=amd64 go build -o service2 service2.go
7 |
8 |
9 | build-service3:
10 | cd src/service3 && go clean && GOOS=linux GOARCH=amd64 go build -o service3 service3.go
11 |
--------------------------------------------------------------------------------
/examples/multi-service-demo/README.md:
--------------------------------------------------------------------------------
1 | `multi-service-demo` 目录结构说明:
2 |
3 | ``` bash
4 | ├── Dockerfile # Dockerfile,也可以作为 Dockerfile 模板,构建镜像时需要通过 --build-arg service=<值> 指定 service 参数的值
5 | ├── Makefile # 构建工程文件,构建时使用 make build-service* 即可
6 | ├── base-chart # Helm Chart 模板,可用于使用模板批量创建服务
7 | ├── full-charts # 多个 Helm Chart,service1、service2、service3 分别有完整独立的 Helm Chart 配置
8 | ├── general-chart # Helm Chart 模板,不可用于使用模板批量创建服务
9 | ├── k8s-yaml # K8s YAML 配置文件,用于 K8s YAML 项目
10 | │ ├── service1 # service1 完整的配置
11 | │ ├── service2 # service2 完整的配置
12 | │ ├── service3 # service3 完整的配置
13 | │ └── template.yaml # service1/service2/service3 的 K8s YAML 服务模板
14 | ├── src # 服务源代码
15 | └── values # 使用 base-chart 模板批量创建服务时,多个服务的 values 文件
16 | ```
17 |
--------------------------------------------------------------------------------
/examples/multi-service-demo/base-chart/templates/service.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Service
3 | metadata:
4 | name: {{ .Values.fullnameOverride }}
5 | labels:
6 | app.kubernetes.io/name: demo
7 | app.kubernetes.io/instance: {{ .Values.fullnameOverride }}
8 | spec:
9 | selector:
10 | app.kubernetes.io/name: demo
11 | app.kubernetes.io/instance: {{ .Values.fullnameOverride }}
12 | type: NodePort
13 | ports:
14 | - protocol: TCP
15 | port: {{ .Values.port }}
16 | targetPort: {{ .Values.port }}
--------------------------------------------------------------------------------
/examples/multi-service-demo/base-chart/values.yaml:
--------------------------------------------------------------------------------
1 | fullnameOverride: service
2 | replicaCount: 1
3 | port: 20221
4 |
5 | imagePullSecretsName: "service-registry-secret"
6 |
7 | image:
8 | repository: "koderover.tencentcloudcr.com/koderover-demo/service"
9 | tag: "latest"
10 |
11 | resources:
12 | requests:
13 | cpu: 10m
14 | mem: 10Mi
15 |
16 | limits:
17 | cpu: 20m
18 | mem: 20Mi
19 |
--------------------------------------------------------------------------------
/examples/multi-service-demo/full-charts/service1/templates/service.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Service
3 | metadata:
4 | name: {{ .Values.fullnameOverride }}
5 | labels:
6 | app.kubernetes.io/name: demo
7 | app.kubernetes.io/instance: {{ .Values.fullnameOverride }}
8 | spec:
9 | selector:
10 | app.kubernetes.io/name: demo
11 | app.kubernetes.io/instance: {{ .Values.fullnameOverride }}
12 | type: NodePort
13 | ports:
14 | - protocol: TCP
15 | port: {{ .Values.port }}
16 | targetPort: {{ .Values.port }}
--------------------------------------------------------------------------------
/examples/multi-service-demo/full-charts/service1/values.yaml:
--------------------------------------------------------------------------------
1 | fullnameOverride: service1
2 | replicaCount: 1
3 | port: 20221
4 |
5 | imagePullSecretsName: "default-registry-secret"
6 |
7 | image:
8 | repository: "koderover.tencentcloudcr.com/koderover-demo/service1"
9 | tag: "latest"
10 |
11 | resources:
12 | requests:
13 | cpu: 20m
14 | mem: 20Mi
15 |
16 | limits:
17 | cpu: 20m
18 | mem: 20Mi
19 |
--------------------------------------------------------------------------------
/examples/multi-service-demo/full-charts/service2/templates/service.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Service
3 | metadata:
4 | name: {{ .Values.fullnameOverride }}
5 | labels:
6 | app.kubernetes.io/name: demo
7 | app.kubernetes.io/instance: {{ .Values.fullnameOverride }}
8 | spec:
9 | selector:
10 | app.kubernetes.io/name: demo
11 | app.kubernetes.io/instance: {{ .Values.fullnameOverride }}
12 | type: NodePort
13 | ports:
14 | - protocol: TCP
15 | port: {{ .Values.port }}
16 | targetPort: {{ .Values.port }}
--------------------------------------------------------------------------------
/examples/multi-service-demo/full-charts/service2/values.yaml:
--------------------------------------------------------------------------------
1 | fullnameOverride: service2
2 | replicaCount: 1
3 | port: 20222
4 |
5 | imagePullSecretsName: "default-registry-secret"
6 |
7 | image:
8 | repository: "koderover.tencentcloudcr.com/koderover-demo/service2"
9 | tag: "latest"
10 |
11 | resources:
12 | requests:
13 | cpu: 10m
14 | mem: 10Mi
15 |
16 | limits:
17 | cpu: 20m
18 | mem: 20Mi
19 |
--------------------------------------------------------------------------------
/examples/multi-service-demo/full-charts/service3/templates/service.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Service
3 | metadata:
4 | name: {{ .Values.fullnameOverride }}
5 | labels:
6 | app.kubernetes.io/name: demo
7 | app.kubernetes.io/instance: {{ .Values.fullnameOverride }}
8 | spec:
9 | selector:
10 | app.kubernetes.io/name: demo
11 | app.kubernetes.io/instance: {{ .Values.fullnameOverride }}
12 | type: NodePort
13 | ports:
14 | - protocol: TCP
15 | port: {{ .Values.port }}
16 | targetPort: {{ .Values.port }}
--------------------------------------------------------------------------------
/examples/multi-service-demo/full-charts/service3/values.yaml:
--------------------------------------------------------------------------------
1 | fullnameOverride: service1
2 | replicaCount: 1
3 | port: 20223
4 |
5 | imagePullSecretsName: "default-registry-secret"
6 |
7 | image:
8 | repository: "koderover.tencentcloudcr.com/koderover-demo/service3"
9 | tag: "latest"
10 |
11 | resources:
12 | requests:
13 | cpu: 10m
14 | mem: 10Mi
15 |
16 | limits:
17 | cpu: 20m
18 | mem: 20Mi
19 |
--------------------------------------------------------------------------------
/examples/multi-service-demo/general-chart/templates/service.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Service
3 | metadata:
4 | name: {{ .Values.fullnameOverride }}
5 | labels:
6 | app.kubernetes.io/name: demo
7 | app.kubernetes.io/instance: {{ .Values.fullnameOverride }}
8 | spec:
9 | selector:
10 | app.kubernetes.io/name: demo
11 | app.kubernetes.io/instance: {{ .Values.fullnameOverride }}
12 | type: NodePort
13 | ports:
14 | - protocol: TCP
15 | port: {{ .Values.port }}
16 | targetPort: {{ .Values.port }}
--------------------------------------------------------------------------------
/examples/multi-service-demo/general-chart/values.yaml:
--------------------------------------------------------------------------------
1 | fullnameOverride: $T-Service$
2 | replicaCount: 1
3 | port: {{.port}}
4 |
5 | imagePullSecretsName: "default-registry-secret"
6 |
7 | image:
8 | repository: "koderover.tencentcloudcr.com/koderover-demo/$T-Service$"
9 | tag: "latest"
10 |
11 | resources:
12 | requests:
13 | cpu: 10m
14 | mem: 10Mi
15 |
16 | limits:
17 | cpu: 20m
18 | mem: 20Mi
19 |
--------------------------------------------------------------------------------
/examples/multi-service-demo/go.mod:
--------------------------------------------------------------------------------
1 | module multi-service-demo
2 |
3 | go 1.17
4 |
--------------------------------------------------------------------------------
/examples/multi-service-demo/k8s-yaml/service1/service.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Service
3 | metadata:
4 | name: service1
5 | labels:
6 | app.kubernetes.io/name: demo
7 | app.kubernetes.io/instance: service1
8 | spec:
9 | type: NodePort
10 | ports:
11 | - protocol: TCP
12 | port: 20221
13 | targetPort: 20221
--------------------------------------------------------------------------------
/examples/multi-service-demo/k8s-yaml/service2/service.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Service
3 | metadata:
4 | name: service2
5 | labels:
6 | app.kubernetes.io/name: demo
7 | app.kubernetes.io/instance: service2
8 | spec:
9 | type: NodePort
10 | ports:
11 | - protocol: TCP
12 | port: 20222
13 | targetPort: 20222
--------------------------------------------------------------------------------
/examples/multi-service-demo/k8s-yaml/service3/service.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Service
3 | metadata:
4 | name: service3
5 | labels:
6 | app.kubernetes.io/name: demo
7 | app.kubernetes.io/instance: service3
8 | spec:
9 | type: NodePort
10 | ports:
11 | - protocol: TCP
12 | port: 20223
13 | targetPort: 20223
--------------------------------------------------------------------------------
/examples/multi-service-demo/values/service1.yaml:
--------------------------------------------------------------------------------
1 | fullnameOverride: "service1"
2 | replicaCount: 1
3 | port: 20221
4 |
5 | imagePullSecretsName: "default-registry-secret"
6 |
7 | image:
8 | repository: "koderover.tencentcloudcr.com/koderover-demo/service1"
9 | tag: "latest"
10 |
11 | resources:
12 | requests:
13 | cpu: 10m
14 | mem: 10Mi
15 |
16 | limits:
17 | cpu: 20m
18 | mem: 20Mi
19 |
--------------------------------------------------------------------------------
/examples/multi-service-demo/values/service2.yaml:
--------------------------------------------------------------------------------
1 | fullnameOverride: "service2"
2 | replicaCount: 1
3 | port: 20222
4 |
5 | imagePullSecretsName: "default-registry-secret"
6 |
7 | image:
8 | repository: "koderover.tencentcloudcr.com/koderover-demo/service2"
9 | tag: "latest"
10 |
11 | resources:
12 | requests:
13 | cpu: 10m
14 | mem: 10Mi
15 |
16 | limits:
17 | cpu: 20m
18 | mem: 20Mi
19 |
--------------------------------------------------------------------------------
/examples/multi-service-demo/values/service3.yaml:
--------------------------------------------------------------------------------
1 | fullnameOverride: "service3"
2 | replicaCount: 1
3 | port: 20223
4 |
5 | imagePullSecretsName: "default-registry-secret"
6 |
7 | image:
8 | repository: "koderover.tencentcloudcr.com/koderover-demo/service3"
9 | tag: "latest"
10 |
11 | resources:
12 | requests:
13 | cpu: 10m
14 | mem: 10Mi
15 |
16 | limits:
17 | cpu: 20m
18 | mem: 20Mi
19 |
20 |
--------------------------------------------------------------------------------
/examples/nginx/Dockerfile:
--------------------------------------------------------------------------------
1 | from koderover.tencentcloudcr.com/koderover-demo/nginx
2 | add ./index.html /usr/share/nginx/html
--------------------------------------------------------------------------------
/examples/nginx/README.md:
--------------------------------------------------------------------------------
1 | # nginx
2 |
3 |
--------------------------------------------------------------------------------
/examples/nginx/index.html:
--------------------------------------------------------------------------------
1 |
2 | Hello koderover!
3 |
--------------------------------------------------------------------------------
/examples/nginx/yaml/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koderover/zadig/2995eacaea155ad93f66a78a072a036ecba503a6/examples/nginx/yaml/.gitkeep
--------------------------------------------------------------------------------
/examples/nginx/yaml/redis/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koderover/zadig/2995eacaea155ad93f66a78a072a036ecba503a6/examples/nginx/yaml/redis/.gitkeep
--------------------------------------------------------------------------------
/examples/nginx/yaml/redis/redis.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
2 | kind: Deployment
3 | metadata:
4 | name: redis-master
5 | labels:
6 | app: redis
7 | spec:
8 | selector:
9 | matchLabels:
10 | app: redis
11 | role: master
12 | tier: backend
13 | replicas: 1
14 | template:
15 | metadata:
16 | labels:
17 | app: redis
18 | role: master
19 | tier: backend
20 | spec:
21 | containers:
22 | - name: master
23 | image: k8s.gcr.io/redis:e2e # or just image: redis
24 | resources:
25 | limits:
26 | cpu: 100m
27 | memory: 100Mi
28 | ports:
29 | - containerPort: 6379
--------------------------------------------------------------------------------
/examples/pytest-demo/fail_test.py:
--------------------------------------------------------------------------------
1 | def square(x):
2 | return x * x
3 |
4 | def test_the_square_of_negative_5_is_negative_25():
5 | assert square(-5) == -25
6 |
--------------------------------------------------------------------------------
/examples/pytest-demo/pass_test.py:
--------------------------------------------------------------------------------
1 | def increase(x):
2 | return x + 1
3 |
4 | def test_increase_1_to_2021_is_2022():
5 | assert increase(2021) == 2022
6 |
7 | def square(x):
8 | return x * x
9 |
10 | def test_the_square_of_5_is_25():
11 | assert square(5) == 25
12 |
--------------------------------------------------------------------------------
/examples/simple-service/nginx-yaml/nginx.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Service
3 | metadata:
4 | name: nginx
5 | spec:
6 | ports:
7 | - name: http
8 | port: 80
9 | targetPort: 80
10 | selector:
11 | app: nginx
12 |
13 | ---
14 |
15 | apiVersion: apps/v1
16 | kind: Deployment
17 | metadata:
18 | name: nginx
19 | spec:
20 | selector:
21 | matchLabels:
22 | app: nginx
23 | replicas: 1
24 | template:
25 | metadata:
26 | labels:
27 | app: nginx
28 | spec:
29 | containers:
30 | - name: nginx
31 | image: koderover.tencentcloudcr.com/koderover-demo/nginx:v1
32 | ports:
33 | - containerPort: 80
34 | resources:
35 | limits:
36 | cpu: 100m
37 | memory: 100Mi
38 |
--------------------------------------------------------------------------------
/examples/simple-service/service-yaml/c.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Service
3 | metadata:
4 | name: c
5 | labels:
6 | app: c
7 | spec:
8 | ports:
9 | - name: http
10 | port: 80
11 | targetPort: 8082
12 | selector:
13 | app: c
14 |
15 | ---
16 |
17 | apiVersion: apps/v1
18 | kind: Deployment
19 | metadata:
20 | name: c
21 | labels:
22 | app: c
23 | spec:
24 | selector:
25 | matchLabels:
26 | app: c
27 | replicas: 1
28 | template:
29 | metadata:
30 | labels:
31 | app: c
32 | spec:
33 | containers:
34 | - name: myapp-3
35 | image: koderover.tencentcloudcr.com/koderover-demo/myapp-3:v0.1__linux_amd64
36 | imagePullPolicy: Always
37 | command: ["/myapp-3"]
38 | ports:
39 | - containerPort: 8082
40 | resources:
41 | limits:
42 | cpu: 100m
43 | memory: 100Mi
44 |
--------------------------------------------------------------------------------
/examples/sonarqube-scanner-gradle/README.md:
--------------------------------------------------------------------------------
1 | # SonarQube Scanner for Gradle
2 |
3 | This example demonstrates how to analyze a simple project built with [Gradle](https://gradle.org/).
4 |
5 | ## Prerequisites
6 |
7 | * [SonarQube](http://www.sonarqube.org/downloads/) 9.9 LTS or Latest
8 | * A gradle wrapper is included that bundles gradle. All other required plugins will be pulled by gradle as needed.
9 |
10 | ## Usage
11 |
12 | Run the following command (updating the sonar.host.url property as appropriate):
13 |
14 | * On Unix-like systems:
15 | `./gradlew -Dsonar.host.url=http://myhost:9000 sonar`
16 | * On Windows:
17 | `.\gradlew.bat -D'sonar.host.url=http://myhost:9000' sonar`
18 |
19 | ## Coverage
20 |
21 | To get the project [test coverage](https://community.sonarsource.com/t/coverage-test-data-importing-jacoco-coverage-report-in-xml-format) computed, add gradle task `jacocoTestReport` to your command line.
22 |
--------------------------------------------------------------------------------
/examples/sonarqube-scanner-gradle/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-XX:MetaspaceSize=512M -XX:MaxMetaspaceSize=512M
2 |
--------------------------------------------------------------------------------
/examples/sonarqube-scanner-gradle/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koderover/zadig/2995eacaea155ad93f66a78a072a036ecba503a6/examples/sonarqube-scanner-gradle/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/examples/sonarqube-scanner-gradle/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-8.0.1-bin.zip
4 | networkTimeout=10000
5 | zipStoreBase=GRADLE_USER_HOME
6 | zipStorePath=wrapper/dists
7 |
--------------------------------------------------------------------------------
/examples/sonarqube-scanner-gradle/settings.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * This settings file was generated by the Gradle 'init' task.
3 | *
4 | * The settings file is used to specify which projects to include in your build.
5 | * In a single project build this file can be empty or even removed.
6 | *
7 | * Detailed information about configuring a multi-project build in Gradle can be found
8 | * in the user guide at https://docs.gradle.org/3.5/userguide/multi_project_builds.html
9 | */
10 |
11 | /*
12 | // To declare projects as part of a multi-project build use the 'include' method
13 | include 'shared'
14 | include 'api'
15 | include 'services:webservice'
16 | */
17 |
18 | rootProject.name = 'sonarqube-scanner-gradle'
19 |
--------------------------------------------------------------------------------
/examples/sonarqube-scanner-gradle/src/main/java/com/acme/App.java:
--------------------------------------------------------------------------------
1 | package com.acme;
2 |
3 | public class App {
4 | public String getGreeting() {
5 | return "Hello world.";
6 | }
7 |
8 | public static void main(String[] args) {
9 | System.out.println(new App().getGreeting());
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/examples/sonarqube-scanner-gradle/src/test/java/com/acme/AppTest.java:
--------------------------------------------------------------------------------
1 | package com.acme;
2 |
3 | import org.junit.jupiter.api.Test;
4 |
5 | import static org.junit.jupiter.api.Assertions.assertNotNull;
6 | public class AppTest {
7 | @Test
8 | public void testAppHasAGreeting() {
9 | App classUnderTest = new App();
10 | assertNotNull(classUnderTest.getGreeting(), "app should have a greeting");
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/examples/spring-boot-demo/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM koderover.tencentcloudcr.com/koderover-demo/openjdk:11
2 |
3 | WORKDIR /app
4 |
5 | COPY spring-boot-swagger-2.1.0.RELEASE.jar /app/
--------------------------------------------------------------------------------
/examples/spring-boot-demo/spring-boot-swagger.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/examples/spring-boot-demo/src/main/java/com/neo/SwaggerApplication.java:
--------------------------------------------------------------------------------
1 |
2 | package com.neo;
3 |
4 | import org.springframework.boot.SpringApplication;
5 | import org.springframework.boot.autoconfigure.SpringBootApplication;
6 |
7 |
8 | @SpringBootApplication
9 | public class SwaggerApplication {
10 |
11 | public static void main(String[] args) {
12 | SpringApplication.run(SwaggerApplication.class, args);
13 | }
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/examples/spring-boot-demo/src/main/java/com/neo/model/User.java:
--------------------------------------------------------------------------------
1 | package com.neo.model;
2 |
3 | public class User {
4 | private Long id;
5 | private String name;
6 | private int age;
7 |
8 | public Long getId() {
9 | return id;
10 | }
11 |
12 | public void setId(Long id) {
13 | this.id = id;
14 | }
15 |
16 | public String getName() {
17 | return name;
18 | }
19 |
20 | public void setName(String name) {
21 | this.name = name;
22 | }
23 |
24 | public int getAge() {
25 | return age;
26 | }
27 |
28 | public void setAge(int age) {
29 | this.age = age;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/examples/spring-boot-demo/src/main/java/com/neo/repository/MessageRepository.java:
--------------------------------------------------------------------------------
1 |
2 | package com.neo.repository;
3 |
4 | import com.neo.model.Message;
5 |
6 | import java.util.List;
7 |
8 | public interface MessageRepository {
9 |
10 | List findAll();
11 |
12 | Message save(Message message);
13 |
14 | Message update(Message message);
15 |
16 | Message updateText(Message message);
17 |
18 | Message findMessage(Long id);
19 |
20 | void deleteMessage(Long id);
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/examples/spring-boot-demo/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | logging.level.io.swagger.models.parameters.AbstractSerializableParameter=error
--------------------------------------------------------------------------------
/examples/spring-boot-demo/src/main/resources/logback.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/examples/spring-boot-demo/src/test/java/com/neo/SwaggerApplicationTests.java:
--------------------------------------------------------------------------------
1 |
2 | package com.neo;
3 |
4 |
5 |
6 | import org.junit.Test;
7 |
8 | public class SwaggerApplicationTests {
9 |
10 | @Test
11 | public void test() {
12 | }
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/examples/spring-cloud-grayscale-with-eureka/eureka-server/Dockerfile:
--------------------------------------------------------------------------------
1 | # Start with a base image containing Java runtime
2 | FROM openjdk:22-jdk-slim
3 |
4 | # Add a volume pointing to /tmp
5 | VOLUME /tmp
6 |
7 | EXPOSE 8761
8 | ARG JAR_FILE=target/*.jar
9 | ADD ${JAR_FILE} app.jar
10 |
11 | # Run the jar file
12 | ENTRYPOINT ["java", "-jar", "/app.jar"]
13 |
--------------------------------------------------------------------------------
/examples/spring-cloud-grayscale-with-eureka/eureka-server/deploy/deployment.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: apps/v1
2 | kind: Deployment
3 | metadata:
4 | name: eureka-server
5 | spec:
6 | replicas: 1
7 | selector:
8 | matchLabels:
9 | app: eureka-server
10 | template:
11 | metadata:
12 | labels:
13 | app: eureka-server
14 | spec:
15 | containers:
16 | - name: gateway
17 | image: koderover.tencentcloudcr.com/test/eureka:latest
18 | ports:
19 | - containerPort: 8761
20 |
--------------------------------------------------------------------------------
/examples/spring-cloud-grayscale-with-eureka/eureka-server/deploy/ingress.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: networking.k8s.io/v1
2 | kind: Ingress
3 | metadata:
4 | annotations:
5 | nginx.ingress.kubernetes.io/proxy-connect-timeout: "120"
6 | nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
7 | nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"
8 | nginx.ingress.kubernetes.io/ssl-redirect: "false"
9 | name: eureka-ingress
10 | spec:
11 | ingressClassName: koderover
12 | rules:
13 | - host: eureka-test.8slan.com
14 | http:
15 | paths:
16 | - backend:
17 | service:
18 | name: eureka-server
19 | port:
20 | number: 8761
21 | path: /
22 | pathType: ImplementationSpecific
--------------------------------------------------------------------------------
/examples/spring-cloud-grayscale-with-eureka/eureka-server/deploy/service.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Service
3 | metadata:
4 | name: eureka-server
5 | spec:
6 | selector:
7 | app: eureka-server
8 | ports:
9 | - protocol: TCP
10 | port: 8761
11 | targetPort: 8761
12 | type: ClusterIP
--------------------------------------------------------------------------------
/examples/spring-cloud-grayscale-with-eureka/eureka-server/src/main/java/org/example/EurekaServerApplication.java:
--------------------------------------------------------------------------------
1 | package org.example;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 | import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
6 |
7 | @SpringBootApplication
8 | @EnableEurekaServer // Enable Eureka Server functionality
9 | public class EurekaServerApplication {
10 |
11 | public static void main(String[] args) {
12 | SpringApplication.run(EurekaServerApplication.class, args);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/examples/spring-cloud-grayscale-with-eureka/eureka-server/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | server.port=8761
2 |
3 | eureka.client.registerWithEureka=false
4 | eureka.client.fetchRegistry=false
5 | eureka.server.enableSelfPreservation=false
6 |
--------------------------------------------------------------------------------
/examples/spring-cloud-grayscale-with-eureka/gateway/Dockerfile:
--------------------------------------------------------------------------------
1 | # Start with a base image containing Java runtime
2 | FROM openjdk:22-jdk-slim
3 |
4 | # Add a volume pointing to /tmp
5 | VOLUME /tmp
6 |
7 | EXPOSE 8000
8 | ARG JAR_FILE=target/*.jar
9 | ADD ${JAR_FILE} app.jar
10 |
11 | # Run the jar file
12 | ENTRYPOINT ["java", "-jar", "/app.jar"]
13 |
--------------------------------------------------------------------------------
/examples/spring-cloud-grayscale-with-eureka/gateway/deploy/deployment.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: apps/v1
2 | kind: Deployment
3 | metadata:
4 | name: springcloud-gateway
5 | spec:
6 | replicas: 1
7 | selector:
8 | matchLabels:
9 | app: springcloud-gateway
10 | template:
11 | metadata:
12 | labels:
13 | app: springcloud-gateway
14 | spec:
15 | containers:
16 | - name: gateway
17 | image: koderover.tencentcloudcr.com/test/springcloud-gateway:latest
18 | imagePullPolicy: Always
19 | ports:
20 | - containerPort: 8000
21 |
--------------------------------------------------------------------------------
/examples/spring-cloud-grayscale-with-eureka/gateway/deploy/ingress.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: networking.k8s.io/v1
2 | kind: Ingress
3 | metadata:
4 | annotations:
5 | nginx.ingress.kubernetes.io/proxy-connect-timeout: "120"
6 | nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
7 | nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"
8 | nginx.ingress.kubernetes.io/ssl-redirect: "false"
9 | name: gateway-ingress
10 | spec:
11 | ingressClassName: koderover
12 | rules:
13 | - host: springcloud-gateway.8slan.com
14 | http:
15 | paths:
16 | - backend:
17 | service:
18 | name: springcloud-gateway
19 | port:
20 | number: 8000
21 | path: /
22 | pathType: ImplementationSpecific
--------------------------------------------------------------------------------
/examples/spring-cloud-grayscale-with-eureka/gateway/deploy/service.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Service
3 | metadata:
4 | name: springcloud-gateway
5 | spec:
6 | selector:
7 | app: springcloud-gateway
8 | ports:
9 | - protocol: TCP
10 | port: 8000
11 | targetPort: 8000
12 | type: ClusterIP
--------------------------------------------------------------------------------
/examples/spring-cloud-grayscale-with-eureka/gateway/src/main/java/org/example/GatewayApplication.java:
--------------------------------------------------------------------------------
1 | package org.example;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 |
6 | @SpringBootApplication
7 | public class GatewayApplication {
8 | public static void main(String[] args) {
9 | SpringApplication.run(GatewayApplication.class, args);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/examples/spring-cloud-grayscale-with-eureka/service1/Dockerfile:
--------------------------------------------------------------------------------
1 | # Start with a base image containing Java runtime
2 | FROM openjdk:22-jdk-slim
3 |
4 | # Add a volume pointing to /tmp
5 | VOLUME /tmp
6 |
7 | EXPOSE 8000
8 | ARG JAR_FILE=target/*.jar
9 | ADD ${JAR_FILE} app.jar
10 |
11 | # Run the jar file
12 | ENTRYPOINT ["java", "-jar", "/app.jar"]
13 |
--------------------------------------------------------------------------------
/examples/spring-cloud-grayscale-with-eureka/service1/deploy/grayscale/deployment.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: apps/v1
2 | kind: Deployment
3 | metadata:
4 | name: service1-gray
5 | spec:
6 | replicas: 1
7 | selector:
8 | matchLabels:
9 | app: service1-gray
10 | template:
11 | metadata:
12 | labels:
13 | app: service1-gray
14 | spec:
15 | containers:
16 | - name: springcloud-service1
17 | image: koderover.tencentcloudcr.com/test/springcloud-service1:gray
18 | imagePullPolicy: Always
19 | ports:
20 | - containerPort: 8000
21 |
--------------------------------------------------------------------------------
/examples/spring-cloud-grayscale-with-eureka/service1/deploy/grayscale/service.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Service
3 | metadata:
4 | name: service1-gray
5 | spec:
6 | selector:
7 | app: service1-gray
8 | ports:
9 | - protocol: TCP
10 | port: 8000
11 | targetPort: 8000
12 | type: ClusterIP
--------------------------------------------------------------------------------
/examples/spring-cloud-grayscale-with-eureka/service1/deploy/production/deployment.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: apps/v1
2 | kind: Deployment
3 | metadata:
4 | name: service1
5 | spec:
6 | replicas: 1
7 | selector:
8 | matchLabels:
9 | app: service1
10 | template:
11 | metadata:
12 | labels:
13 | app: service1
14 | spec:
15 | containers:
16 | - name: springcloud-service1
17 | image: koderover.tencentcloudcr.com/test/springcloud-service1:latest
18 | imagePullPolicy: Always
19 | ports:
20 | - containerPort: 8000
21 |
--------------------------------------------------------------------------------
/examples/spring-cloud-grayscale-with-eureka/service1/deploy/production/service.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Service
3 | metadata:
4 | name: service1
5 | spec:
6 | selector:
7 | app: service1
8 | ports:
9 | - protocol: TCP
10 | port: 8000
11 | targetPort: 8000
12 | type: ClusterIP
--------------------------------------------------------------------------------
/examples/spring-cloud-grayscale-with-eureka/service1/src/main/java/org/example/GreetingController.java:
--------------------------------------------------------------------------------
1 | package org.example;
2 |
3 | import org.springframework.web.bind.annotation.GetMapping;
4 | import org.springframework.web.bind.annotation.RequestMapping;
5 | import org.springframework.web.bind.annotation.RestController;
6 |
7 | @RestController
8 | @RequestMapping("/greeting")
9 | public class GreetingController {
10 |
11 | @GetMapping
12 | public String getGreeting() {
13 | return "Hello from Service 1 - GRAYSCALE VERSION";
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/examples/spring-cloud-grayscale-with-eureka/service1/src/main/java/org/example/Service1Application.java:
--------------------------------------------------------------------------------
1 | package org.example;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
6 |
7 | @SpringBootApplication
8 | @EnableDiscoveryClient
9 | public class Service1Application {
10 |
11 | public static void main(String[] args) {
12 | SpringApplication.run(Service1Application.class, args);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/examples/spring-cloud-grayscale-with-eureka/service1/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | spring.application.name=service-1-gray
2 | server.port=8000
3 |
4 | eureka.client.serviceUrl.defaultZone=http://eureka-server:8761/eureka/
5 | eureka.client.registerWithEureka=true
6 | eureka.client.fetchRegistry=true
7 | eureka.instance.prefer-ip-address=true
8 |
9 | gateway.url=http://springcloud-gateway:8000
--------------------------------------------------------------------------------
/examples/spring-cloud-grayscale-with-eureka/service2/Dockerfile:
--------------------------------------------------------------------------------
1 | # Start with a base image containing Java runtime
2 | FROM openjdk:22-jdk-slim
3 |
4 | # Add a volume pointing to /tmp
5 | VOLUME /tmp
6 |
7 | EXPOSE 8000
8 | ARG JAR_FILE=target/*.jar
9 | ADD ${JAR_FILE} app.jar
10 |
11 | # Run the jar file
12 | ENTRYPOINT ["java", "-jar", "/app.jar"]
13 |
--------------------------------------------------------------------------------
/examples/spring-cloud-grayscale-with-eureka/service2/deploy/grayscale/deployment.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: apps/v1
2 | kind: Deployment
3 | metadata:
4 | name: service2-gray
5 | spec:
6 | replicas: 1
7 | selector:
8 | matchLabels:
9 | app: service2-gray
10 | template:
11 | metadata:
12 | labels:
13 | app: service2-gray
14 | spec:
15 | containers:
16 | - name: springcloud-service2
17 | image: koderover.tencentcloudcr.com/test/springcloud-service2:gray
18 | imagePullPolicy: Always
19 | ports:
20 | - containerPort: 8000
21 |
--------------------------------------------------------------------------------
/examples/spring-cloud-grayscale-with-eureka/service2/deploy/grayscale/service.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Service
3 | metadata:
4 | name: service2-gray
5 | spec:
6 | selector:
7 | app: service2-gray
8 | ports:
9 | - protocol: TCP
10 | port: 8000
11 | targetPort: 8000
12 | type: ClusterIP
--------------------------------------------------------------------------------
/examples/spring-cloud-grayscale-with-eureka/service2/deploy/production/deployment.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: apps/v1
2 | kind: Deployment
3 | metadata:
4 | name: service2
5 | spec:
6 | replicas: 1
7 | selector:
8 | matchLabels:
9 | app: service2
10 | template:
11 | metadata:
12 | labels:
13 | app: service2
14 | spec:
15 | containers:
16 | - name: springcloud-service2
17 | image: koderover.tencentcloudcr.com/test/springcloud-service2:latest
18 | imagePullPolicy: Always
19 | ports:
20 | - containerPort: 8000
21 |
--------------------------------------------------------------------------------
/examples/spring-cloud-grayscale-with-eureka/service2/deploy/production/service.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Service
3 | metadata:
4 | name: service2
5 | spec:
6 | selector:
7 | app: service2
8 | ports:
9 | - protocol: TCP
10 | port: 8000
11 | targetPort: 8000
12 | type: ClusterIP
--------------------------------------------------------------------------------
/examples/spring-cloud-grayscale-with-eureka/service2/src/main/java/org/example/GreetingClient.java:
--------------------------------------------------------------------------------
1 | package org.example;
2 |
3 | import org.springframework.cloud.openfeign.FeignClient;
4 | import org.springframework.web.bind.annotation.GetMapping;
5 | import org.springframework.web.bind.annotation.RequestHeader;
6 |
7 | @FeignClient(name = "gateway", url="${gateway.url}")
8 | //@FeignClient(name="service-1")
9 | public interface GreetingClient {
10 | @GetMapping("/service1/greeting")
11 | String getGreeting(@RequestHeader("version") String version);
12 | }
13 |
--------------------------------------------------------------------------------
/examples/spring-cloud-grayscale-with-eureka/service2/src/main/java/org/example/GreetingController.java:
--------------------------------------------------------------------------------
1 | package org.example;
2 |
3 | import org.springframework.beans.factory.annotation.Autowired;
4 | import org.springframework.web.bind.annotation.GetMapping;
5 | import org.springframework.web.bind.annotation.RequestHeader;
6 | import org.springframework.web.bind.annotation.RequestMapping;
7 | import org.springframework.web.bind.annotation.RestController;
8 |
9 | @RestController
10 | @RequestMapping("/greeting")
11 | public class GreetingController {
12 |
13 | @Autowired
14 | private GreetingClient greetingClient;
15 |
16 | @GetMapping
17 | public String getGreeting(@RequestHeader("version") String version) {
18 | return greetingClient.getGreeting(version) + " - Processed by Service 2";
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/examples/spring-cloud-grayscale-with-eureka/service2/src/main/java/org/example/Service2Application.java:
--------------------------------------------------------------------------------
1 | package org.example;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
6 | import org.springframework.cloud.openfeign.EnableFeignClients;
7 |
8 | @SpringBootApplication
9 | @EnableDiscoveryClient
10 | @EnableFeignClients
11 | public class Service2Application {
12 |
13 | public static void main(String[] args) {
14 | SpringApplication.run(Service2Application.class, args);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/examples/spring-cloud-grayscale-with-eureka/service2/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | spring.application.name=service-2
2 | server.port=8000
3 |
4 | eureka.client.serviceUrl.defaultZone=http://eureka-server:8761/eureka/
5 | eureka.client.registerWithEureka=true
6 | eureka.client.fetchRegistry=true
7 | eureka.instance.prefer-ip-address=true
8 |
9 | gateway.url=http://springcloud-gateway:8000
--------------------------------------------------------------------------------
/examples/spring-cloud-grayscale-with-eureka/service3/Dockerfile:
--------------------------------------------------------------------------------
1 | # Start with a base image containing Java runtime
2 | FROM openjdk:22-jdk-slim
3 |
4 | # Add a volume pointing to /tmp
5 | VOLUME /tmp
6 |
7 | EXPOSE 8000
8 | ARG JAR_FILE=target/*.jar
9 | ADD ${JAR_FILE} app.jar
10 |
11 | # Run the jar file
12 | ENTRYPOINT ["java", "-jar", "/app.jar"]
13 |
--------------------------------------------------------------------------------
/examples/spring-cloud-grayscale-with-eureka/service3/deploy/grayscale/deployment.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: apps/v1
2 | kind: Deployment
3 | metadata:
4 | name: service3-gray
5 | spec:
6 | replicas: 1
7 | selector:
8 | matchLabels:
9 | app: service3-gray
10 | template:
11 | metadata:
12 | labels:
13 | app: service3-gray
14 | spec:
15 | containers:
16 | - name: springcloud-service3
17 | image: koderover.tencentcloudcr.com/test/springcloud-service3:gray
18 | imagePullPolicy: Always
19 | ports:
20 | - containerPort: 8000
21 |
--------------------------------------------------------------------------------
/examples/spring-cloud-grayscale-with-eureka/service3/deploy/grayscale/service.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Service
3 | metadata:
4 | name: service3-gray
5 | spec:
6 | selector:
7 | app: service3-gray
8 | ports:
9 | - protocol: TCP
10 | port: 8000
11 | targetPort: 8000
12 | type: ClusterIP
--------------------------------------------------------------------------------
/examples/spring-cloud-grayscale-with-eureka/service3/deploy/production/deployment.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: apps/v1
2 | kind: Deployment
3 | metadata:
4 | name: service3
5 | spec:
6 | replicas: 1
7 | selector:
8 | matchLabels:
9 | app: service3
10 | template:
11 | metadata:
12 | labels:
13 | app: service3
14 | spec:
15 | containers:
16 | - name: springcloud-service3
17 | image: koderover.tencentcloudcr.com/test/springcloud-service3:latest
18 | imagePullPolicy: Always
19 | ports:
20 | - containerPort: 8000
21 |
--------------------------------------------------------------------------------
/examples/spring-cloud-grayscale-with-eureka/service3/deploy/production/service.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Service
3 | metadata:
4 | name: service3
5 | spec:
6 | selector:
7 | app: service3
8 | ports:
9 | - protocol: TCP
10 | port: 8000
11 | targetPort: 8000
12 | type: ClusterIP
--------------------------------------------------------------------------------
/examples/spring-cloud-grayscale-with-eureka/service3/src/main/java/org/example/GreetingClient.java:
--------------------------------------------------------------------------------
1 | package org.example;
2 |
3 | import org.springframework.cloud.openfeign.FeignClient;
4 | import org.springframework.web.bind.annotation.GetMapping;
5 | import org.springframework.web.bind.annotation.RequestHeader;
6 |
7 | @FeignClient(name = "gateway", url="${gateway.url}")
8 | public interface GreetingClient {
9 | @GetMapping("/service2/greeting")
10 | String getGreeting(@RequestHeader("version") String version);
11 | }
12 |
--------------------------------------------------------------------------------
/examples/spring-cloud-grayscale-with-eureka/service3/src/main/java/org/example/GreetingController.java:
--------------------------------------------------------------------------------
1 | package org.example;
2 |
3 | import org.springframework.beans.factory.annotation.Autowired;
4 | import org.springframework.web.bind.annotation.GetMapping;
5 | import org.springframework.web.bind.annotation.RequestHeader;
6 | import org.springframework.web.bind.annotation.RequestMapping;
7 | import org.springframework.web.bind.annotation.RestController;
8 |
9 | @RestController
10 | @RequestMapping("/greeting")
11 | public class GreetingController {
12 |
13 | @Autowired
14 | private GreetingClient greetingClient;
15 |
16 | @GetMapping
17 | public String getGreeting(@RequestHeader("version") String version) {
18 | return greetingClient.getGreeting(version) + " - Processed by Service 3";
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/examples/spring-cloud-grayscale-with-eureka/service3/src/main/java/org/example/Service3Application.java:
--------------------------------------------------------------------------------
1 | package org.example;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
6 | import org.springframework.cloud.openfeign.EnableFeignClients;
7 |
8 | @SpringBootApplication
9 | @EnableDiscoveryClient
10 | @EnableFeignClients
11 | public class Service3Application {
12 |
13 | public static void main(String[] args) {
14 | SpringApplication.run(Service3Application.class, args);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/examples/spring-cloud-grayscale-with-eureka/service3/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | spring.application.name=service-3
2 | server.port=8000
3 |
4 | eureka.client.serviceUrl.defaultZone=http://eureka-server:8761/eureka/
5 | eureka.client.registerWithEureka=true
6 | eureka.client.fetchRegistry=true
7 | eureka.instance.prefer-ip-address=true
8 |
9 | gateway.url=http://springcloud-gateway:8000
10 |
--------------------------------------------------------------------------------
/examples/test-demo/go.mod:
--------------------------------------------------------------------------------
1 | module test-demo
2 |
3 | go 1.16
4 |
5 | require (
6 | github.com/onsi/ginkgo/v2 v2.0.0
7 | github.com/onsi/gomega v1.17.0
8 | )
--------------------------------------------------------------------------------
/examples/version-demo/README.md:
--------------------------------------------------------------------------------
1 | ## Zadig 中的构建变量透传 Demo
2 | ### Build
3 |
4 | ```
5 | $ make default
6 |
7 | build the version
8 | build done.
9 |
10 | $ ./build/version.linux
11 |
12 | Version(hard code): 0.1
13 | ```
14 | ### Version output
15 |
16 | ```
17 | $ ./build/version.linux version
18 |
19 | Version:
20 | GitBranch:
21 | CommitId:
22 | PR:
23 | Build Date:
24 | Go Version:
25 | OS/Arch:
26 | Build URL:
27 | ```
28 |
--------------------------------------------------------------------------------
/examples/version-demo/go.mod:
--------------------------------------------------------------------------------
1 | module version
2 |
3 | go 1.16
4 |
--------------------------------------------------------------------------------
/examples/version-demo/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "fmt"
5 | "os"
6 |
7 | "version/utils"
8 | )
9 |
10 | func main() {
11 |
12 | args := os.Args
13 | if len(args) >= 2 && args[1] == "version" {
14 | v := utils.GetVersion()
15 | fmt.Printf("Version: %s\nBranch: %s\nCommit: %s\nPR: %s\nBuild Time: %s\nGo Version: %s\nOS/Arch: %s\nBuild URL: %s\n", v.Version, v.GitBranch, v.GitCommit,v.GitPR, v.BuildDate, v.GoVersion, v.Platform,v.BuildURL)
16 | } else {
17 | fmt.Printf("Version(hard code): %s\n", "0.1")
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/examples/voting-app/.gitignore:
--------------------------------------------------------------------------------
1 | /*/dotnet/*/obj
--------------------------------------------------------------------------------
/examples/voting-app/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM python:3.6-alpine
2 |
3 | RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
4 |
5 | RUN apk update && \
6 | apk add bash && \
7 | pip install selenium pytest pytest-html -i https://mirrors.aliyun.com/pypi/simple/
--------------------------------------------------------------------------------
/examples/voting-app/architecture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koderover/zadig/2995eacaea155ad93f66a78a072a036ecba503a6/examples/voting-app/architecture.png
--------------------------------------------------------------------------------
/examples/voting-app/chart/templates/worker.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: apps/v1
2 | kind: Deployment
3 | metadata:
4 | labels:
5 | app: worker
6 | name: worker
7 | spec:
8 | replicas: {{ .Values.services.worker.replicas }}
9 | selector:
10 | matchLabels:
11 | app: worker
12 | template:
13 | metadata:
14 | labels:
15 | app: worker
16 | spec:
17 | containers:
18 | - image: {{ .Values.services.worker.image }}
19 | imagePullPolicy: {{ .Values.imagePullPolicy }}
20 | name: worker-e2e
21 | resources:
22 | limits:
23 | memory: {{ .Values.resources.limits.memory }}
24 | cpu: {{ .Values.resources.limits.cpu }}
25 | imagePullSecrets:
26 | - name: {{ .Values.imagePullSecretsName }}
27 |
--------------------------------------------------------------------------------
/examples/voting-app/chart/values.yaml:
--------------------------------------------------------------------------------
1 | # Default values for chart.
2 | # This is a YAML-formatted file.
3 | # Declare variables to be passed into your templates.
4 |
5 | imagePullPolicy: Always
6 | imagePullSecretsName: default-registry-secret
7 |
8 | services:
9 | vote:
10 | port: 5000
11 | image: koderover.tencentcloudcr.com/koderover-demo/examplevotingapp-vote:base
12 | replicas: 1
13 |
14 | result:
15 | port: 5001
16 | image: koderover.tencentcloudcr.com/koderover-demo/examplevotingapp-result:base
17 | replicas: 1
18 |
19 | worker:
20 | image: koderover.tencentcloudcr.com/koderover-demo/examplevotingapp-worker:base
21 | replicas: 1
22 |
23 | redis:
24 | port: 6379
25 | image: redis:alpine
26 | replicas: 1
27 |
28 | db:
29 | port: 5432
30 | image: postgres:9.4
31 | replicas: 1
32 |
33 | resources:
34 | limits:
35 | cpu: 50m
36 | memory: 50Mi
--------------------------------------------------------------------------------
/examples/voting-app/freestyle-k8s-specifications/db/db-deployment.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: apps/v1
2 | kind: Deployment
3 | metadata:
4 | labels:
5 | app: db
6 | name: db
7 | spec:
8 | replicas: 1
9 | selector:
10 | matchLabels:
11 | app: db
12 | template:
13 | metadata:
14 | labels:
15 | app: db
16 | spec:
17 | containers:
18 | - image: postgres:9.4
19 | name: postgres
20 | ports:
21 | - containerPort: 5432
22 | name: postgres
23 | volumeMounts:
24 | - mountPath: /var/lib/postgresql/data
25 | name: db-data
26 | env:
27 | - name: POSTGRES_HOST_AUTH_METHOD
28 | value: trust
29 | resources:
30 | limits:
31 | memory: 50Mi
32 | cpu: 50m
33 | volumes:
34 | - name: db-data
35 | emptyDir: {}
36 |
37 |
--------------------------------------------------------------------------------
/examples/voting-app/freestyle-k8s-specifications/db/db-service.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Service
3 | metadata:
4 | labels:
5 | app: db
6 | name: db
7 | spec:
8 | type: ClusterIP
9 | ports:
10 | - name: "db-service"
11 | port: 5432
12 | targetPort: 5432
13 | selector:
14 | app: db
15 |
16 |
--------------------------------------------------------------------------------
/examples/voting-app/freestyle-k8s-specifications/redis/redis-deployment.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: apps/v1
2 | kind: Deployment
3 | metadata:
4 | labels:
5 | app: redis
6 | name: redis
7 | spec:
8 | replicas: 1
9 | selector:
10 | matchLabels:
11 | app: redis
12 | template:
13 | metadata:
14 | labels:
15 | app: redis
16 | spec:
17 | containers:
18 | - image: redis:alpine
19 | name: redis
20 | ports:
21 | - containerPort: 6379
22 | name: redis
23 | volumeMounts:
24 | - mountPath: /data
25 | name: redis-data
26 | resources:
27 | limits:
28 | memory: 50Mi
29 | cpu: 50m
30 | volumes:
31 | - name: redis-data
32 | emptyDir: {}
33 |
34 |
--------------------------------------------------------------------------------
/examples/voting-app/freestyle-k8s-specifications/redis/redis-service.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Service
3 | metadata:
4 | labels:
5 | app: redis
6 | name: redis
7 | spec:
8 | type: ClusterIP
9 | ports:
10 | - name: "redis-service"
11 | port: 6379
12 | targetPort: 6379
13 | selector:
14 | app: redis
15 |
16 |
--------------------------------------------------------------------------------
/examples/voting-app/freestyle-k8s-specifications/result/result-deployment.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: apps/v1
2 | kind: Deployment
3 | metadata:
4 | labels:
5 | app: result
6 | name: result-rc-origin
7 | spec:
8 | replicas: 1
9 | selector:
10 | matchLabels:
11 | app: result
12 | template:
13 | metadata:
14 | labels:
15 | app: result
16 | spec:
17 | containers:
18 | - image: dockersamples/examplevotingapp_result:before
19 | name: result-e2e
20 | ports:
21 | - containerPort: 80
22 | name: result
23 | resources:
24 | limits:
25 | memory: 50Mi
26 | cpu: 50m
27 |
--------------------------------------------------------------------------------
/examples/voting-app/freestyle-k8s-specifications/result/result-service.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Service
3 | metadata:
4 | labels:
5 | app: result
6 | version: rc-origin
7 | name: result
8 | spec:
9 | type: NodePort
10 | ports:
11 | - name: "result-service"
12 | port: 5001
13 | targetPort: 80
14 | selector:
15 | app: result
16 | ---
17 | apiVersion: networking.k8s.io/v1
18 | kind: Ingress
19 | metadata:
20 | name: result
21 | annotations:
22 | nginx.ingress.kubernetes.io/rewrite-target: /
23 | spec:
24 | rules:
25 | - host: result-e2e-10x-$Namespace$.ko.coderover.cn
26 | http:
27 | paths:
28 | - path: /
29 | pathType: Prefix
30 | backend:
31 | service:
32 | name: result
33 | port:
34 | number: 5001
35 |
--------------------------------------------------------------------------------
/examples/voting-app/freestyle-k8s-specifications/vote/vote-deployment.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: apps/v1
2 | kind: Deployment
3 | metadata:
4 | labels:
5 | app: vote
6 | name: vote-rc-origin
7 | spec:
8 | replicas: 1
9 | selector:
10 | matchLabels:
11 | app: vote
12 | version: rc-origin
13 | template:
14 | metadata:
15 | labels:
16 | app: vote
17 | version: rc-origin
18 | spec:
19 | containers:
20 | - image: dockersamples/examplevotingapp_vote:before
21 | name: vote-e2e
22 | ports:
23 | - containerPort: 80
24 | name: vote
25 | resources:
26 | limits:
27 | memory: 50Mi
28 | cpu: 50m
29 |
--------------------------------------------------------------------------------
/examples/voting-app/freestyle-k8s-specifications/vote/vote-service.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Service
3 | metadata:
4 | labels:
5 | app: vote
6 | name: vote
7 | spec:
8 | type: NodePort
9 | ports:
10 | - name: "vote-service"
11 | port: 5000
12 | targetPort: 80
13 | selector:
14 | app: vote
15 | version: rc-origin
16 | ---
17 | apiVersion: networking.k8s.io/v1
18 | kind: Ingress
19 | metadata:
20 | name: vote
21 | annotations:
22 | nginx.ingress.kubernetes.io/rewrite-target: /
23 | spec:
24 | rules:
25 | - host: vote-e2e-10x-$Namespace$.ko.coderover.cn
26 | http:
27 | paths:
28 | - path: /
29 | pathType: Prefix
30 | backend:
31 | service:
32 | name: vote
33 | port:
34 | number: 5000
35 |
--------------------------------------------------------------------------------
/examples/voting-app/freestyle-k8s-specifications/worker/worker-deployment.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: apps/v1
2 | kind: Deployment
3 | metadata:
4 | labels:
5 | app: worker
6 | name: worker
7 | spec:
8 | replicas: 1
9 | selector:
10 | matchLabels:
11 | app: worker
12 | template:
13 | metadata:
14 | labels:
15 | app: worker
16 | spec:
17 | containers:
18 | - image: dockersamples/examplevotingapp_worker
19 | name: worker-e2e
20 | resources:
21 | limits:
22 | memory: 50Mi
23 | cpu: 50m
24 |
--------------------------------------------------------------------------------
/examples/voting-app/function-test/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koderover/zadig/2995eacaea155ad93f66a78a072a036ecba503a6/examples/voting-app/function-test/.gitkeep
--------------------------------------------------------------------------------
/examples/voting-app/function-test/fail/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koderover/zadig/2995eacaea155ad93f66a78a072a036ecba503a6/examples/voting-app/function-test/fail/.gitkeep
--------------------------------------------------------------------------------
/examples/voting-app/function-test/pass/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koderover/zadig/2995eacaea155ad93f66a78a072a036ecba503a6/examples/voting-app/function-test/pass/.gitkeep
--------------------------------------------------------------------------------
/examples/voting-app/function-test/pass2/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koderover/zadig/2995eacaea155ad93f66a78a072a036ecba503a6/examples/voting-app/function-test/pass2/.gitkeep
--------------------------------------------------------------------------------
/examples/voting-app/result/.dockerignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 |
--------------------------------------------------------------------------------
/examples/voting-app/result/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM node:10-slim
2 |
3 | WORKDIR /app
4 |
5 | RUN npm install -g nodemon
6 |
7 | COPY package*.json ./
8 |
9 | RUN npm ci \
10 | && npm cache clean --force \
11 | && mv /app/node_modules /node_modules
12 |
13 | COPY . .
14 |
15 | ENV PORT 80
16 |
17 | EXPOSE 80
18 |
19 | CMD ["node", "server.js"]
20 |
--------------------------------------------------------------------------------
/examples/voting-app/result/dotnet/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM microsoft/dotnet:2.1-sdk-nanoserver-sac2016 as builder
2 |
3 | WORKDIR /Result
4 | COPY Result/Result.csproj .
5 | RUN dotnet restore
6 |
7 | COPY /Result .
8 | RUN dotnet publish -c Release -o /out Result.csproj
9 |
10 | # app image
11 | FROM microsoft/dotnet:2.1-aspnetcore-runtime-nanoserver-sac2016
12 |
13 | WORKDIR /app
14 | ENTRYPOINT ["dotnet", "Result.dll"]
15 |
16 | COPY --from=builder /out .
--------------------------------------------------------------------------------
/examples/voting-app/result/dotnet/Dockerfile.1809:
--------------------------------------------------------------------------------
1 | FROM microsoft/dotnet:2.1-sdk-nanoserver-1809 as builder
2 |
3 | WORKDIR /Result
4 | COPY Result/Result.csproj .
5 | RUN dotnet restore
6 |
7 | COPY /Result .
8 | RUN dotnet publish -c Release -o /out Result.csproj
9 |
10 | # app image
11 | FROM microsoft/dotnet:2.1-aspnetcore-runtime-nanoserver-1809
12 |
13 | WORKDIR /app
14 | ENTRYPOINT ["dotnet", "Result.dll"]
15 |
16 | COPY --from=builder /out .
--------------------------------------------------------------------------------
/examples/voting-app/result/dotnet/Result/Data/IResultData.cs:
--------------------------------------------------------------------------------
1 | using Result.Models;
2 |
3 | namespace Result.Data
4 | {
5 | public interface IResultData
6 | {
7 | ResultsModel GetResults();
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/examples/voting-app/result/dotnet/Result/Hubs/ResultsHub.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNetCore.SignalR;
2 |
3 | namespace Result.Hubs
4 | {
5 | public class ResultsHub : Hub
6 | {
7 | //no public methods, only used for push from PublishRTesultsTimer
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/examples/voting-app/result/dotnet/Result/Models/ResultsModel.cs:
--------------------------------------------------------------------------------
1 | namespace Result.Models
2 | {
3 | public class ResultsModel
4 | {
5 | public int OptionA { get; set; }
6 |
7 | public int OptionB { get; set; }
8 |
9 | public int VoteCount { get; set; }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/examples/voting-app/result/dotnet/Result/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Threading.Tasks;
6 | using Microsoft.AspNetCore;
7 | using Microsoft.AspNetCore.Hosting;
8 | using Microsoft.Extensions.Configuration;
9 | using Microsoft.Extensions.Logging;
10 |
11 | namespace Result
12 | {
13 | public class Program
14 | {
15 | public static void Main(string[] args)
16 | {
17 | CreateWebHostBuilder(args).Build().Run();
18 | }
19 |
20 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
21 | WebHost.CreateDefaultBuilder(args)
22 | .UseStartup();
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/examples/voting-app/result/dotnet/Result/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "iisSettings": {
3 | "windowsAuthentication": false,
4 | "anonymousAuthentication": true,
5 | "iisExpress": {
6 | "applicationUrl": "http://localhost:56785",
7 | "sslPort": 0
8 | }
9 | },
10 | "profiles": {
11 | "IIS Express": {
12 | "commandName": "IISExpress",
13 | "launchBrowser": true,
14 | "environmentVariables": {
15 | "ASPNETCORE_ENVIRONMENT": "Development"
16 | }
17 | },
18 | "Result": {
19 | "commandName": "Project",
20 | "launchBrowser": true,
21 | "environmentVariables": {
22 | "ASPNETCORE_ENVIRONMENT": "Development"
23 | },
24 | "applicationUrl": "https://localhost:5001;http://localhost:5000"
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/examples/voting-app/result/dotnet/Result/Result.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp2.1
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/examples/voting-app/result/dotnet/Result/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Debug",
5 | "System": "Information",
6 | "Microsoft": "Information"
7 | }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/examples/voting-app/result/dotnet/Result/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Voting": {
3 | "OptionA": "Cats",
4 | "OptionB": "Dogs"
5 | },
6 | "ResultsTimer": {
7 | "PublishMilliseconds": 2500
8 | },
9 | "ConnectionStrings": {
10 | "ResultData": "Server=mysql;Port=4000;Database=votes;User=root;SslMode=None"
11 | },
12 | "Logging": {
13 | "LogLevel": {
14 | "Default": "Warning"
15 | }
16 | },
17 | "AllowedHosts": "*"
18 | }
19 |
--------------------------------------------------------------------------------
/examples/voting-app/result/dotnet/Result/libman.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "1.0",
3 | "defaultProvider": "unpkg",
4 | "libraries": [
5 | {
6 | "library": "@aspnet/signalr@1.0.3",
7 | "destination": "wwwroot/lib/signalr/",
8 | "files": [
9 | "dist/browser/signalr.js",
10 | "dist/browser/signalr.min.js"
11 | ]
12 | }
13 | ]
14 | }
--------------------------------------------------------------------------------
/examples/voting-app/result/dotnet/Result/wwwroot/css/site.min.css:
--------------------------------------------------------------------------------
1 | body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}.carousel-caption p{font-size:20px;line-height:1.4}.carousel-inner .item img[src$=".svg"]{width:100%}#qrCode{margin:15px}@media screen and (max-width:767px){.carousel-caption{display:none}}
--------------------------------------------------------------------------------
/examples/voting-app/result/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "result",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "server.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "author": "",
10 | "license": "MIT",
11 | "dependencies": {
12 | "async": "^3.1.0",
13 | "body-parser": "^1.19.0",
14 | "cookie-parser": "^1.4.4",
15 | "express": "^4.17.1",
16 | "method-override": "^3.0.0",
17 | "pg": "^7.12.1",
18 | "socket.io": "^2.2.0",
19 | "stoppable": "^1.1.0"
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/examples/voting-app/result/tests/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM wernight/phantomjs
2 |
3 | USER root
4 | RUN sed -i "s/deb.debian.org/mirrors.aliyun.com/g" /etc/apt/sources.list
5 | RUN sed -i "s/security.debian.org/mirrors.aliyun.com/g" /etc/apt/sources.list
6 |
7 | RUN apt update && apt install -y curl
8 | # RUN apt-get update && apt-get install -qy \
9 | # ca-certificates \
10 | # bzip2 \
11 | # curl \
12 | # libfontconfig \
13 | # --no-install-recommends
14 | # RUN yarn config set registry https://registry.npm.taobao.org/
15 | # RUN yarn global add --verbose phantomjs-prebuilt
16 | ADD . /app
17 | WORKDIR /app
18 | CMD ["/app/tests.sh"]
19 |
--------------------------------------------------------------------------------
/examples/voting-app/result/tests/render.js:
--------------------------------------------------------------------------------
1 | var system = require('system');
2 | var page = require('webpage').create();
3 | var url = system.args[1];
4 |
5 | page.onLoadFinished = function() {
6 | setTimeout(function(){
7 | console.log(page.content);
8 | phantom.exit();
9 | }, 1000);
10 | };
11 |
12 | page.open(url, function() {
13 | page.evaluate(function() {
14 | });
15 | });
16 |
--------------------------------------------------------------------------------
/examples/voting-app/result/tests/tests.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | while ! timeout 1 bash -c "echo > /dev/tcp/vote/80"; do
4 | sleep 1
5 | done
6 |
7 | curl -sS -X POST --data "vote=b" http://vote > /dev/null
8 | sleep 10
9 |
10 | if phantomjs render.js http://result | grep -q '1 vote'; then
11 | echo -e "\\e[42m------------"
12 | echo -e "\\e[92mTests passed"
13 | echo -e "\\e[42m------------"
14 | exit 0
15 | else
16 | echo -e "\\e[41m------------"
17 | echo -e "\\e[91mTests failed"
18 | echo -e "\\e[41m------------"
19 | exit 1
20 | fi
21 |
--------------------------------------------------------------------------------
/examples/voting-app/vote/Dockerfile:
--------------------------------------------------------------------------------
1 | # Using official python runtime base image
2 | FROM python:3.6-alpine
3 |
4 | # Set the application directory
5 | WORKDIR /app
6 |
7 | # Install our requirements.txt
8 | ADD requirements.txt /app/requirements.txt
9 | RUN pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/
10 |
11 | # Copy our code from the current folder to /app inside the container
12 | ADD . /app
13 |
14 | # Make port 80 available for links and/or publish
15 | EXPOSE 80
16 |
17 | # Define our command to be run when launching the container
18 | CMD ["gunicorn", "app:app", "-b", "0.0.0.0:80", "--log-file", "-", "--access-logfile", "-", "--workers", "4", "--keep-alive", "0"]
19 |
--------------------------------------------------------------------------------
/examples/voting-app/vote/dotnet/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM microsoft/dotnet:2.1-sdk-nanoserver-sac2016 as builder
2 |
3 | WORKDIR /Vote
4 | COPY Vote/Vote.csproj .
5 | RUN dotnet restore
6 |
7 | COPY /Vote .
8 | RUN dotnet publish -c Release -o /out Vote.csproj
9 |
10 | # app image
11 | FROM microsoft/dotnet:2.1-aspnetcore-runtime-nanoserver-sac2016
12 |
13 | WORKDIR /app
14 | ENTRYPOINT ["dotnet", "Vote.dll"]
15 |
16 | COPY --from=builder /out .
--------------------------------------------------------------------------------
/examples/voting-app/vote/dotnet/Dockerfile.1809:
--------------------------------------------------------------------------------
1 | FROM microsoft/dotnet:2.1-sdk-nanoserver-1809 as builder
2 |
3 | WORKDIR /Vote
4 | COPY Vote/Vote.csproj .
5 | RUN dotnet restore
6 |
7 | COPY /Vote .
8 | RUN dotnet publish -c Release -o /out Vote.csproj
9 |
10 | # app image
11 | FROM microsoft/dotnet:2.1-aspnetcore-runtime-nanoserver-1809
12 |
13 | WORKDIR /app
14 | ENTRYPOINT ["dotnet", "Vote.dll"]
15 |
16 | COPY --from=builder /out .
--------------------------------------------------------------------------------
/examples/voting-app/vote/dotnet/Vote/Messaging/IMessageQueue.cs:
--------------------------------------------------------------------------------
1 | using NATS.Client;
2 | using Vote.Messaging.Messages;
3 |
4 | namespace Vote.Messaging
5 | {
6 | public interface IMessageQueue
7 | {
8 | IConnection CreateConnection();
9 |
10 | void Publish(TMessage message) where TMessage : Message;
11 | }
12 | }
--------------------------------------------------------------------------------
/examples/voting-app/vote/dotnet/Vote/Messaging/MessageHelper.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using Vote.Messaging.Messages;
3 | using System.Text;
4 |
5 | namespace Vote.Messaging
6 | {
7 | public class MessageHelper
8 | {
9 | public static byte[] ToData(TMessage message)
10 | where TMessage : Message
11 | {
12 | var json = JsonConvert.SerializeObject(message);
13 | return Encoding.Unicode.GetBytes(json);
14 | }
15 |
16 | public static TMessage FromData(byte[] data)
17 | where TMessage : Message
18 | {
19 | var json = Encoding.Unicode.GetString(data);
20 | return (TMessage)JsonConvert.DeserializeObject(json);
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/examples/voting-app/vote/dotnet/Vote/Messaging/Messages/Events/VoteCastEvent.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Vote.Messaging.Messages
4 | {
5 | public class VoteCastEvent : Message
6 | {
7 | public override string Subject { get { return MessageSubject; } }
8 |
9 | public string VoterId {get; set;}
10 |
11 | public string Vote {get; set; }
12 |
13 | public static string MessageSubject = "events.vote.votecast";
14 | }
15 | }
--------------------------------------------------------------------------------
/examples/voting-app/vote/dotnet/Vote/Messaging/Messages/Message.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Vote.Messaging.Messages
4 | {
5 | public abstract class Message
6 | {
7 | public string CorrelationId { get; set; }
8 |
9 | public abstract string Subject { get; }
10 |
11 | public Message()
12 | {
13 | CorrelationId = Guid.NewGuid().ToString();
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/examples/voting-app/vote/dotnet/Vote/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Threading.Tasks;
6 | using Microsoft.AspNetCore;
7 | using Microsoft.AspNetCore.Hosting;
8 | using Microsoft.Extensions.Configuration;
9 | using Microsoft.Extensions.Logging;
10 |
11 | namespace Vote
12 | {
13 | public class Program
14 | {
15 | public static void Main(string[] args)
16 | {
17 | CreateWebHostBuilder(args).Build().Run();
18 | }
19 |
20 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
21 | WebHost.CreateDefaultBuilder(args)
22 | .UseStartup();
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/examples/voting-app/vote/dotnet/Vote/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "iisSettings": {
3 | "windowsAuthentication": false,
4 | "anonymousAuthentication": true,
5 | "iisExpress": {
6 | "applicationUrl": "http://localhost:6116",
7 | "sslPort": 44316
8 | }
9 | },
10 | "profiles": {
11 | "IIS Express": {
12 | "commandName": "IISExpress",
13 | "launchBrowser": true,
14 | "environmentVariables": {
15 | "ASPNETCORE_ENVIRONMENT": "Development"
16 | }
17 | },
18 | "Vote": {
19 | "commandName": "Project",
20 | "launchBrowser": true,
21 | "applicationUrl": "https://localhost:5001;http://localhost:5000",
22 | "environmentVariables": {
23 | "ASPNETCORE_ENVIRONMENT": "Development"
24 | }
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/examples/voting-app/vote/dotnet/Vote/Vote.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp2.1
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/examples/voting-app/vote/dotnet/Vote/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "MessageQueue": {
3 | "Enabled": false
4 | },
5 | "Logging": {
6 | "LogLevel": {
7 | "Default": "Debug",
8 | "System": "Information",
9 | "Microsoft": "Information"
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/examples/voting-app/vote/dotnet/Vote/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Voting": {
3 | "OptionA": "Cats",
4 | "OptionB": "Dogs"
5 | },
6 | "MessageQueue": {
7 | "Enabled": true,
8 | "Url": "nats://message-queue:4222"
9 | },
10 | "Logging": {
11 | "LogLevel": {
12 | "Default": "Information"
13 | }
14 | },
15 | "AllowedHosts": "*"
16 | }
17 |
--------------------------------------------------------------------------------
/examples/voting-app/vote/dotnet/Vote/wwwroot/css/site.min.css:
--------------------------------------------------------------------------------
1 | body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}.carousel-caption p{font-size:20px;line-height:1.4}.carousel-inner .item img[src$=".svg"]{width:100%}#qrCode{margin:15px}@media screen and (max-width:767px){.carousel-caption{display:none}}
--------------------------------------------------------------------------------
/examples/voting-app/vote/requirements.txt:
--------------------------------------------------------------------------------
1 | Flask
2 | Redis
3 | gunicorn
4 | pytest
--------------------------------------------------------------------------------
/examples/voting-app/vote/test_app.py:
--------------------------------------------------------------------------------
1 | import app
2 |
3 |
4 | def test_generate_voter_id():
5 | assert app.get_voter_id({}), "voter id is generated"
6 |
7 |
8 | def test_get_voter_id():
9 | assert app.get_voter_id({"voter_id": "12345"}) == "12345", "voter id is pre-defined"
10 |
--------------------------------------------------------------------------------
/examples/voting-app/worker/.gitignore:
--------------------------------------------------------------------------------
1 | target
2 | .idea
3 | worker.iml
--------------------------------------------------------------------------------
/examples/voting-app/worker/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | worker
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.jdt.core.javabuilder
10 |
11 |
12 |
13 |
14 | org.eclipse.m2e.core.maven2Builder
15 |
16 |
17 |
18 |
19 |
20 | org.eclipse.jdt.core.javanature
21 | org.eclipse.m2e.core.maven2Nature
22 |
23 |
24 |
--------------------------------------------------------------------------------
/examples/voting-app/worker/.settings/org.eclipse.jdt.apt.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | org.eclipse.jdt.apt.aptEnabled=false
3 |
--------------------------------------------------------------------------------
/examples/voting-app/worker/.settings/org.eclipse.jdt.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
3 | org.eclipse.jdt.core.compiler.compliance=1.7
4 | org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
5 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
6 | org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
7 | org.eclipse.jdt.core.compiler.processAnnotations=disabled
8 | org.eclipse.jdt.core.compiler.release=disabled
9 | org.eclipse.jdt.core.compiler.source=1.7
10 |
--------------------------------------------------------------------------------
/examples/voting-app/worker/.settings/org.eclipse.m2e.core.prefs:
--------------------------------------------------------------------------------
1 | activeProfiles=
2 | eclipse.preferences.version=1
3 | resolveWorkspaceProjects=true
4 | version=1
5 |
--------------------------------------------------------------------------------
/examples/voting-app/worker/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM mcr.microsoft.com/dotnet/sdk
2 |
3 | WORKDIR /code
4 |
5 | ADD src/Worker /code/src/Worker
6 |
7 | RUN dotnet restore -v minimal src/Worker \
8 | && dotnet publish -c Release -o "./" "src/Worker/"
9 |
10 | CMD dotnet src/Worker/Worker.dll
--------------------------------------------------------------------------------
/examples/voting-app/worker/Dockerfile.j:
--------------------------------------------------------------------------------
1 | FROM maven:3.5-jdk-8-alpine AS build
2 |
3 | WORKDIR /code
4 |
5 | RUN mkdir -p /root/.m2
6 | COPY settings.xml /root/.m2/settings.xml
7 | COPY pom.xml /code/pom.xml
8 | RUN mvn --batch-mode dependency:resolve
9 | RUN mvn --batch-mode verify
10 |
11 | # Adding source, compile and package into a fat jar
12 | COPY ["src/main", "/code/src/main"]
13 | RUN mvn --batch-mode package
14 |
15 | FROM openjdk:8-jre-alpine
16 |
17 | COPY --from=build /code/target/worker-1.0-SNAPSHOT.jar /worker-jar-with-dependencies.jar
18 |
19 | CMD ["java", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseCGroupMemoryLimitForHeap", "-jar", "/worker-jar-with-dependencies.jar"]
20 |
--------------------------------------------------------------------------------
/examples/voting-app/worker/dotnet/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM microsoft/dotnet:2.1-sdk-nanoserver-sac2016 as builder
2 |
3 | WORKDIR /Worker
4 | COPY Worker/Worker.csproj .
5 | RUN dotnet restore
6 |
7 | COPY /Worker .
8 | RUN dotnet publish -c Release -o /out Worker.csproj
9 |
10 | # app image
11 | FROM microsoft/dotnet:2.1-runtime-nanoserver-sac2016
12 |
13 | WORKDIR /app
14 | ENTRYPOINT ["dotnet", "Worker.dll"]
15 |
16 | COPY --from=builder /out .
--------------------------------------------------------------------------------
/examples/voting-app/worker/dotnet/Dockerfile.1809:
--------------------------------------------------------------------------------
1 | FROM microsoft/dotnet:2.1-sdk-nanoserver-1809 as builder
2 |
3 | WORKDIR /Worker
4 | COPY Worker/Worker.csproj .
5 | RUN dotnet restore
6 |
7 | COPY /Worker .
8 | RUN dotnet publish -c Release -o /out Worker.csproj
9 |
10 | # app image
11 | FROM microsoft/dotnet:2.1-aspnetcore-runtime-nanoserver-1809
12 |
13 | WORKDIR /app
14 | ENTRYPOINT ["dotnet", "Worker.dll"]
15 |
16 | COPY --from=builder /out .
--------------------------------------------------------------------------------
/examples/voting-app/worker/dotnet/Worker/Data/IVoteData.cs:
--------------------------------------------------------------------------------
1 | namespace Worker.Data
2 | {
3 | public interface IVoteData
4 | {
5 | void Set(string voterId, string vote);
6 | }
7 | }
--------------------------------------------------------------------------------
/examples/voting-app/worker/dotnet/Worker/Entities/Vote.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.DataAnnotations;
2 | using System.ComponentModel.DataAnnotations.Schema;
3 |
4 | namespace Worker.Entities
5 | {
6 | [Table("votes")]
7 | public class Vote
8 | {
9 | [Column("id")]
10 | [Key]
11 | public string VoterId { get; set; }
12 |
13 | [Column("vote")]
14 | public string VoteOption { get; set; }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/examples/voting-app/worker/dotnet/Worker/Entities/VoteContext.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore;
2 |
3 | namespace Worker.Entities
4 | {
5 | public class VoteContext : DbContext
6 | {
7 | private static bool _EnsureCreated;
8 | public VoteContext(DbContextOptions options) : base(options)
9 | {
10 | if (!_EnsureCreated)
11 | {
12 | Database.EnsureCreated();
13 | _EnsureCreated = true;
14 | }
15 | }
16 |
17 | public DbSet Votes { get; set; }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/examples/voting-app/worker/dotnet/Worker/Messaging/IMessageQueue.cs:
--------------------------------------------------------------------------------
1 | using NATS.Client;
2 | using Worker.Messaging.Messages;
3 |
4 | namespace Worker.Messaging
5 | {
6 | public interface IMessageQueue
7 | {
8 | IConnection CreateConnection();
9 |
10 | void Publish(TMessage message) where TMessage : Message;
11 | }
12 | }
--------------------------------------------------------------------------------
/examples/voting-app/worker/dotnet/Worker/Messaging/MessageHelper.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using Worker.Messaging.Messages;
3 | using System.Text;
4 |
5 | namespace Worker.Messaging
6 | {
7 | public class MessageHelper
8 | {
9 | public static byte[] ToData(TMessage message)
10 | where TMessage : Message
11 | {
12 | var json = JsonConvert.SerializeObject(message);
13 | return Encoding.Unicode.GetBytes(json);
14 | }
15 |
16 | public static TMessage FromData(byte[] data)
17 | where TMessage : Message
18 | {
19 | var json = Encoding.Unicode.GetString(data);
20 | return (TMessage)JsonConvert.DeserializeObject(json);
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/examples/voting-app/worker/dotnet/Worker/Messaging/Messages/Events/VoteCastEvent.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Worker.Messaging.Messages
4 | {
5 | public class VoteCastEvent : Message
6 | {
7 | public override string Subject { get { return MessageSubject; } }
8 |
9 | public string VoterId {get; set;}
10 |
11 | public string Vote {get; set; }
12 |
13 | public static string MessageSubject = "events.vote.votecast";
14 | }
15 | }
--------------------------------------------------------------------------------
/examples/voting-app/worker/dotnet/Worker/Messaging/Messages/Message.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Worker.Messaging.Messages
4 | {
5 | public abstract class Message
6 | {
7 | public string CorrelationId { get; set; }
8 |
9 | public abstract string Subject { get; }
10 |
11 | public Message()
12 | {
13 | CorrelationId = Guid.NewGuid().ToString();
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/examples/voting-app/worker/dotnet/Worker/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "MessageQueue": {
3 | "Url": "nats://message-queue:4222"
4 | },
5 | "ConnectionStrings": {
6 | "VoteData": "Server=mysql;Port=4000;Database=votes;User=root;SslMode=None"
7 | },
8 | "Logging": {
9 | "LogLevel": {
10 | "Default": "Information"
11 | }
12 | },
13 | "AllowedHosts": "*"
14 | }
15 |
--------------------------------------------------------------------------------
/examples/voting-app/worker/settings.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 | tencentmaven
8 | tencent maven
9 | http://mirrors.cloud.tencent.com/nexus/repository/maven-public/
10 | central
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/examples/voting-app/worker/src/Worker/Worker.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp2.0
5 | true
6 | Worker
7 | Exe
8 | Worker
9 | true
10 | 2.0.0
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/examples/website/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM nginx:1.16.0
2 |
3 | WORKDIR /website-example
4 |
5 | ADD index.html /website-example/
6 |
7 | ADD nginx.conf /etc/nginx/conf.d/default.conf
8 |
9 | EXPOSE 80
10 |
--------------------------------------------------------------------------------
/examples/website/nginx.conf:
--------------------------------------------------------------------------------
1 | log_format log '$remote_addr - $remote_user [$time_local] "$request" '
2 | '$status $bytes_sent $body_bytes_sent "$http_referer" '
3 | '"$http_user_agent" "$http_x_forwarded_for" '
4 | '$upstream_addr $host $sent_http_x_reqid $upstream_response_time $request_time';
5 |
6 | server {
7 | listen 80;
8 |
9 | access_log /var/log/nginx/access.log main;
10 | error_log /var/log/nginx/error.log;
11 |
12 | # Make site accessible from http://localhost/
13 |
14 | client_max_body_size 1024m;
15 | proxy_send_timeout 500s;
16 | proxy_read_timeout 500s;
17 |
18 | location / {
19 | root /website-example/;
20 | index index.html index.htm;
21 | }
22 | }
--------------------------------------------------------------------------------
/examples/website/yaml/website-example.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | apiVersion: v1
3 | kind: Service
4 | metadata:
5 | name: website-example
6 | labels:
7 | app: website-example
8 | spec:
9 | type: NodePort
10 | ports:
11 | - port: 80
12 | selector:
13 | app: website-example
14 | ---
15 | apiVersion: apps/v1
16 | kind: Deployment
17 | metadata:
18 | name: website-example
19 | spec:
20 | replicas: 1
21 | selector:
22 | matchLabels:
23 | app: website-example
24 | template:
25 | metadata:
26 | labels:
27 | app: website-example
28 | spec:
29 | containers:
30 | - name: website-example
31 | image: koderover.tencentcloudcr.com/koderover-demo/website-example:1.0.0
32 | ports:
33 | - containerPort: 80
34 |
--------------------------------------------------------------------------------
/hack/boilerplate.go.txt:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2022 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
--------------------------------------------------------------------------------
/pkg/cli/upgradeassistant/executor/executor.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2021 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package executor
18 |
19 | import (
20 | "github.com/koderover/zadig/v2/pkg/cli/upgradeassistant/cmd"
21 | )
22 |
23 | func Execute() error {
24 | return cmd.Execute()
25 | }
26 |
--------------------------------------------------------------------------------
/pkg/cli/upgradeassistant/internal/repository/models/organization.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2021 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package models
18 |
19 | type Organization struct {
20 | ID int `bson:"id" json:"id"`
21 | Token string `bson:"token,omitempty" json:"token,omitempty"`
22 | }
23 |
24 | func (Organization) TableName() string {
25 | return "organization"
26 | }
27 |
--------------------------------------------------------------------------------
/pkg/cli/upgradeassistant/internal/repository/models/project.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2022 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package models
18 |
19 | type Project struct {
20 | ProductName string `bson:"product_name" json:"product_name"`
21 | }
22 |
23 | func (Project) TableName() string {
24 | return "template_product"
25 | }
26 |
--------------------------------------------------------------------------------
/pkg/cli/upgradeassistant/internal/repository/orm/addmysql.sql:
--------------------------------------------------------------------------------
1 | use `%s`;
2 |
3 | ALTER TABLE `user` ADD `api_token` varchar(1024) NOT NULL DEFAULT '' COMMENT 'openAPIToken';
--------------------------------------------------------------------------------
/pkg/cli/upgradeassistant/internal/repository/orm/dropmysql.sql:
--------------------------------------------------------------------------------
1 | use `%s`;
2 |
3 | LOCK TABLES `user` WRITE;
4 | ALTER TABLE `user` DROP COLUMN `api_token`;
5 | UNLOCK TABLES;
--------------------------------------------------------------------------------
/pkg/cli/upgradeassistant/internal/upgradepath/upgradepath_suite_test.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2021 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package upgradepath
18 |
19 | import (
20 | "testing"
21 |
22 | . "github.com/onsi/ginkgo/v2"
23 | . "github.com/onsi/gomega"
24 | )
25 |
26 | func TestRoutes(t *testing.T) {
27 | RegisterFailHandler(Fail)
28 | RunSpecs(t, "upgrade path Suite")
29 | }
30 |
--------------------------------------------------------------------------------
/pkg/cli/zadig-agent/command/executor.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2023 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package command
18 |
19 | import (
20 | "github.com/koderover/zadig/v2/pkg/cli/zadig-agent/command/cmd"
21 | )
22 |
23 | func Execute() error {
24 | return cmd.Execute()
25 | }
26 |
--------------------------------------------------------------------------------
/pkg/cli/zadig-agent/config/version.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2023 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package config
18 |
19 | var (
20 | BuildAgentVersion = ""
21 | BuildGoVersion = ""
22 | BuildCommit = ""
23 | BuildTime = ""
24 | )
25 |
--------------------------------------------------------------------------------
/pkg/cli/zadig-agent/pkg/uninstall/uninstall.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2023 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package uninstall
18 |
19 | import "github.com/koderover/zadig/v2/pkg/cli/zadig-agent/internal/agent"
20 |
21 | func UnInstallAgent(agentCtl *agent.AgentController) {
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/pkg/cli/zadig-agent/util/os/cmd.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2023 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package os
18 |
19 | import "os"
20 |
21 | func GetWorkingDir() (string, error) {
22 | // get the path of the current working directory
23 | return os.Getwd()
24 | }
25 |
--------------------------------------------------------------------------------
/pkg/handler/cache/consts.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2022 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package cache
18 |
19 | const MsgSuccess = "success"
20 |
21 | const HeaderXData = "x-data"
22 |
--------------------------------------------------------------------------------
/pkg/microservice/aslan/core/common/repository/models/counter.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2021 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package models
18 |
19 | type Counter struct {
20 | ID string `bson:"_id"`
21 | Seq int64 `bson:"seq"`
22 | }
23 |
24 | func (Counter) TableName() string {
25 | return "counter"
26 | }
27 |
--------------------------------------------------------------------------------
/pkg/microservice/aslan/core/common/repository/models/image_tags.go:
--------------------------------------------------------------------------------
1 | package models
2 |
3 | import "go.mongodb.org/mongo-driver/bson/primitive"
4 |
5 | type ImageTags struct {
6 | ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"`
7 | RegistryID string `bson:"registry_id" json:"registry_id"`
8 | RegProvider string `bson:"reg_provider" json:"reg_provider"`
9 | ImageName string `bson:"image_name" json:"image_name"`
10 | Namespace string `bson:"namespace" json:"namespace"`
11 | ImageTags []*ImageTag `bson:"image_tags" json:"image_tags"`
12 | }
13 |
14 | type ImageTag struct {
15 | TagName string `bson:"tag_name" json:"tag_name"`
16 | Digest string `bson:"digest" json:"digest"`
17 | Created string `bson:"created" json:"created"`
18 | }
19 |
20 | func (ImageTags) TableName() string {
21 | return "image_tags"
22 | }
23 |
--------------------------------------------------------------------------------
/pkg/microservice/aslan/core/common/service/llm_test.go:
--------------------------------------------------------------------------------
1 | package service
2 |
3 | import (
4 | "reflect"
5 | "testing"
6 |
7 | "github.com/koderover/zadig/v2/pkg/microservice/aslan/core/common/repository/models"
8 | "github.com/koderover/zadig/v2/pkg/tool/llm"
9 | )
10 |
11 | func Test_newLLMClient(t *testing.T) {
12 | type args struct {
13 | llmIntegration *models.LLMIntegration
14 | }
15 | tests := []struct {
16 | name string
17 | args args
18 | want llm.ILLM
19 | wantErr bool
20 | }{
21 | // TODO: Add test cases.
22 | }
23 | for _, tt := range tests {
24 | t.Run(tt.name, func(t *testing.T) {
25 | got, err := NewLLMClient(tt.args.llmIntegration)
26 | if (err != nil) != tt.wantErr {
27 | t.Errorf("newLLMClient() error = %v, wantErr %v", err, tt.wantErr)
28 | return
29 | }
30 | if !reflect.DeepEqual(got, tt.want) {
31 | t.Errorf("newLLMClient() = %v, want %v", got, tt.want)
32 | }
33 | })
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/pkg/microservice/aslan/core/common/service/nsq/nsq.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2021 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package nsq
18 |
--------------------------------------------------------------------------------
/pkg/microservice/aslan/core/common/service/sae/client.go:
--------------------------------------------------------------------------------
1 | package sae
2 |
3 | import (
4 | "fmt"
5 |
6 | openapi "github.com/alibabacloud-go/darabonba-openapi/v2/client"
7 | sae "github.com/alibabacloud-go/sae-20190506/client"
8 | "github.com/alibabacloud-go/tea/tea"
9 |
10 | "github.com/koderover/zadig/v2/pkg/microservice/aslan/core/common/repository/models"
11 | )
12 |
13 | func NewClient(saeModel *models.SAE, regionID string) (result *sae.Client, err error) {
14 | config := &openapi.Config{
15 | AccessKeyId: tea.String(saeModel.AccessKeyId),
16 | AccessKeySecret: tea.String(saeModel.AccessKeySecret),
17 | }
18 |
19 | config.Endpoint = tea.String(fmt.Sprintf("sae.%s.aliyuncs.com", regionID))
20 | result, err = sae.NewClient(config)
21 | return result, err
22 | }
23 |
--------------------------------------------------------------------------------
/pkg/microservice/aslan/core/common/service/webhook/types.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2021 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package webhook
18 |
19 | type WebHook struct {
20 | Owner, Namespace, Repo, Address, Name string
21 | CodeHostID int
22 | IsManual bool
23 | }
24 |
--------------------------------------------------------------------------------
/pkg/microservice/aslan/core/common/types/service.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2023 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package types
18 |
19 | type ServiceWithVariable struct {
20 | ServiceName string `json:"service_name"`
21 | VariableYaml string `json:"variable_yaml"`
22 | VariableKVs []*RenderVariableKV `json:"variable_kvs"`
23 | }
24 |
--------------------------------------------------------------------------------
/pkg/microservice/aslan/core/common/types/types_suite_test.go:
--------------------------------------------------------------------------------
1 | package types_test
2 |
3 | import (
4 | "testing"
5 |
6 | . "github.com/onsi/ginkgo/v2"
7 | . "github.com/onsi/gomega"
8 | )
9 |
10 | func TestTypes(t *testing.T) {
11 | RegisterFailHandler(Fail)
12 | RunSpecs(t, "Types Suite")
13 | }
14 |
--------------------------------------------------------------------------------
/pkg/microservice/aslan/core/common/util/variables.go:
--------------------------------------------------------------------------------
1 | package util
2 |
3 | import (
4 | "fmt"
5 | "os"
6 |
7 | commonmodels "github.com/koderover/zadig/v2/pkg/microservice/aslan/core/common/repository/models"
8 | )
9 |
10 | func RenderEnv(data string, kvs []*commonmodels.KeyVal) string {
11 | mapper := func(data string) string {
12 | for _, envar := range kvs {
13 | if data != envar.Key {
14 | continue
15 | }
16 |
17 | return envar.Value
18 | }
19 |
20 | return fmt.Sprintf("$%s", data)
21 | }
22 | return os.Expand(data, mapper)
23 | }
24 |
--------------------------------------------------------------------------------
/pkg/microservice/aslan/core/log/service/ai/type.go:
--------------------------------------------------------------------------------
1 | package ai
2 |
3 | // BuildLogAnalysisPrompt TODO: need to be optimized
4 | const BuildLogAnalysisPrompt = `你是一个资深devops开发专家,我会提供一份用三重引号分割的构建过程中产生的日志数据,你需要按照要求生成对该日志的分析报告,在分析报告中,你需要根据输入的日志数据来分析此次构建的整体效率,
5 | 并重点分析日志中出现的异常问题,异常问题需要提供出现异常的位置,异常的原因,并提供高质量的异常解决方案;你的回答需要符合text格式,同时你的回答中不要复述我的问题,直接回答你的分析报告即可。
6 | `
7 |
--------------------------------------------------------------------------------
/pkg/microservice/aslan/core/release_plan/service/errors.go:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023 The KodeRover Authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package service
18 |
19 | import "github.com/pkg/errors"
20 |
21 | var (
22 | ErrPermissionDenied = errors.New("permission denied")
23 | )
24 |
--------------------------------------------------------------------------------
/pkg/microservice/aslan/core/release_plan/service/lock.go:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023 The KodeRover Authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package service
18 |
19 | import (
20 | "fmt"
21 | "github.com/koderover/zadig/v2/pkg/tool/cache"
22 | )
23 |
24 | func getLock(key string) *cache.RedisLock {
25 | return cache.NewRedisLock(fmt.Sprint("release-plan-lock-", key))
26 | }
27 |
--------------------------------------------------------------------------------
/pkg/microservice/aslan/core/system/handler/response.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2021 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package handler
18 |
19 | type ProxyConfig struct {
20 | HTTPAddr string `json:"HTTPAddr"`
21 | HTTPSAddr string `json:"HTTPSAddr"`
22 | Socks5Addr string `json:"Socks5Addr"`
23 | NoProxy string `json:"NoProxy"`
24 | }
25 |
--------------------------------------------------------------------------------
/pkg/microservice/aslan/core/workflow/service/webhook/webhook_suite_test.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2021 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package webhook
18 |
19 | import (
20 | "testing"
21 |
22 | . "github.com/onsi/ginkgo/v2"
23 | . "github.com/onsi/gomega"
24 | )
25 |
26 | func TestRoutes(t *testing.T) {
27 | RegisterFailHandler(Fail)
28 | RunSpecs(t, "webhook Suite")
29 | }
30 |
--------------------------------------------------------------------------------
/pkg/microservice/aslan/core/workflow/service/workflow/plugins/README.md:
--------------------------------------------------------------------------------
1 | # zadig-plugin
2 |
3 | Zadig offical plugins
4 |
--------------------------------------------------------------------------------
/pkg/microservice/aslan/core/workflow/service/workflow/plugins/jira-updater/v0.0.1/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM golang:1.24.1-alpine as build
2 |
3 | WORKDIR /app
4 |
5 | ENV CGO_ENABLED=0 GOOS=linux
6 | ENV GOPROXY=https://goproxy.cn,direct
7 | ENV GOCACHE=/gocache
8 |
9 | COPY go.mod go.sum ./
10 | COPY main.go main.go
11 |
12 | RUN go mod download
13 |
14 | RUN --mount=type=cache,id=gobuild,target=/gocache \
15 | go build -v -o /jira-updater main.go
16 |
17 | FROM alpine/git:v2.30.2
18 |
19 | # https://wiki.alpinelinux.org/wiki/Setting_the_timezone
20 | RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
21 | apk add tzdata && \
22 | cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
23 | echo Asia/Shanghai > /etc/timezone && \
24 | apk del tzdata
25 |
26 | WORKDIR /app
27 |
28 | COPY --from=build /jira-updater .
29 |
30 | ENTRYPOINT ["/app/jira-updater"]
31 |
--------------------------------------------------------------------------------
/pkg/microservice/aslan/core/workflow/service/workflow/plugins/jira-updater/v0.0.1/Makefile:
--------------------------------------------------------------------------------
1 | IMAGE_REPOSITORY = koderover.tencentcloudcr.com/koderover-public
2 | VERSION = v0.0.1
3 |
4 | build: MAKE_IMAGE ?= ${IMAGE_REPOSITORY}/jira-updater:${VERSION}
5 | build:
6 | @go mod init jira-updater
7 | @go mod tidy
8 | @docker buildx build -t ${MAKE_IMAGE} --platform linux/amd64,linux/arm64 -f Dockerfile --push .
--------------------------------------------------------------------------------
/pkg/microservice/aslan/core/workflow/service/workflow/workflow_suite_test.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2021 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package workflow
18 |
19 | import (
20 | "testing"
21 |
22 | . "github.com/onsi/ginkgo/v2"
23 | . "github.com/onsi/gomega"
24 | )
25 |
26 | func TestWorkflow(t *testing.T) {
27 | RegisterFailHandler(Fail)
28 | RunSpecs(t, "workflow Suite")
29 | }
30 |
--------------------------------------------------------------------------------
/pkg/microservice/aslan/doc.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2021 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | // Package aslan is the main backend microservice powering Zadig.
18 | package aslan
19 |
--------------------------------------------------------------------------------
/pkg/microservice/cron/config/config.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2021 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package config
18 |
19 | import (
20 | configbase "github.com/koderover/zadig/v2/pkg/config"
21 | )
22 |
23 | func CollieAPI() string {
24 | return configbase.CollieServiceAddress()
25 | }
26 |
--------------------------------------------------------------------------------
/pkg/microservice/hubserver/config/consts.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2021 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package config
18 |
19 | type K8SClusterStatus string
20 |
21 | const (
22 | Disconnected K8SClusterStatus = "disconnected"
23 | Pending K8SClusterStatus = "pending"
24 | Normal K8SClusterStatus = "normal"
25 | Abnormal K8SClusterStatus = "abnormal"
26 | )
27 |
--------------------------------------------------------------------------------
/pkg/microservice/picket/config/consts.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2021 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package config
18 |
19 | type RulesLogicalOperator string
20 |
21 | const (
22 | AND RulesLogicalOperator = "and"
23 | OR RulesLogicalOperator = "or"
24 | )
25 |
--------------------------------------------------------------------------------
/pkg/microservice/picket/core/evaluation/handler/router.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2021 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package handler
18 |
19 | import (
20 | "github.com/gin-gonic/gin"
21 | )
22 |
23 | type Router struct{}
24 |
25 | func (*Router) Inject(router *gin.RouterGroup) {
26 | roles := router.Group("evaluate")
27 | {
28 | roles.POST("", Evaluate)
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/pkg/microservice/podexec/config/config.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2021 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package config
18 |
19 | import (
20 | configbase "github.com/koderover/zadig/v2/pkg/config"
21 | )
22 |
23 | func HubServerAddr() string {
24 | return configbase.HubServerServiceAddress()
25 | }
26 |
--------------------------------------------------------------------------------
/pkg/microservice/reaper/config/const.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2021 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package config
18 |
19 | const (
20 | ConstructCachePath = "cache"
21 | FilepathParam = "${FILEPATH}"
22 | )
23 |
--------------------------------------------------------------------------------
/pkg/microservice/reaper/core/service/cmd/cmd.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2021 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package cmd
18 |
19 | import "os/exec"
20 |
21 | // Command ...
22 | type Command struct {
23 | Cmd *exec.Cmd
24 | // DisableTrace display command args
25 | DisableTrace bool
26 | // IgnoreError ingore command run error
27 | IgnoreError bool
28 | }
29 |
--------------------------------------------------------------------------------
/pkg/microservice/systemconfig/config/consts.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2021 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package config
18 |
19 | const (
20 | ENVMysqlDexDB = "MYSQL_DEX_DB"
21 | FeatureFlag = "feature-gates"
22 | )
23 |
--------------------------------------------------------------------------------
/pkg/microservice/systemconfig/core/features/repository/models/feature.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2021 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package models
18 |
19 | type Feature struct {
20 | Name string `bson:"name" json:"name"`
21 | Enabled bool `bson:"enabled" json:"enabled"`
22 | }
23 |
24 | func (Feature) TableName() string {
25 | return "feature"
26 | }
27 |
--------------------------------------------------------------------------------
/pkg/microservice/user/core/init/dex_database.sql:
--------------------------------------------------------------------------------
1 | CREATE DATABASE IF NOT EXISTS `%s`;
--------------------------------------------------------------------------------
/pkg/microservice/user/core/init/dm_role_template_initialization.sql:
--------------------------------------------------------------------------------
1 | INSERT INTO `role_template` (name, description, type)
2 | VALUES
3 | ('project-admin', '拥有执行项目中任何操作的权限', 1),
4 | ('read-only', '拥有指定项目中所有资源的读权限', 1),
5 | ('read-project-only', '拥有指定项目本身的读权限,无权限查看和操作项目内资源', 1);
--------------------------------------------------------------------------------
/pkg/microservice/user/core/init/role_template_initialization.sql:
--------------------------------------------------------------------------------
1 | INSERT INTO `role_template` (name, description, type) VALUES
2 | ("project-admin", "拥有执行项目中任何操作的权限", 1),
3 | ("read-only", "拥有指定项目中所有资源的读权限", 1),
4 | ("read-project-only", "拥有指定项目本身的读权限,无权限查看和操作项目内资源", 1)
5 | on duplicate key update id=id;
6 |
--------------------------------------------------------------------------------
/pkg/microservice/user/core/repository/instance.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2023 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package repository
18 |
19 | import (
20 | "gorm.io/gorm"
21 | )
22 |
23 | var DB *gorm.DB
24 | var DexDB *gorm.DB
25 |
--------------------------------------------------------------------------------
/pkg/microservice/user/core/repository/models/project.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2023 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package models
18 |
19 | type Project struct {
20 | ProductName string `bson:"product_name" json:"product_name"`
21 | }
22 |
23 | func (Project) TableName() string {
24 | return "template_product"
25 | }
26 |
--------------------------------------------------------------------------------
/pkg/microservice/user/core/repository/models/role_template.go:
--------------------------------------------------------------------------------
1 | package models
2 |
3 | type RoleTemplate struct {
4 | ID uint `gorm:"primarykey" json:"id"`
5 | Name string `gorm:"column:name" json:"name"`
6 | Description string `gorm:"column:description" json:"description"`
7 | Type int `gorm:"column:type" json:"type"`
8 |
9 | RoleTemplateActionBindings []RoleTemplateActionBinding `gorm:"foreignKey:RoleTemplateID;constraint:OnDelete:CASCADE;" json:"-"`
10 | RoleTemplateBindings []RoleTemplateBinding `gorm:"foreignKey:RoleTemplateID;constraint:OnDelete:CASCADE;" json:"-"`
11 | }
12 |
13 | func (RoleTemplate) TableName() string {
14 | return "role_template"
15 | }
16 |
--------------------------------------------------------------------------------
/pkg/setting/regexp.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2022 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package setting
18 |
19 | const ProjectKeyRegEx = `^[a-z-\d]+$`
20 |
--------------------------------------------------------------------------------
/pkg/shared/client/aslan/healthz.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2021 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package aslan
18 |
19 | // Healthz api/health
20 | func (c *Client) Healthz() error {
21 | url := "/health"
22 | _, err := c.Get(url)
23 | return err
24 | }
25 |
--------------------------------------------------------------------------------
/pkg/shared/handler/handler_suite_test.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2021 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package handler
18 |
19 | import (
20 | "testing"
21 |
22 | "github.com/onsi/ginkgo/v2"
23 | "github.com/onsi/gomega"
24 | )
25 |
26 | func TestRoutes(t *testing.T) {
27 | gomega.RegisterFailHandler(ginkgo.Fail)
28 | ginkgo.RunSpecs(t, "mongo tool Suite")
29 | }
30 |
--------------------------------------------------------------------------------
/pkg/shared/kube/resource/node.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2021 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package resource
18 |
19 | type Node struct {
20 | Labels []string `json:"labels"`
21 | Ready bool `json:"ready"`
22 | IP string `json:"ip"`
23 | }
24 |
--------------------------------------------------------------------------------
/pkg/tool/cache/icache.go:
--------------------------------------------------------------------------------
1 | // Forked from github.com/k8sgpt-ai/k8sgpt
2 | // Some parts of this file have been modified to make it functional in Zadig
3 |
4 | package cache
5 |
6 | import "github.com/koderover/zadig/v2/pkg/config"
7 |
8 | type ICache interface {
9 | Store(key string, data string) error
10 | Load(key string) (string, error)
11 | List() ([]string, error)
12 | Exists(key string) bool
13 | IsCacheDisabled() bool
14 | }
15 |
16 | type CacheType string
17 |
18 | var (
19 | CacheTypeRedis CacheType = "redis"
20 | CacheTypeMem CacheType = "memory"
21 | )
22 |
23 | // New returns a memory cache which implements the iCache interface
24 | func New(noCache bool, cacheType CacheType) ICache {
25 | switch cacheType {
26 | case CacheTypeRedis:
27 | return NewRedisCacheAI(config.RedisCommonCacheTokenDB(), noCache)
28 | case CacheTypeMem:
29 | return NewMemCache(noCache)
30 | default:
31 | return NewMemCache(noCache)
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/pkg/tool/crypto/sha1.go:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2022 The KodeRover Authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package crypto
18 |
19 | import (
20 | "crypto/sha1"
21 | "encoding/hex"
22 | )
23 |
24 | func Sha1(b []byte) string {
25 | s := sha1.New()
26 | s.Write(b)
27 | return hex.EncodeToString(s.Sum(nil))
28 | }
29 |
--------------------------------------------------------------------------------
/pkg/tool/dingtalk/error.go:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023 The KodeRover Authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package dingtalk
18 |
19 | import "github.com/pkg/errors"
20 |
21 | var (
22 | ErrApprovalFormNameExists = errors.New("approval form name already exists")
23 | )
24 |
--------------------------------------------------------------------------------
/pkg/tool/dingtalk/ratelimit.go:
--------------------------------------------------------------------------------
1 | package dingtalk
2 |
3 | import (
4 | "github.com/juju/ratelimit"
5 | )
6 |
7 | // DingTalk free version has a limit of 20 requests per second.
8 | // Set the limit to 16 to be safe.
9 | var limit = ratelimit.NewBucketWithRate(16, 1)
10 |
--------------------------------------------------------------------------------
/pkg/tool/dingtalk/validate.go:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023 The KodeRover Authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package dingtalk
18 |
19 | func Validate(ak, sk string) error {
20 | _, err := NewClient(ak, sk).RefreshAccessToken()
21 | return err
22 | }
23 |
--------------------------------------------------------------------------------
/pkg/tool/grafana/client_test.go:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023 The KodeRover Authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package grafana
18 |
19 | import "testing"
20 |
21 | func TestName(t *testing.T) {
22 | c := NewClient("http://localhost:3000", "glsa_nSJLiIrMNia9EHfefUoRH6EGpE9viaLl_d04d5394")
23 | c.ListAlert()
24 | }
25 |
--------------------------------------------------------------------------------
/pkg/tool/jenkins/client.go:
--------------------------------------------------------------------------------
1 | package jenkins
2 |
3 | import (
4 | "github.com/imroc/req/v3"
5 | )
6 |
7 | type Client struct {
8 | *req.Client
9 | User string
10 | Token string
11 | }
12 |
13 | func NewClient(host, user, token string) (client *Client) {
14 | client = &Client{
15 | Client: req.C().
16 | EnableInsecureSkipVerify().
17 | SetCommonBasicAuth(user, token).SetBaseURL(host),
18 | }
19 | return client
20 | }
21 |
--------------------------------------------------------------------------------
/pkg/tool/kodo/config.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2021 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package kodo
18 |
19 | // Config 为文件上传,资源管理等配置
20 | type Config struct {
21 | Zone *Zone //空间所在的机房
22 | UseHTTPS bool //是否使用https域名
23 | UseCdnDomains bool //是否使用cdn加速域名
24 | }
25 |
--------------------------------------------------------------------------------
/pkg/tool/kube/serializer/serializer_suite_test.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2021 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package serializer_test
18 |
19 | import (
20 | "testing"
21 |
22 | . "github.com/onsi/ginkgo/v2"
23 | . "github.com/onsi/gomega"
24 | )
25 |
26 | func TestRoutes(t *testing.T) {
27 | RegisterFailHandler(Fail)
28 | RunSpecs(t, "serializer Suite")
29 | }
30 |
--------------------------------------------------------------------------------
/pkg/tool/kube/updater/cloneset.go:
--------------------------------------------------------------------------------
1 | package updater
2 |
3 | import (
4 | "context"
5 | "fmt"
6 | "github.com/openkruise/kruise-api/apps/v1alpha1"
7 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
8 | "k8s.io/apimachinery/pkg/types"
9 | "sigs.k8s.io/controller-runtime/pkg/client"
10 | )
11 |
12 | func ScaleCloneSet(ns, name string, replicas int, cl client.Client) error {
13 | patchBytes := []byte(fmt.Sprintf(`{"spec":{"replicas": %d}}`, replicas))
14 | return PatchCloneSet(ns, name, patchBytes, cl)
15 | }
16 |
17 | func PatchCloneSet(ns, name string, patchBytes []byte, cl client.Client) error {
18 | return cl.Patch(context.TODO(), &v1alpha1.CloneSet{
19 | ObjectMeta: metav1.ObjectMeta{
20 | Namespace: ns,
21 | Name: name,
22 | },
23 | }, client.RawPatch(types.MergePatchType, patchBytes))
24 | }
25 |
--------------------------------------------------------------------------------
/pkg/tool/kube/util/time.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2021 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package util
18 |
19 | import "time"
20 |
21 | func FormatTime(t time.Time) string {
22 | return t.UTC().Format(time.RFC3339)
23 | }
24 |
25 | func ParseTime(s string) (time.Time, error) {
26 | return time.Parse(time.RFC3339, s)
27 | }
28 |
--------------------------------------------------------------------------------
/pkg/tool/mongo/mongo_suite_test.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2021 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package mongo_test
18 |
19 | import (
20 | "testing"
21 |
22 | . "github.com/onsi/ginkgo/v2"
23 | . "github.com/onsi/gomega"
24 | )
25 |
26 | func TestRoutes(t *testing.T) {
27 | RegisterFailHandler(Fail)
28 | RunSpecs(t, "mongo tool Suite")
29 | }
30 |
--------------------------------------------------------------------------------
/pkg/tool/remotedialer/types.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2021 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package remotedialer
18 |
19 | import "time"
20 |
21 | const (
22 | PingWaitDuration = 60 * time.Second
23 | PingWriteInterval = 5 * time.Second
24 | MaxRead = 8192
25 | HandshakeTimeOut = 10 * time.Second
26 | )
27 |
--------------------------------------------------------------------------------
/pkg/types/cron.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2022 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package types
18 |
19 | type CronTag string
20 |
21 | const (
22 | CleanDockerTag CronTag = "CleanDockerTag"
23 | )
24 |
--------------------------------------------------------------------------------
/pkg/types/env.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2022 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package types
18 |
19 | type EnvType string
20 |
21 | const (
22 | GeneralEnv EnvType = "general"
23 | ShareEnv EnvType = "share"
24 | )
25 |
26 | const DebugImage = "koderover.tencentcloudcr.com/koderover-public/zadig-debug:v0.1.0"
27 |
--------------------------------------------------------------------------------
/pkg/types/git.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2022 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package types
18 |
19 | type AuthType string
20 |
21 | const (
22 | SSHAuthType AuthType = "SSH"
23 | PrivateAccessTokenAuthType AuthType = "PrivateAccessToken"
24 | )
25 |
--------------------------------------------------------------------------------
/pkg/types/reaper.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2022 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package types
18 |
19 | type ReaperType string
20 |
21 | const (
22 | BuildReaperType ReaperType = "Build"
23 | TestReaperType ReaperType = "Test"
24 | ScanningReaperType ReaperType = "Scanning"
25 | )
26 |
27 | const (
28 | ScanningTypeSonar = "sonarQube"
29 | )
30 |
--------------------------------------------------------------------------------
/pkg/types/role_template.go:
--------------------------------------------------------------------------------
1 | package types
2 |
3 | type RoleTemplate struct {
4 | ID uint `json:"id"`
5 | Name string `json:"name"`
6 | Description string `json:"desc"`
7 | Type int `json:"type"`
8 | }
9 |
10 | type DetailedRoleTemplate struct {
11 | ID uint `json:"id"`
12 | Name string `json:"name"`
13 | Namespace string `json:"namespace"`
14 | Description string `json:"desc"`
15 | // ResourceActions represents a set of verbs with its corresponding resource.
16 | // the json response of this field `rules` is used for compatibility.
17 | ResourceActions []*ResourceAction `json:"rules"`
18 | }
19 |
--------------------------------------------------------------------------------
/pkg/types/step/step_archive_html.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2024 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package step
18 |
19 | type StepArchiveHtmlSpec struct {
20 | HtmlPath string `json:"html_path"`
21 | OutputPath string `json:"output_path"`
22 | }
23 |
--------------------------------------------------------------------------------
/pkg/util/clear.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2021 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package util
18 |
19 | import "reflect"
20 |
21 | func Clear(v interface{}) {
22 | p := reflect.ValueOf(v).Elem()
23 | p.Set(reflect.Zero(p.Type()))
24 | }
25 |
--------------------------------------------------------------------------------
/pkg/util/converter/converter_suite_test.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2021 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package converter_test
18 |
19 | import (
20 | "testing"
21 |
22 | . "github.com/onsi/ginkgo/v2"
23 | . "github.com/onsi/gomega"
24 | )
25 |
26 | func TestRoutes(t *testing.T) {
27 | RegisterFailHandler(Fail)
28 | RunSpecs(t, "converter Suite")
29 | }
30 |
--------------------------------------------------------------------------------
/pkg/util/fs/fs_suite_test.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2021 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package fs_test
18 |
19 | import (
20 | "testing"
21 |
22 | . "github.com/onsi/ginkgo/v2"
23 | . "github.com/onsi/gomega"
24 | )
25 |
26 | func TestRoutes(t *testing.T) {
27 | RegisterFailHandler(Fail)
28 | RunSpecs(t, "fs util Suite")
29 | }
30 |
--------------------------------------------------------------------------------
/pkg/util/fs/root.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2021 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package fs
18 |
19 | import (
20 | "io/fs"
21 | "os"
22 | )
23 |
24 | var root = os.DirFS("/")
25 |
26 | func Chroot(path string) {
27 | root = os.DirFS(path)
28 | }
29 |
30 | func Root() fs.FS {
31 | return root
32 | }
33 |
--------------------------------------------------------------------------------
/pkg/util/go.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2023 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package util
18 |
19 | import (
20 | "fmt"
21 | "runtime/debug"
22 | )
23 |
24 | func Go(fn func()) {
25 | go func() {
26 | defer func() {
27 | if err := recover(); err != nil {
28 | fmt.Println(err)
29 | debug.PrintStack()
30 | }
31 | }()
32 |
33 | fn()
34 | }()
35 | }
36 |
--------------------------------------------------------------------------------
/pkg/util/yaml/yaml_suite_test.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2021 The KodeRover Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | package yaml_test
18 |
19 | import (
20 | "testing"
21 |
22 | . "github.com/onsi/ginkgo/v2"
23 | . "github.com/onsi/gomega"
24 | )
25 |
26 | func TestRoutes(t *testing.T) {
27 | RegisterFailHandler(Fail)
28 | RunSpecs(t, "yaml util Suite")
29 | }
30 |
--------------------------------------------------------------------------------
/resource-server-nginx.conf:
--------------------------------------------------------------------------------
1 | log_format log '$remote_addr - $remote_user [$time_local] "$request" '
2 | '$status $bytes_sent $body_bytes_sent "$http_referer" '
3 | '"$http_user_agent" "$http_x_forwarded_for" '
4 | '$upstream_addr $host $sent_http_x_reqid $upstream_response_time $request_time';
5 |
6 | server {
7 | listen 80;
8 |
9 | access_log /var/log/nginx/access.log main;
10 | error_log /var/log/nginx/error.log;
11 |
12 | client_max_body_size 1024m;
13 | proxy_send_timeout 500s;
14 | proxy_read_timeout 500s;
15 |
16 | location / {
17 | root /app;
18 | }
19 |
20 |
21 | }
--------------------------------------------------------------------------------
/ut.file:
--------------------------------------------------------------------------------
1 | ./pkg/microservice/cron/core/service/client
2 | ./pkg/microservice/reaper/core/service/cmd
3 | ./pkg/microservice/reaper/core/service/meta
4 | ./pkg/microservice/reaper/core/service/reaper
5 | ./pkg/microservice/aslan/core/common/service/registry
6 | ./pkg/util/converter
7 |
--------------------------------------------------------------------------------
/zadig-ci.yaml:
--------------------------------------------------------------------------------
1 | version: '1.0'
2 | stages:
3 | - clone
4 | - ut
5 | steps:
6 | clone:
7 | git: github
8 | repo: 'https://github.com/koderover/Zadig'
9 | revision: main
10 | title: git clone
11 | type: git-clone
12 | working_directory: '${{KR_VOLUME_PATH}}'
13 | stage: clone
14 | ut:
15 | title: unit test
16 | stage: ut
17 | image: golang:1.16.5
18 | commands:
19 | - go env -w GOCACHE="/koderover/volume/buildcache"
20 | - go env -w GOMODCACHE="/koderover/volume/go/pkg/mod" GO111MODULE="on"
21 | - export GOPROXY=https://goproxy.cn,https://goproxy.io,direct
22 | - cd Zadig
23 | - go test -coverprofile=coverage.xml $(cat ut.file)
24 | working_directory: '${{KR_VOLUME_PATH}}'
25 |
--------------------------------------------------------------------------------