62
62
63
63
/**
64
64
* @author Kris De Volder
65
+ * @author LukeBalizet
65
66
*/
66
67
public class PipelineYmlSchema implements YamlSchema {
67
68
@@ -156,14 +157,32 @@ public class PipelineYmlSchema implements YamlSchema {
156
157
public final YType t_semver = f .yatomic ("Semver" )
157
158
.parseWith (ValueParsers .NE_STRING ); //TODO: use real semver parser.
158
159
159
- public final YType t_s3_region = f .yenum ("S3Region" ,
160
- //See: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUT.html
161
- "us-west-1" , "us-west-2" ,
162
- "ca-central-1" , "EU" , "eu-west-1" ,
163
- "eu-west-2" , "eu-central-1" ,
164
- "ap-south-1" , "ap-southeast-1" , "ap-southeast-2" , "ap-northeast-1" , "ap-northeast-2" ,
165
- "sa-east-1" ,
166
- "us-east-2"
160
+ public final YType t_aws_region = f .yenum ("AWSRegion" ,
161
+ //See https://docs.aws.amazon.com/general/latest/gr/rande.html
162
+ "af-south-1" ,
163
+ "ap-east-1" ,
164
+ "ap-southeast-3" ,
165
+ "ap-south-1" ,
166
+ "ap-northeast-3" ,
167
+ "ap-northeast-2" ,
168
+ "ap-southeast-1" ,
169
+ "ap-southeast-2" ,
170
+ "ap-northeast-1" ,
171
+ "ca-central-1" ,
172
+ "cn-north-1" ,
173
+ "cn-northwest-1" ,
174
+ "eu-central-1" ,
175
+ "eu-west-1" ,
176
+ "eu-west-2" ,
177
+ "eu-south-1" ,
178
+ "eu-west-3" ,
179
+ "eu-north-1" ,
180
+ "me-south-1" ,
181
+ "us-east-1" ,
182
+ "us-east-2" ,
183
+ "us-west-1" ,
184
+ "us-west-2" ,
185
+ "sa-east-1"
167
186
);
168
187
169
188
public final YType t_day = f .yenum ("Day" ,
@@ -606,14 +625,16 @@ private void initializeDefaultResourceTypes() {
606
625
put .require (Constraints .requireAtMostOneOf ("rebase" , "merge" ));
607
626
resourceTypes .def ("git" , source , get , put );
608
627
}
628
+
629
+ // Shared by docker-image and registry-image
630
+ AbstractType registry_mirror = f .ybean ("RegistryMirror" );
631
+ addProp (registry_mirror , "host" , t_ne_string ).isPrimary (true );
632
+ addProp (registry_mirror , "username" , t_ne_string );
633
+ addProp (registry_mirror , "password" , t_ne_string );
634
+
609
635
//docker-image:
610
636
{
611
637
612
- AbstractType registry_mirror = f .ybean ("RegistryMirror" );
613
- addProp (registry_mirror , "host" , t_ne_string ).isPrimary (true );
614
- addProp (registry_mirror , "username" , t_ne_string );
615
- addProp (registry_mirror , "password" , t_ne_string );
616
-
617
638
AbstractType source = f .ybean ("DockerImageSource" );
618
639
addProp (source , "repository" , t_ne_string ).isPrimary (true );
619
640
addProp (source , "tag" , t_ne_string );
@@ -670,14 +691,24 @@ private void initializeDefaultResourceTypes() {
670
691
671
692
resourceTypes .def ("docker-image" , source , get , put );
672
693
}
673
- //registry_image
694
+ //registry-image
674
695
{
675
696
AbstractType source = f .ybean ("RegistryImageSource" );
676
697
addProp (source , "repository" , t_ne_string ).isPrimary (true );
698
+ addProp (source , "insecure" , t_boolean );
677
699
addProp (source , "tag" , t_ne_string );
700
+ addProp (source , "variant" , t_ne_string );
701
+ addProp (source , "semver_constraint" , t_ne_string );
678
702
addProp (source , "username" , t_ne_string );
679
703
addProp (source , "password" , t_ne_string );
704
+ addProp (source , "aws_access_key_id" , t_ne_string );
705
+ addProp (source , "aws_secret_access_key" , t_ne_string );
706
+ addProp (source , "aws_session_token" , t_ne_string );
707
+ addProp (source , "aws_region" , t_aws_region );
708
+ addProp (source , "aws_role_arn" , t_ne_string );
709
+ addProp (source , "aws_role_arns" , t_strings );
680
710
addProp (source , "debug" , t_boolean );
711
+ addProp (source , "registry_mirror" , registry_mirror );
681
712
{
682
713
AbstractType contentTrust = f .ybean ("RegistryImageContentTrust" );
683
714
addProp (contentTrust , "server" , t_ne_string );
@@ -689,16 +720,21 @@ private void initializeDefaultResourceTypes() {
689
720
690
721
addProp (source , "content_trust" , contentTrust );
691
722
}
723
+ addProp (source , "ca_certs" , t_strings );
692
724
693
725
AbstractType get = f .ybean ("RegistryImageGetParams" );
694
726
addProp (get , "format" , f .yenum ("RegistryImageFormat" , "rootfs" , "oci" ));
695
727
addProp (get , "skip_download" , t_boolean );
696
728
697
729
AbstractType put = f .ybean ("RegistryImagePutParams" );
698
730
addProp (put , "image" , t_ne_string ).isPrimary (true );
731
+ addProp (put , "version" , t_ne_string );
732
+ addProp (put , "bump_aliases" , t_boolean );
699
733
addProp (put , "additional_tags" , t_ne_string );
700
734
701
735
resourceTypes .def ("registry-image" , source , get , put );
736
+
737
+ source .require (Constraints .mutuallyExclusive ("aws_role_arn" , "aws_role_arns" ));
702
738
}
703
739
//s3
704
740
{
@@ -714,7 +750,7 @@ private void initializeDefaultResourceTypes() {
714
750
addProp (source , "access_key_id" , t_ne_string );
715
751
addProp (source , "secret_access_key" , t_ne_string );
716
752
addProp (source , "session_token" , t_ne_string );
717
- addProp (source , "region_name" , t_s3_region );
753
+ addProp (source , "region_name" , t_aws_region );
718
754
addProp (source , "private" , t_boolean );
719
755
addProp (source , "cloudfront_url" , t_ne_string );
720
756
addProp (source , "endpoint" , t_ne_string );
@@ -790,7 +826,7 @@ private void initializeDefaultResourceTypes() {
790
826
addProp (s3_source , "key" , t_ne_string ).isRequired (true );
791
827
addProp (s3_source , "access_key_id" , t_ne_string ).isRequired (true );
792
828
addProp (s3_source , "secret_access_key" , t_ne_string ).isRequired (true );
793
- addProp (s3_source , "region_name" , t_s3_region );
829
+ addProp (s3_source , "region_name" , t_aws_region );
794
830
addProp (s3_source , "endpoint" , t_ne_string );
795
831
addProp (s3_source , "disable_ssl" , t_boolean );
796
832
0 commit comments