| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- package seecoder.devcloud.api;
- import lombok.Data;
- import org.hibernate.validator.constraints.URL;
- import org.springframework.boot.context.properties.ConfigurationProperties;
- import org.springframework.context.annotation.Configuration;
- import org.springframework.validation.annotation.Validated;
- import javax.validation.Valid;
- import javax.validation.constraints.NotEmpty;
- @Data
- @Configuration
- @ConfigurationProperties("seecoder")
- @Validated
- public class ApplicationProperties {
- @Valid
- private Gitlab gitlab = new Gitlab();
- @Valid
- private Docker docker = new Docker();
- // @Valid
- // private Mail mail = new Mail();
- @Valid
- private K8s k8s = new K8s();
- @Valid
- private Git git = new Git();
- @Data
- public static class Gitlab {
- @NotEmpty
- private String host;
- /**
- * 采用的Personal/project access tokens的认证方式
- * 这里使用管理员的token
- * https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html
- */
- @NotEmpty
- private String token;
- @NotEmpty
- private String webhookProxy;
- }
- @Data
- public static class Docker {
- private String host;
- /**
- * 是否开启tls验证
- */
- private Boolean tls = false;
- private String certificatesPath = "docker/";
- private String registry;
- private String registryUsername;
- private String registryPassword;
- }
- // @Data
- // public static class Mail {
- // @Email
- // @NotEmpty
- // private String from;
- // @NotEmpty
- // private String personal = "MOOCODER";
- // }
- @Data
- public static class K8s{
- @URL
- @NotEmpty
- private String apiServer;
- @NotEmpty
- private String token;
- private Boolean validateSSL = false;
- private Boolean debugging = false;
- /**
- * k8s配置ingress时候的host后缀
- */
- private String ingressHostSuffix;
- }
- @Data
- public static class Git {
- @NotEmpty
- private String username;
- @NotEmpty
- private String password;
- }
- }
|