2019-08-10 21:29:25 +00:00
// This file contains the logic for building our CI for Drone. The idea here is
// that we create a pipeline for all of the major tasks we need to perform
// (e.g. builds, E2E testing, conformance testing, releases). Each pipeline
// after the default builds on a previous pipeline.
2019-09-06 22:37:37 -05:00
// Generate with `drone jsonnet --source ./hack/drone.jsonnet --stream --format`
2020-04-07 22:49:12 +03:00
// Sign with `drone sign talos-systems/talos --save`
2019-08-10 21:29:25 +00:00
2019-08-02 16:08:24 -05:00
local build_container = ' a u t o n o m y / b u i l d - c o n t a i n e r : l a t e s t ' ;
2020-02-13 23:07:36 +03:00
local local_registry = ' r e g i s t r y . c i . s v c : 5 0 0 0 ' ;
2019-08-10 21:29:25 +00:00
2019-12-23 10:36:14 -08:00
local secret = {
kind : ' s e c r e t ' ,
name : ' k u b e c o n f i g ' ,
get : {
path : ' b u i l d x ' ,
name : ' k u b e c o n f i g '
} ,
} ;
2019-08-10 21:29:25 +00:00
local volumes = {
dockersock : {
pipeline : {
2019-08-02 16:08:24 -05:00
name : ' d o c k e r s o c k ' ,
2019-08-10 21:29:25 +00:00
temp : { } ,
} ,
step : {
name : $ . dockersock . pipeline . name ,
2019-08-02 16:08:24 -05:00
path : ' / v a r / r u n ' ,
2019-08-10 21:29:25 +00:00
} ,
2019-08-09 03:45:13 +00:00
} ,
2019-08-10 21:29:25 +00:00
2019-12-23 10:36:14 -08:00
docker : {
pipeline : {
name : ' d o c k e r ' ,
temp : { } ,
} ,
step : {
name : $ . docker . pipeline . name ,
path : ' / r o o t / . d o c k e r / b u i l d x ' ,
} ,
} ,
kube : {
pipeline : {
name : ' k u b e ' ,
temp : { } ,
} ,
step : {
name : $ . kube . pipeline . name ,
path : ' / r o o t / . k u b e ' ,
} ,
} ,
2019-08-10 21:29:25 +00:00
dev : {
pipeline : {
2019-08-02 16:08:24 -05:00
name : ' d e v ' ,
2019-08-10 21:29:25 +00:00
host : {
2019-08-02 16:08:24 -05:00
path : ' / d e v ' ,
2019-08-10 21:29:25 +00:00
} ,
} ,
step : {
name : $ . dev . pipeline . name ,
2019-08-02 16:08:24 -05:00
path : ' / d e v ' ,
2019-08-10 21:29:25 +00:00
} ,
2019-08-09 03:45:13 +00:00
} ,
2019-08-10 21:29:25 +00:00
2020-06-29 21:36:51 +03:00
tmp : {
pipeline : {
name : ' t m p ' ,
temp : { } ,
} ,
step : {
name : $ . tmp . pipeline . name ,
path : ' / t m p ' ,
} ,
} ,
2019-08-10 21:29:25 +00:00
ForStep ( ) : [
self . dockersock . step ,
2019-12-23 10:36:14 -08:00
self . docker . step ,
self . kube . step ,
2019-08-10 21:29:25 +00:00
self . dev . step ,
] ,
ForPipeline ( ) : [
self . dockersock . pipeline ,
2019-12-23 10:36:14 -08:00
self . docker . pipeline ,
self . kube . pipeline ,
2019-08-10 21:29:25 +00:00
self . dev . pipeline ,
2020-06-29 21:36:51 +03:00
self . tmp . pipeline ,
2019-08-10 21:29:25 +00:00
] ,
} ;
2019-08-09 03:45:13 +00:00
2019-08-10 21:29:25 +00:00
// This provides the docker service.
2019-08-09 03:45:13 +00:00
local docker = {
2019-08-02 16:08:24 -05:00
name : ' d o c k e r ' ,
image : ' d o c k e r : 1 9 . 0 3 - d i n d ' ,
entrypoint : [ ' d o c k e r d ' ] ,
2019-08-09 03:45:13 +00:00
privileged : true ,
command : [
2019-08-02 16:08:24 -05:00
' - - d n s = 8 . 8 . 8 . 8 ' ,
' - - d n s = 8 . 8 . 4 . 4 ' ,
2020-01-21 19:37:12 -08:00
' - - m t u = 1 5 0 0 ' ,
2019-08-02 16:08:24 -05:00
' - - l o g - l e v e l = e r r o r ' ,
2020-02-13 23:07:36 +03:00
' - - i n s e c u r e - r e g i s t r y = ' + local_registry ,
2019-08-09 03:45:13 +00:00
] ,
2019-12-27 18:12:04 +00:00
ports : [
6443 ,
50000 ,
] ,
2019-08-10 21:29:25 +00:00
volumes : volumes . ForStep ( ) ,
2019-08-09 03:45:13 +00:00
} ;
2019-12-24 09:28:58 -08:00
// Sets up the CI environment
local setup_ci = {
name : ' s e t u p - c i ' ,
2019-12-23 10:36:14 -08:00
image : ' a u t o n o m y / b u i l d - c o n t a i n e r : l a t e s t ' ,
2019-08-09 03:45:13 +00:00
privileged : true ,
2019-12-23 10:36:14 -08:00
environment : {
BUILDX_KUBECONFIG : { from_secret : secret . name } ,
2019-08-09 03:45:13 +00:00
} ,
2019-12-23 10:36:14 -08:00
commands : [
2019-12-24 09:28:58 -08:00
' g i t f e t c h - - t a g s ' ,
' a p k a d d c o r e u t i l s ' ,
2019-12-23 10:36:14 -08:00
' e c h o - e " $ B U I L D X _ K U B E C O N F I G " > / r o o t / . k u b e / c o n f i g ' ,
' d o c k e r b u i l d x c r e a t e - - d r i v e r k u b e r n e t e s - - d r i v e r - o p t r e p l i c a s = 2 - - d r i v e r - o p t n a m e s p a c e = c i - - d r i v e r - o p t i m a g e = m o b y / b u i l d k i t : v 0 . 6 . 2 - - n a m e c i - - b u i l d k i t d - f l a g s = " - - a l l o w - i n s e c u r e - e n t i t l e m e n t s e c u r i t y . i n s e c u r e " - - u s e ' ,
2020-01-23 20:52:02 -08:00
' d o c k e r b u i l d x i n s p e c t - - b o o t s t r a p ' ,
' m a k e . / _ o u t / s o n o b u o y ' ,
' m a k e . / _ o u t / k u b e c t l ' ,
2019-12-23 10:36:14 -08:00
] ,
volumes : volumes . ForStep ( ) ,
2019-08-09 03:45:13 +00:00
} ;
2019-08-10 21:29:25 +00:00
// Step standardizes the creation of build steps. The name of the step is used
// as the target when building the make command. For example, if name equals
// "test", the resulting step command will be "make test". This is done to
// encourage alignment between this file and the Makefile, and gives us a
// standardized structure that should make things easier to reason about if we
// know that each step is essentially a Makefile target.
2020-06-29 21:36:51 +03:00
local Step ( name , image = ' ' , target = ' ' , privileged = false , depends_on = [ ] , environment = { } , extra_volumes = [ ] ) = {
2019-08-02 16:08:24 -05:00
local make = if target = = ' ' then std.format ( ' m a k e % s ' , name ) else std.format ( ' m a k e % s ' , target ) ,
2019-12-04 10:22:36 -05:00
2020-01-10 18:45:31 -08:00
local common_env_vars = { } ,
2019-08-09 03:45:13 +00:00
2019-08-10 21:29:25 +00:00
name : name ,
2019-12-04 10:22:36 -05:00
image : if image = = ' ' then build_container else image ,
2019-09-23 21:45:21 -07:00
pull : " a l w a y s " ,
2019-08-10 21:29:25 +00:00
commands : [ make ] ,
2020-01-21 19:37:12 -08:00
privileged : privileged ,
2019-08-10 21:29:25 +00:00
environment : common_env_vars + environment ,
2020-06-29 21:36:51 +03:00
volumes : volumes . ForStep ( ) + extra_volumes ,
2019-08-09 03:45:13 +00:00
depends_on : [ x . name for x in depends_on ] ,
} ;
2019-08-10 21:29:25 +00:00
// Pipeline is a way to standardize the creation of pipelines. It supports
// using and existing pipeline as a base.
2019-12-23 10:36:14 -08:00
local Pipeline ( name , steps = [ ] , depends_on = [ ] , with_docker = true , disable_clone = false ) = {
2019-08-02 16:08:24 -05:00
local node = { ' node-role.kubernetes.io/ci' : ' ' } ,
2019-08-09 03:45:13 +00:00
2019-08-02 16:08:24 -05:00
kind : ' p i p e l i n e ' ,
2019-08-09 03:45:13 +00:00
name : name ,
2019-08-10 21:29:25 +00:00
node : node ,
services : [
if with_docker then docker ,
] ,
2019-12-10 17:44:07 +00:00
[ if disable_clone then ' c l o n e ' ] : {
disable : true ,
} ,
2019-09-23 21:45:21 -07:00
steps : steps ,
2019-08-10 21:29:25 +00:00
volumes : volumes . ForPipeline ( ) ,
depends_on : [ x . name for x in depends_on ] ,
2019-08-09 03:45:13 +00:00
} ;
2019-08-10 21:29:25 +00:00
// Default pipeline.
2020-04-07 22:49:12 +03:00
local docs = Step ( " d o c s " , depends_on = [ setup_ci ] ) ;
local generate = Step ( " g e n e r a t e " , depends_on = [ setup_ci ] ) ;
local check_dirty = Step ( " c h e c k - d i r t y " , depends_on = [ docs , generate ] ) ;
local osctl_linux = Step ( " t a l o s c t l - l i n u x " , depends_on = [ check_dirty ] ) ;
local osctl_darwin = Step ( " t a l o s c t l - d a r w i n " , depends_on = [ check_dirty ] ) ;
local kernel = Step ( ' k e r n e l ' , depends_on = [ check_dirty ] ) ;
local initramfs = Step ( " i n i t r a m f s " , depends_on = [ check_dirty ] ) ;
2020-01-04 13:19:34 -08:00
local installer = Step ( " i n s t a l l e r " , depends_on = [ initramfs ] ) ;
2020-02-14 15:26:44 +03:00
local talos = Step ( " t a l o s " , depends_on = [ initramfs ] ) ;
2020-02-13 23:07:36 +03:00
local installer_local = Step ( " i n s t a l l e r - l o c a l " , depends_on = [ installer ] , target = " i n s t a l l e r " , environment = { " REGISTRY" : local_registry } ) ;
local talos_local = Step ( " t a l o s - l o c a l " , depends_on = [ talos ] , target = " t a l o s " , environment = { " REGISTRY" : local_registry } ) ;
2020-04-07 22:49:12 +03:00
local golint = Step ( " l i n t - g o " , depends_on = [ check_dirty ] ) ;
local markdownlint = Step ( " l i n t - m a r k d o w n " , depends_on = [ check_dirty ] ) ;
local protobuflint = Step ( " l i n t - p r o t o b u f " , depends_on = [ check_dirty ] ) ;
2019-11-01 04:55:58 +00:00
local image_aws = Step ( " i m a g e - a w s " , depends_on = [ installer ] ) ;
2020-04-15 10:46:45 -07:00
local image_azure = Step ( " i m a g e - a z u r e " , depends_on = [ image_aws ] ) ;
local image_digital_ocean = Step ( " i m a g e - d i g i t a l - o c e a n " , depends_on = [ image_azure ] ) ;
local image_gcp = Step ( " i m a g e - g c p " , depends_on = [ image_digital_ocean ] ) ;
local image_vmware = Step ( " i m a g e - v m w a r e " , depends_on = [ image_gcp ] ) ;
2020-02-13 23:07:36 +03:00
local push_local = Step ( " p u s h - l o c a l " , depends_on = [ installer_local , talos_local ] , target = " p u s h " , environment = { " REGISTRY" : local_registry , " DOCKER_LOGIN_ENABLED" : " f a l s e " } ) ;
2020-02-14 15:26:44 +03:00
local unit_tests = Step ( " u n i t - t e s t s " , depends_on = [ initramfs ] ) ;
2020-05-22 23:26:56 +03:00
local unit_tests_race = Step ( " u n i t - t e s t s - r a c e " , depends_on = [ initramfs ] ) ;
2020-06-29 21:36:51 +03:00
local e2e_docker = Step ( " e 2 e - d o c k e r " , depends_on = [ talos , osctl_linux ] , extra_volumes = [ volumes . tmp . step ] ) ;
2020-05-06 17:40:30 +03:00
local e2e_firecracker = Step ( " e 2 e - f i r e c r a c k e r " , privileged = true , depends_on = [ initramfs , osctl_linux , kernel , push_local ] , environment = { " REGISTRY" : local_registry , " FIRECRACKER_GO_SDK_REQUEST_TIMEOUT_MILLISECONDS" : " 2 0 0 0 " } ) ;
2020-03-24 21:20:36 +03:00
local provision_tests_prepare = Step ( " p r o v i s i o n - t e s t s - p r e p a r e " , privileged = true , depends_on = [ initramfs , osctl_linux , kernel , push_local ] , environment = { " REGISTRY" : local_registry } ) ;
2020-06-17 02:35:37 +00:00
local provision_tests_track_0 = Step ( " p r o v i s i o n - t e s t s - t r a c k - 0 " , privileged = true , depends_on = [ provision_tests_prepare ] , environment = { " REGISTRY" : local_registry , " FIRECRACKER_GO_SDK_REQUEST_TIMEOUT_MILLISECONDS" : " 2 0 0 0 " } ) ;
local provision_tests_track_1 = Step ( " p r o v i s i o n - t e s t s - t r a c k - 1 " , privileged = true , depends_on = [ provision_tests_prepare ] , environment = { " REGISTRY" : local_registry , " FIRECRACKER_GO_SDK_REQUEST_TIMEOUT_MILLISECONDS" : " 2 0 0 0 " } ) ;
2019-08-09 03:45:13 +00:00
local coverage = {
2019-08-02 16:08:24 -05:00
name : ' c o v e r a g e ' ,
2020-01-23 20:52:02 -08:00
image : ' a l p i n e : 3 . 1 0 ' ,
environment : {
CODECOV_TOKEN : { from_secret : ' c o d e c o v _ t o k e n ' } ,
2019-08-09 03:45:13 +00:00
} ,
2020-01-23 20:52:02 -08:00
commands : [
' a p k - - n o - c a c h e a d d b a s h c u r l g i t ' ,
' b a s h - c " b a s h < ( c u r l - s h t t p s : / / c o d e c o v . i o / b a s h ) - f _ o u t / c o v e r a g e . t x t - X f i x " '
] ,
2019-08-10 21:29:25 +00:00
when : {
2019-08-02 16:08:24 -05:00
event : [ ' p u l l _ r e q u e s t ' ] ,
2019-08-09 03:45:13 +00:00
} ,
depends_on : [ unit_tests . name ] ,
} ;
2020-01-01 10:28:44 -08:00
local push = {
name : ' p u s h ' ,
image : ' a u t o n o m y / b u i l d - c o n t a i n e r : l a t e s t ' ,
pull : ' a l w a y s ' ,
environment : {
DOCKER_USERNAME : { from_secret : ' d o c k e r _ u s e r n a m e ' } ,
DOCKER_PASSWORD : { from_secret : ' d o c k e r _ p a s s w o r d ' } ,
} ,
commands : [ ' m a k e p u s h ' ] ,
volumes : volumes . ForStep ( ) ,
when : {
event : {
exclude : [
' p u l l _ r e q u e s t ' ,
2020-01-01 11:51:48 -08:00
' p r o m o t e ' ,
' c r o n ' ,
2020-01-01 10:28:44 -08:00
] ,
} ,
} ,
2020-01-23 20:52:02 -08:00
depends_on : [ e2e_docker . name , e2e_firecracker . name ] ,
2020-01-01 10:28:44 -08:00
} ;
2019-11-27 15:39:53 +00:00
local push_latest = {
name : ' p u s h - l a t e s t ' ,
2019-08-02 16:08:24 -05:00
image : ' a u t o n o m y / b u i l d - c o n t a i n e r : l a t e s t ' ,
pull : ' a l w a y s ' ,
environment : {
DOCKER_USERNAME : { from_secret : ' d o c k e r _ u s e r n a m e ' } ,
DOCKER_PASSWORD : { from_secret : ' d o c k e r _ p a s s w o r d ' } ,
2019-08-09 03:45:13 +00:00
} ,
2020-01-01 10:28:44 -08:00
commands : [ ' m a k e p u s h - l a t e s t ' ] ,
2019-08-10 21:29:25 +00:00
volumes : volumes . ForStep ( ) ,
2019-08-09 03:45:13 +00:00
when : {
2020-01-01 11:51:48 -08:00
branch : [
' m a s t e r ' ,
] ,
event : [
' p u s h ' ,
2020-01-01 09:43:24 -08:00
] ,
2019-08-09 03:45:13 +00:00
} ,
2020-01-23 20:52:02 -08:00
depends_on : [ e2e_docker . name , e2e_firecracker . name ] ,
2019-08-09 03:45:13 +00:00
} ;
2019-08-10 21:29:25 +00:00
local default_steps = [
2019-12-24 09:28:58 -08:00
setup_ci ,
2020-04-07 22:49:12 +03:00
docs ,
generate ,
check_dirty ,
2019-08-10 21:29:25 +00:00
osctl_linux ,
osctl_darwin ,
2020-01-21 19:37:12 -08:00
kernel ,
2019-08-09 03:45:13 +00:00
initramfs ,
2019-08-10 21:29:25 +00:00
installer ,
2020-02-13 23:07:36 +03:00
installer_local ,
2019-12-24 12:23:52 -08:00
talos ,
2020-02-13 23:07:36 +03:00
talos_local ,
2019-12-24 09:28:58 -08:00
golint ,
2019-08-17 08:51:40 +00:00
markdownlint ,
2020-04-07 22:49:12 +03:00
protobuflint ,
2019-11-01 04:55:58 +00:00
image_aws ,
image_azure ,
image_digital_ocean ,
image_gcp ,
image_vmware ,
2019-08-09 03:45:13 +00:00
unit_tests ,
2019-09-02 21:55:42 +03:00
unit_tests_race ,
2019-08-09 03:45:13 +00:00
coverage ,
2020-02-13 23:07:36 +03:00
push_local ,
2020-01-23 20:52:02 -08:00
e2e_docker ,
e2e_firecracker ,
2020-03-24 21:20:36 +03:00
provision_tests_prepare ,
provision_tests_track_0 ,
provision_tests_track_1 ,
2020-01-01 10:28:44 -08:00
push ,
2019-11-27 15:39:53 +00:00
push_latest ,
2019-08-09 03:45:13 +00:00
] ;
local default_trigger = {
trigger : {
cron : {
2019-08-02 16:08:24 -05:00
exclude : [ ' n i g h t l y ' ] ,
2019-08-09 03:45:13 +00:00
} ,
2019-08-12 18:28:42 +00:00
event : {
2019-08-13 00:40:00 +00:00
exclude : [
2019-08-02 16:08:24 -05:00
' t a g ' ,
' p r o m o t e ' ,
] ,
2019-08-09 03:45:13 +00:00
} ,
} ,
} ;
2020-04-10 17:06:59 -07:00
local default_pipeline = Pipeline ( ' d e f a u l t ' , default_steps ) + default_trigger ;
2019-08-10 21:29:25 +00:00
// E2E pipeline.
local creds_env_vars = {
2020-01-23 20:52:02 -08:00
AWS_ACCESS_KEY_ID : { from_secret : ' a w s _ a c c e s s _ k e y _ i d ' } ,
AWS_SECRET_ACCESS_KEY : { from_secret : ' a w s _ s e c r e t _ a c c e s s _ k e y ' } ,
AWS_SVC_ACCT : { from_secret : " a w s _ s v c _ a c c t " } ,
AZURE_SVC_ACCT : { from_secret : " a z u r e _ s v c _ a c c t " } ,
// TODO(andrewrynhard): Rename this to the GCP convention.
GCE_SVC_ACCT : { from_secret : " g c e _ s v c _ a c c t " } ,
PACKET_AUTH_TOKEN : { from_secret : " p a c k e t _ a u t h _ t o k e n " } ,
2019-08-09 03:45:13 +00:00
} ;
2020-06-29 21:36:51 +03:00
local e2e_capi = Step ( " e 2 e - c a p i " , depends_on = [ e2e_docker , e2e_firecracker ] , environment = creds_env_vars , extra_volumes = [ volumes . tmp . step ] ) ;
local e2e_aws = Step ( " e 2 e - a w s " , depends_on = [ e2e_capi ] , environment = creds_env_vars , extra_volumes = [ volumes . tmp . step ] ) ;
local e2e_azure = Step ( " e 2 e - a z u r e " , depends_on = [ e2e_capi ] , environment = creds_env_vars , extra_volumes = [ volumes . tmp . step ] ) ;
local e2e_gcp = Step ( " e 2 e - g c p " , depends_on = [ e2e_capi ] , environment = creds_env_vars , extra_volumes = [ volumes . tmp . step ] ) ;
2019-08-10 21:29:25 +00:00
local e2e_steps = default_steps + [
2020-01-23 20:52:02 -08:00
e2e_capi ,
e2e_aws ,
e2e_gcp ,
2019-08-10 21:29:25 +00:00
] ;
2019-08-09 03:45:13 +00:00
local e2e_trigger = {
trigger : {
target : {
2019-08-02 16:08:24 -05:00
include : [ ' e 2 e ' ] ,
2019-08-09 03:45:13 +00:00
} ,
} ,
} ;
2019-08-02 16:08:24 -05:00
local e2e_pipeline = Pipeline ( ' e 2 e ' , e2e_steps ) + e2e_trigger ;
2019-08-10 21:29:25 +00:00
// Conformance pipeline.
2020-06-29 21:36:51 +03:00
local conformance_aws = Step ( " e 2 e - a w s " , depends_on = [ e2e_capi ] , environment = creds_env_vars + { SONOBUOY_MODE : " c e r t i f i e d - c o n f o r m a n c e " } , extra_volumes = [ volumes . tmp . step ] ) ;
local conformance_azure = Step ( " e 2 e - a z u r e " , depends_on = [ e2e_capi ] , environment = creds_env_vars + { SONOBUOY_MODE : " c e r t i f i e d - c o n f o r m a n c e " } , extra_volumes = [ volumes . tmp . step ] ) ;
local conformance_gcp = Step ( " e 2 e - g c p " , depends_on = [ e2e_capi ] , environment = creds_env_vars + { SONOBUOY_MODE : " c e r t i f i e d - c o n f o r m a n c e " } , extra_volumes = [ volumes . tmp . step ] ) ;
2019-08-10 21:29:25 +00:00
2019-11-27 15:39:53 +00:00
local push_edge = {
name : ' p u s h - e d g e ' ,
image : ' a u t o n o m y / b u i l d - c o n t a i n e r : l a t e s t ' ,
pull : ' a l w a y s ' ,
environment : {
DOCKER_USERNAME : { from_secret : ' d o c k e r _ u s e r n a m e ' } ,
DOCKER_PASSWORD : { from_secret : ' d o c k e r _ p a s s w o r d ' } ,
} ,
2020-01-01 10:28:44 -08:00
commands : [ ' m a k e p u s h - e d g e ' ] ,
2019-11-27 15:39:53 +00:00
volumes : volumes . ForStep ( ) ,
when : {
2020-01-01 09:43:24 -08:00
cron : [
' n i g h t l y ' ,
] ,
2019-11-27 15:39:53 +00:00
} ,
2019-12-27 07:32:31 -08:00
depends_on : [ conformance_aws . name , conformance_gcp . name ] ,
2019-11-27 15:39:53 +00:00
} ;
2019-08-10 21:29:25 +00:00
local conformance_steps = default_steps + [
2020-01-23 20:52:02 -08:00
e2e_capi ,
2019-09-09 22:21:58 +00:00
conformance_aws ,
2019-08-11 21:38:24 +00:00
conformance_gcp ,
2019-11-27 15:39:53 +00:00
push_edge ,
2019-08-10 21:29:25 +00:00
] ;
2019-08-09 03:45:13 +00:00
local conformance_trigger = {
trigger : {
target : {
2019-08-02 16:08:24 -05:00
include : [ ' c o n f o r m a n c e ' ] ,
2019-08-09 03:45:13 +00:00
} ,
} ,
} ;
2019-08-02 16:08:24 -05:00
local conformance_pipeline = Pipeline ( ' c o n f o r m a n c e ' , conformance_steps ) + conformance_trigger ;
2019-08-10 21:29:25 +00:00
// Nightly pipeline.
local nightly_trigger = {
trigger : {
cron : {
2019-08-02 16:08:24 -05:00
include : [ ' n i g h t l y ' ] ,
2019-08-10 21:29:25 +00:00
} ,
} ,
} ;
2019-08-02 16:08:24 -05:00
local nightly_pipeline = Pipeline ( ' n i g h t l y ' , conformance_steps ) + nightly_trigger ;
2019-08-10 21:29:25 +00:00
// Release pipeline.
2020-01-23 20:52:02 -08:00
local iso = Step ( ' i s o ' , depends_on = [ e2e_docker , e2e_firecracker ] ) ;
local boot = Step ( ' b o o t ' , depends_on = [ e2e_docker , e2e_firecracker ] ) ;
2019-08-11 16:54:33 +00:00
2019-08-10 21:29:25 +00:00
// TODO(andrewrynhard): We should run E2E tests on a release.
2019-08-02 16:08:24 -05:00
local release = {
name : ' r e l e a s e ' ,
image : ' p l u g i n s / g i t h u b - r e l e a s e ' ,
settings : {
api_key : { from_secret : ' g i t h u b _ t o k e n ' } ,
2019-08-10 21:29:25 +00:00
draft : true ,
2019-12-30 17:16:37 -08:00
files : [
' _ o u t / a w s . t a r . g z ' ,
' _ o u t / a z u r e . t a r . g z ' ,
2020-01-09 12:25:25 -08:00
' _ o u t / b o o t . t a r . g z ' ,
2019-12-30 17:16:37 -08:00
' _ o u t / c o n t a i n e r . t a r ' ,
' _ o u t / d i g i t a l - o c e a n . t a r . g z ' ,
' _ o u t / g c p . t a r . g z ' ,
' _ o u t / i n i t r a m f s . x z ' ,
' _ o u t / i n s t a l l e r . t a r ' ,
2020-03-20 17:38:48 -07:00
' _ o u t / t a l o s c t l - d a r w i n - a m d 6 4 ' ,
' _ o u t / t a l o s c t l - l i n u x - a m d 6 4 ' ,
2020-03-21 14:27:03 -07:00
' _ o u t / t a l o s c t l - l i n u x - a r m 6 4 ' ,
2020-03-21 18:08:09 -07:00
' _ o u t / t a l o s c t l - l i n u x - a r m v 7 ' ,
2019-12-30 17:16:37 -08:00
' _ o u t / v m w a r e . o v a ' ,
' _ o u t / v m l i n u x ' ,
' _ o u t / v m l i n u z ' ,
] ,
2019-08-02 16:08:24 -05:00
checksum : [ ' s h a 2 5 6 ' , ' s h a 5 1 2 ' ] ,
2019-08-10 21:29:25 +00:00
} ,
when : {
2019-08-02 16:08:24 -05:00
event : [ ' t a g ' ] ,
2019-08-10 21:29:25 +00:00
} ,
2020-01-09 12:25:25 -08:00
depends_on : [ kernel . name , iso . name , boot . name , image_gcp . name , image_azure . name , image_aws . name , push . name ]
2019-08-10 21:29:25 +00:00
} ;
local release_steps = default_steps + [
2019-08-11 17:29:45 +00:00
iso ,
2020-01-09 12:25:25 -08:00
boot ,
2019-08-11 16:54:33 +00:00
release ,
2019-08-10 21:29:25 +00:00
] ;
2019-08-09 03:45:13 +00:00
local release_trigger = {
trigger : {
2019-08-11 17:52:20 +00:00
event : [
2019-08-02 16:08:24 -05:00
' t a g ' ,
2019-08-11 17:52:20 +00:00
] ,
2019-08-09 03:45:13 +00:00
} ,
} ;
2019-08-02 16:08:24 -05:00
local release_pipeline = Pipeline ( ' r e l e a s e ' , release_steps ) + release_trigger ;
2019-08-10 21:29:25 +00:00
// Notify pipeline.
local notify = {
2019-08-02 16:08:24 -05:00
name : ' s l a c k ' ,
image : ' p l u g i n s / s l a c k ' ,
2019-08-10 21:29:25 +00:00
settings :
{
2019-08-02 16:08:24 -05:00
webhook : { from_secret : ' s l a c k _ w e b h o o k ' } ,
2019-09-09 10:51:10 -05:00
channel : ' p r o j - t a l o s - m a i n t a i n e r s ' ,
2019-10-22 16:07:31 +03:00
link_names : true ,
template : ' { { # i f b u i l d . p u l l } }
* { { #success build.status}}✓ Success{{else}}✕ Fail{{/success}}*: {{ repo.owner }}/{{ repo.name }} - <https://github.com/{{ repo.owner }}/{{ repo.name }}/pull/{{ build.pull }}|Pull Request #{{ build.pull }}>
{ { else } }
* { { #success build.status}}✓ Success{{else}}✕ Fail{{/success}}: {{ repo.owner }}/{{ repo.name }} - Build #{{ build.number }}* (type: `{{ build.event }}`)
{ { / if } }
Commit : < https : //github.com/{{ repo.owner }}/{{ repo.name }}/commit/{{ build.commit }}|{{ truncate build.commit 8 }}>
Branch : < https : //github.com/{{ repo.owner }}/{{ repo.name }}/commits/{{ build.branch }}|{{ build.branch }}>
Author : { { build . a u t h o r } }
< { { build . l i n k } } | V i s i t b u i l d p a g e > '
2019-08-10 21:29:25 +00:00
} ,
} ;
local notify_steps = [ notify ] ;
2019-08-09 03:45:13 +00:00
local notify_trigger = {
trigger : {
2019-08-02 16:08:24 -05:00
status : [ ' s u c c e s s ' , ' f a i l u r e ' ] ,
2019-08-09 03:45:13 +00:00
} ,
} ;
local notify_depends_on = {
2019-08-10 21:29:25 +00:00
depends_on : [
default_pipeline . name ,
e2e_pipeline . name ,
conformance_pipeline . name ,
nightly_pipeline . name ,
release_pipeline . name ,
] ,
2019-08-09 03:45:13 +00:00
} ;
2019-12-23 10:36:14 -08:00
local notify_pipeline = Pipeline ( ' n o t i f y ' , notify_steps , [ default_pipeline , e2e_pipeline , conformance_pipeline , nightly_pipeline , release_pipeline ] , false , true ) + notify_trigger ;
2019-08-10 21:29:25 +00:00
// Final configuration file definition.
2019-08-09 03:45:13 +00:00
[
2019-12-23 10:36:14 -08:00
secret ,
2019-08-09 03:45:13 +00:00
default_pipeline ,
e2e_pipeline ,
conformance_pipeline ,
nightly_pipeline ,
release_pipeline ,
notify_pipeline ,
]