diff --git a/.aspect/workflows/README.md b/.aspect/workflows/README.md new file mode 100644 index 0000000..33415d9 --- /dev/null +++ b/.aspect/workflows/README.md @@ -0,0 +1,24 @@ +# Aspect Workflows demonstration deployment + +This deployment of [Aspect Workflows](https://www.aspect.build/workflows) is configured to run on AWS + GitLab. + +You can see this Aspect Workflows demonstration deployment live at +https://gitlab.com/aspect-build/rules_jest/-/pipelines. + +The three components of the configuration are, + +1. Aspect Workflows terraform module +1. Aspect Workflows configuration yaml +1. GitLab CI configuration yaml + +## Aspect Workflows terraform module + +This is found under the [`.aspect/workflows/terraform`](./terraform/README.md) directory. + +## Aspect Workflows configuration yaml + +This is the `config.yaml` file in this directory. + +## GitLab CI configuration + +This is the `.gitlab-ci.yml` file at the root of the repository. diff --git a/.aspect/workflows/config.yaml b/.aspect/workflows/config.yaml new file mode 100644 index 0000000..d4081e8 --- /dev/null +++ b/.aspect/workflows/config.yaml @@ -0,0 +1,10 @@ +# See https://docs.aspect.build/v/workflows/config +--- +workspaces: + .: + bazel: + flags: + - --enable_bzlmod +tasks: + buildifier: + test: diff --git a/.aspect/workflows/terraform/.terraform.lock.hcl b/.aspect/workflows/terraform/.terraform.lock.hcl new file mode 100644 index 0000000..95512df --- /dev/null +++ b/.aspect/workflows/terraform/.terraform.lock.hcl @@ -0,0 +1,204 @@ +# This file is maintained automatically by "terraform init". +# Manual edits may be lost in future updates. + +provider "registry.terraform.io/hashicorp/aws" { + version = "4.58.0" + constraints = ">= 3.72.0, >= 4.0.0, >= 4.9.0, >= 4.35.0, >= 4.47.0, >= 4.54.0, >= 4.57.0, >= 4.58.0, ~> 4.58.0, < 5.0.0" + hashes = [ + "h1:znLROwEAINbYzAG5X7Ep04whM7KxkQGrvhFdhSvNKEk=", + "zh:14b2b2dfbc7ee705c412d762b1485ee08958c816a64ac74f5769e946e4a1d265", + "zh:17a37e6825e2023b18987d31c0cbb9336654ea146b68e6c90710ea4636af71ae", + "zh:273127c69fb244577e5c136c46164d34f77b0c956c18d27f63d1072dd558f924", + "zh:4b2b6416d34fb3e1051c99d2a84045b136976140e34381d5fbf90e32db15272e", + "zh:7e6a8571ff15d51f892776265642ee01004b8553fd4f6f2014b6f3f2834670c7", + "zh:847c76ab2381b66666d0f79cf1ac697b5bfd0d9c3009fd11bc6ad6545d1eb427", + "zh:9a52cae08ba8d27d0639a8d2b8c61591027883058bf0cc5a639cffe1e299f019", + "zh:9b12af85486a96aedd8d7984b0ff811a4b42e3d88dad1a3fb4c0b580d04fa425", + "zh:9df647e8322d6f94f1843366ba39d21c4b36c8e7dcdc03711d52e27f73b0e974", + "zh:9e52037e68409802ff913b166c30e3f2035af03865cbef0c1b03762bce853941", + "zh:a30288e7c3c904d6998d1709835d7c5800a739f8608f0837f960286a2b8b6e59", + "zh:a7f24e3bda3be566468e4ad62cef1016f68c6f5a94d2e3e979485bc05626281b", + "zh:ba326ba80f5e39829b67a6d1ce54ba52b171e5e13a0a91ef5f9170a9b0cc9ce4", + "zh:c4e3fe9f2be6e244a3dfce599f4b0be9e8fffaece64cbc65f3195f825f65489b", + "zh:f20a251af37039bb2c7612dbd2c5df3a25886b4cc78f902385a2850ea6e30d08", + ] +} + +provider "registry.terraform.io/hashicorp/cloudinit" { + version = "2.3.2" + constraints = ">= 2.0.0" + hashes = [ + "h1:Ar/DAbZQ9Nsj0BrqX6camrEE6U+Yq4E87DCNVqxqx8k=", + "zh:2487e498736ed90f53de8f66fe2b8c05665b9f8ff1506f751c5ee227c7f457d1", + "zh:3d8627d142942336cf65eea6eb6403692f47e9072ff3fa11c3f774a3b93130b3", + "zh:434b643054aeafb5df28d5529b72acc20c6f5ded24decad73b98657af2b53f4f", + "zh:436aa6c2b07d82aa6a9dd746a3e3a627f72787c27c80552ceda6dc52d01f4b6f", + "zh:458274c5aabe65ef4dbd61d43ce759287788e35a2da004e796373f88edcaa422", + "zh:54bc70fa6fb7da33292ae4d9ceef5398d637c7373e729ed4fce59bd7b8d67372", + "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", + "zh:893ba267e18749c1a956b69be569f0d7bc043a49c3a0eb4d0d09a8e8b2ca3136", + "zh:95493b7517bce116f75cdd4c63b7c82a9d0d48ec2ef2f5eb836d262ef96d0aa7", + "zh:9ae21ab393be52e3e84e5cce0ef20e690d21f6c10ade7d9d9d22b39851bfeddc", + "zh:cc3b01ac2472e6d59358d54d5e4945032efbc8008739a6d4946ca1b621a16040", + "zh:f23bfe9758f06a1ec10ea3a81c9deedf3a7b42963568997d84a5153f35c5839a", + ] +} + +provider "registry.terraform.io/hashicorp/external" { + version = "2.3.1" + constraints = ">= 1.0.0" + hashes = [ + "h1:9rJggijNdRdFk//ViQPGZdK0xu9XU/9qBDijNsZJMg0=", + "zh:001e2886dc81fc98cf17cf34c0d53cb2dae1e869464792576e11b0f34ee92f54", + "zh:2eeac58dd75b1abdf91945ac4284c9ccb2bfb17fa9bdb5f5d408148ff553b3ee", + "zh:2fc39079ba61411a737df2908942e6970cb67ed2f4fb19090cd44ce2082903dd", + "zh:472a71c624952cff7aa98a7b967f6c7bb53153dbd2b8f356ceb286e6743bb4e2", + "zh:4cff06d31272aac8bc35e9b7faec42cf4554cbcbae1092eaab6ab7f643c215d9", + "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", + "zh:7ed16ccd2049fa089616b98c0bd57219f407958f318f3c697843e2397ddf70df", + "zh:842696362c92bf2645eb85c739410fd51376be6c488733efae44f4ce688da50e", + "zh:8985129f2eccfd7f1841ce06f3bf2bbede6352ec9e9f926fbaa6b1a05313b326", + "zh:a5f0602d8ec991a5411ef42f872aa90f6347e93886ce67905c53cfea37278e05", + "zh:bf4ab82cbe5256dcef16949973bf6aa1a98c2c73a98d6a44ee7bc40809d002b8", + "zh:e70770be62aa70198fa899526d671643ff99eecf265bf1a50e798fc3480bd417", + ] +} + +provider "registry.terraform.io/hashicorp/helm" { + version = "2.10.1" + constraints = ">= 2.9.0" + hashes = [ + "h1:OFRsk+lMoRoNoJjJzRngH8hAq++Sb6LwrEKIjd7PeWA=", + "zh:0717312baed39fb0a00576297241b69b419880cad8771bf72dec97ebdc96b200", + "zh:0e0e287b4e8429a0700143c8159764502eba0b33b1d094bf0d4ef4d93c7802cb", + "zh:4f74605377dab4065aaad35a2c5fa6186558c6e2e57b9058bdc8a62cf91857b9", + "zh:505f4af4dedb7a4f8f45b4201900b8e16216bdc2a01cc84fe13cdbf937570e7e", + "zh:83f37fe692513c0ce307d487248765383e00f9a84ed95f993ce0d3efdf4204d3", + "zh:840e5a84e1b5744f0211f611a2c6890da58016a40aafd5971f12285164d4e29b", + "zh:8c03d8dee292fa0367b0511cf3e95b706e034f78025f5dff0388116e1798bf47", + "zh:937800d1860f6b3adbb20e65f11e5fcd940b21ce8bdb48198630426244691325", + "zh:c1853aa5cbbdd1d46f4b169e84c3482103f0e8575a9bb044dbde908e27348c5d", + "zh:c9b0f640590da20931c30818b0b0587aa517d5606cb6e8052e4e4bf38f97b54d", + "zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c", + "zh:fe8bd4dd09dc7ca218959eda1ced9115408c2cdc9b4a76964bfa455f3bcadfd3", + ] +} + +provider "registry.terraform.io/hashicorp/kubernetes" { + version = "2.23.0" + constraints = ">= 2.0.1, >= 2.10.0" + hashes = [ + "h1:cMs2scNCSgQhGamomGT5Ag4i8ms/mql1AR7NJc2hmbA=", + "zh:10488a12525ed674359585f83e3ee5e74818b5c98e033798351678b21b2f7d89", + "zh:1102ba5ca1a595f880e67102bbf999cc8b60203272a078a5b1e896d173f3f34b", + "zh:1347cf958ed3f3f80b3c7b3e23ddda3d6c6573a81847a8ee92b7df231c238bf6", + "zh:2cb18e9f5156bc1b1ee6bc580a709f7c2737d142722948f4a6c3c8efe757fa8d", + "zh:5506aa6f28dcca2a265ccf8e34478b5ec2cb43b867fe6d93b0158f01590fdadd", + "zh:6217a20686b631b1dcb448ee4bc795747ebc61b56fbe97a1ad51f375ebb0d996", + "zh:8accf916c00579c22806cb771e8909b349ffb7eb29d9c5468d0a3f3166c7a84a", + "zh:9379b0b54a0fa030b19c7b9356708ec8489e194c3b5e978df2d31368563308e5", + "zh:aa99c580890691036c2931841e88e7ee80d59ae52289c8c2c28ea0ac23e31520", + "zh:c57376d169875990ac68664d227fb69cd0037b92d0eba6921d757c3fd1879080", + "zh:e6068e3f94f6943b5586557b73f109debe19d1a75ca9273a681d22d1ce066579", + "zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c", + ] +} + +provider "registry.terraform.io/hashicorp/local" { + version = "2.4.0" + constraints = ">= 1.0.0" + hashes = [ + "h1:Bs7LAkV/iQTLv72j+cTMrvx2U3KyXrcVHaGbdns1NcE=", + "zh:53604cd29cb92538668fe09565c739358dc53ca56f9f11312b9d7de81e48fab9", + "zh:66a46e9c508716a1c98efbf793092f03d50049fa4a83cd6b2251e9a06aca2acf", + "zh:70a6f6a852dd83768d0778ce9817d81d4b3f073fab8fa570bff92dcb0824f732", + "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", + "zh:82a803f2f484c8b766e2e9c32343e9c89b91997b9f8d2697f9f3837f62926b35", + "zh:9708a4e40d6cc4b8afd1352e5186e6e1502f6ae599867c120967aebe9d90ed04", + "zh:973f65ce0d67c585f4ec250c1e634c9b22d9c4288b484ee2a871d7fa1e317406", + "zh:c8fa0f98f9316e4cfef082aa9b785ba16e36ff754d6aba8b456dab9500e671c6", + "zh:cfa5342a5f5188b20db246c73ac823918c189468e1382cb3c48a9c0c08fc5bf7", + "zh:e0e2b477c7e899c63b06b38cd8684a893d834d6d0b5e9b033cedc06dd7ffe9e2", + "zh:f62d7d05ea1ee566f732505200ab38d94315a4add27947a60afa29860822d3fc", + "zh:fa7ce69dde358e172bd719014ad637634bbdabc49363104f4fca759b4b73f2ce", + ] +} + +provider "registry.terraform.io/hashicorp/null" { + version = "3.2.1" + constraints = ">= 2.0.0" + hashes = [ + "h1:tSj1mL6OQ8ILGqR2mDu7OYYYWf+hoir0pf9KAQ8IzO8=", + "zh:58ed64389620cc7b82f01332e27723856422820cfd302e304b5f6c3436fb9840", + "zh:62a5cc82c3b2ddef7ef3a6f2fedb7b9b3deff4ab7b414938b08e51d6e8be87cb", + "zh:63cff4de03af983175a7e37e52d4bd89d990be256b16b5c7f919aff5ad485aa5", + "zh:74cb22c6700e48486b7cabefa10b33b801dfcab56f1a6ac9b6624531f3d36ea3", + "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", + "zh:79e553aff77f1cfa9012a2218b8238dd672ea5e1b2924775ac9ac24d2a75c238", + "zh:a1e06ddda0b5ac48f7e7c7d59e1ab5a4073bbcf876c73c0299e4610ed53859dc", + "zh:c37a97090f1a82222925d45d84483b2aa702ef7ab66532af6cbcfb567818b970", + "zh:e4453fbebf90c53ca3323a92e7ca0f9961427d2f0ce0d2b65523cc04d5d999c2", + "zh:e80a746921946d8b6761e77305b752ad188da60688cfd2059322875d363be5f5", + "zh:fbdb892d9822ed0e4cb60f2fedbdbb556e4da0d88d3b942ae963ed6ff091e48f", + "zh:fca01a623d90d0cad0843102f9b8b9fe0d3ff8244593bd817f126582b52dd694", + ] +} + +provider "registry.terraform.io/hashicorp/random" { + version = "3.5.1" + hashes = [ + "h1:sZ7MTSD4FLekNN2wSNFGpM+5slfvpm5A/NLVZiB7CO0=", + "zh:04e3fbd610cb52c1017d282531364b9c53ef72b6bc533acb2a90671957324a64", + "zh:119197103301ebaf7efb91df8f0b6e0dd31e6ff943d231af35ee1831c599188d", + "zh:4d2b219d09abf3b1bb4df93d399ed156cadd61f44ad3baf5cf2954df2fba0831", + "zh:6130bdde527587bbe2dcaa7150363e96dbc5250ea20154176d82bc69df5d4ce3", + "zh:6cc326cd4000f724d3086ee05587e7710f032f94fc9af35e96a386a1c6f2214f", + "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", + "zh:b6d88e1d28cf2dfa24e9fdcc3efc77adcdc1c3c3b5c7ce503a423efbdd6de57b", + "zh:ba74c592622ecbcef9dc2a4d81ed321c4e44cddf7da799faa324da9bf52a22b2", + "zh:c7c5cde98fe4ef1143bd1b3ec5dc04baf0d4cc3ca2c5c7d40d17c0e9b2076865", + "zh:dac4bad52c940cd0dfc27893507c1e92393846b024c5a9db159a93c534a3da03", + "zh:de8febe2a2acd9ac454b844a4106ed295ae9520ef54dc8ed2faf29f12716b602", + "zh:eab0d0495e7e711cca367f7d4df6e322e6c562fc52151ec931176115b83ed014", + ] +} + +provider "registry.terraform.io/hashicorp/time" { + version = "0.9.1" + constraints = ">= 0.9.0" + hashes = [ + "h1:UHcDnIYFZ00uoou0TwPGMwOrE8gTkoRephIvdwDAK70=", + "zh:00a1476ecf18c735cc08e27bfa835c33f8ac8fa6fa746b01cd3bcbad8ca84f7f", + "zh:3007f8fc4a4f8614c43e8ef1d4b0c773a5de1dcac50e701d8abc9fdc8fcb6bf5", + "zh:5f79d0730fdec8cb148b277de3f00485eff3e9cf1ff47fb715b1c969e5bbd9d4", + "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", + "zh:8c8094689a2bed4bb597d24a418bbbf846e15507f08be447d0a5acea67c2265a", + "zh:a6d9206e95d5681229429b406bc7a9ba4b2d9b67470bda7df88fa161508ace57", + "zh:aa299ec058f23ebe68976c7581017de50da6204883950de228ed9246f309e7f1", + "zh:b129f00f45fba1991db0aa954a6ba48d90f64a738629119bfb8e9a844b66e80b", + "zh:ef6cecf5f50cda971c1b215847938ced4cb4a30a18095509c068643b14030b00", + "zh:f1f46a4f6c65886d2dd27b66d92632232adc64f92145bf8403fe64d5ffa5caea", + "zh:f79d6155cda7d559c60d74883a24879a01c4d5f6fd7e8d1e3250f3cd215fb904", + "zh:fd59fa73074805c3575f08cd627eef7acda14ab6dac2c135a66e7a38d262201c", + ] +} + +provider "registry.terraform.io/hashicorp/tls" { + version = "4.0.4" + constraints = ">= 3.0.0" + hashes = [ + "h1:Wd3RqmQW60k2QWPN4sK5CtjGuO1d+CRNXgC+D4rKtXc=", + "zh:23671ed83e1fcf79745534841e10291bbf34046b27d6e68a5d0aab77206f4a55", + "zh:45292421211ffd9e8e3eb3655677700e3c5047f71d8f7650d2ce30242335f848", + "zh:59fedb519f4433c0fdb1d58b27c210b27415fddd0cd73c5312530b4309c088be", + "zh:5a8eec2409a9ff7cd0758a9d818c74bcba92a240e6c5e54b99df68fff312bbd5", + "zh:5e6a4b39f3171f53292ab88058a59e64825f2b842760a4869e64dc1dc093d1fe", + "zh:810547d0bf9311d21c81cc306126d3547e7bd3f194fc295836acf164b9f8424e", + "zh:824a5f3617624243bed0259d7dd37d76017097dc3193dac669be342b90b2ab48", + "zh:9361ccc7048be5dcbc2fafe2d8216939765b3160bd52734f7a9fd917a39ecbd8", + "zh:aa02ea625aaf672e649296bce7580f62d724268189fe9ad7c1b36bb0fa12fa60", + "zh:c71b4cd40d6ec7815dfeefd57d88bc592c0c42f5e5858dcc88245d371b4b8b1e", + "zh:dabcd52f36b43d250a3d71ad7abfa07b5622c69068d989e60b79b2bb4f220316", + "zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c", + ] +} diff --git a/.aspect/workflows/terraform/README.md b/.aspect/workflows/terraform/README.md new file mode 100644 index 0000000..e8139f8 --- /dev/null +++ b/.aspect/workflows/terraform/README.md @@ -0,0 +1,7 @@ +# Aspect Workflows demonstration deployment terraform + +The terraform configuration found here is for a clean AWS sub-account with only Aspect Workflows deployed. + +- `main.tf` : terraform backend configuration +- `vpc.tf` : VPC configuration +- `workflows.tf` : Aspect Workflows terraform module & AMI configuration diff --git a/.aspect/workflows/terraform/main.tf b/.aspect/workflows/terraform/main.tf new file mode 100644 index 0000000..950ef47 --- /dev/null +++ b/.aspect/workflows/terraform/main.tf @@ -0,0 +1,56 @@ +terraform { + required_version = "~> 1.4.0" + + backend "s3" { + bucket = "aw-deployment-terraform-state-rules-jest" + key = "global/s3/terraform.tfstate" + region = "us-west-2" + } + + required_providers { + aws = { + source = "hashicorp/aws", + version = "~> 4.58.0" + } + } +} + +provider "aws" { + region = "us-west-2" +} + +resource "aws_s3_bucket" "terraform_state" { + bucket = "aw-deployment-terraform-state-rules-jest" + + lifecycle { + prevent_destroy = true + } +} + +resource "aws_s3_bucket_versioning" "terraform_state_versioning" { + bucket = aws_s3_bucket.terraform_state.id + versioning_configuration { + status = "Enabled" + } +} + +resource "aws_s3_bucket_server_side_encryption_configuration" "terraform_state_encryption" { + bucket = aws_s3_bucket.terraform_state.id + + rule { + apply_server_side_encryption_by_default { + sse_algorithm = "AES256" + } + } +} + +resource "aws_s3_bucket_public_access_block" "terraform_state_pab" { + bucket = aws_s3_bucket.terraform_state.id + + block_public_acls = true + block_public_policy = true + ignore_public_acls = true + restrict_public_buckets = true +} + +data "aws_region" "default" {} diff --git a/.aspect/workflows/terraform/vpc.tf b/.aspect/workflows/terraform/vpc.tf new file mode 100644 index 0000000..00f49b6 --- /dev/null +++ b/.aspect/workflows/terraform/vpc.tf @@ -0,0 +1,49 @@ +locals { + cidr = "10.0.0.0/16" + azs = ["us-west-2a", "us-west-2b", "us-west-2c"] + + num_azs = length(local.azs) + num_bits_needed_for_azs = ceil(log(local.num_azs, 2)) + + private_cidr = cidrsubnet(local.cidr, 1, 0) + private_subnets = [ + for i in range(local.num_azs) : cidrsubnet(local.private_cidr, local.num_bits_needed_for_azs, i) + ] + + public_cidr = cidrsubnet(local.cidr, 1, 1) + public_subnets = [ + for i in range(local.num_azs) : cidrsubnet(local.public_cidr, local.num_bits_needed_for_azs, i) + ] +} + +module "vpc" { + source = "terraform-aws-modules/vpc/aws" + version = "4.0.2" + + name = "aw_dev_vpc" + cidr = local.cidr + + azs = local.azs + private_subnets = local.private_subnets + public_subnets = local.public_subnets + + enable_nat_gateway = true + single_nat_gateway = true + enable_vpn_gateway = false + map_public_ip_on_launch = true +} + +module "vpc_endpoints" { + source = "terraform-aws-modules/vpc/aws//modules/vpc-endpoints" + version = "4.0.2" + + vpc_id = module.vpc.vpc_id + endpoints = { + s3 = { + service = "s3" + service_type = "Gateway" + tags = { Name = "s3-vpc-endpoint" } + route_table_ids = module.vpc.private_route_table_ids + }, + } +} diff --git a/.aspect/workflows/terraform/workflows.tf b/.aspect/workflows/terraform/workflows.tf new file mode 100644 index 0000000..0a97575 --- /dev/null +++ b/.aspect/workflows/terraform/workflows.tf @@ -0,0 +1,107 @@ +provider "aws" { + alias = "workflows" + + region = "us-west-2" + + default_tags { + tags = { + (module.aspect_workflows.cost_allocation_tag) = module.aspect_workflows.cost_allocation_tag_value + } + } +} + +data "aws_ami" "runner_ami" { + # Aspect's AWS account 213396452403 provides public Aspect Workflows images for getting started + # during the trial period. We recommend that all Workflows users build their own AMIs and keep + # up-to date with patches. See https://docs.aspect.build/v/workflows/install/packer for more info + # and/or https://github.com/aspect-build/workflows-images for example packer scripts and BUILD + # targets for building AMIs for Workflows. + owners = ["213396452403"] + most_recent = true + filter { + name = "name" + values = ["aspect-workflows-al2023-gcc-*"] + } +} + +module "aspect_workflows" { + providers = { + aws = aws.workflows + } + + # Aspect Workflows terraform module + source = "https://s3.us-east-2.amazonaws.com/static.aspect.build/aspect/5.7.0-rc4/workflows/terraform-aws-aspect-workflows.zip" + + # Non-terraform Aspect Workflows release artifacts are pulled from the region specific + # aspect-artifacts bucket during apply. Aspect will grant your AWS account access to this bucket + # during the trial setup. The aspect-artifacts bucket used must in the same region as the + # deployment. + aspect_artifacts_bucket = "aspect-artifacts-us-west-2" + + # Name of the deployment + customer_id = "aspect-build/rules_jest" + + # VPC properties + vpc_id = module.vpc.vpc_id + vpc_subnets = module.vpc.private_subnets + vpc_subnets_public = [] + + # Whether or not to allow SSM access to runners + enable_ssm_access = true + + # Opt-in to k8s HA remote cache. + # This will be default in future releases of Aspect Workflows. + experiments = { + k8s_remote = true + } + + # Monitoring properties + monitoring_enabled = true + + # Delivery properties + delivery_enabled = false + + # CI properties + hosts = ["gl"] + + # Warming set definitions + warming_sets = { + default = {} + } + + # Resource types for use by runner groups + resource_types = { + "default" = { + # Aspect Workflows requires instance types that have nvme drives. See + # https://aws.amazon.com/ec2/instance-types/ for full list of instance types available on AWS. + instance_types = ["c5ad.xlarge"] + image_id = data.aws_ami.runner_ami.id + } + } + + # GitHub Actions runner group definitions + gl_runner_groups = { + # The default runner group is use for the main build & test workflows. + default = { + agent_idle_timeout_min = 5 + max_runners = 5 + min_runners = 0 + project_id = "48413455" + queue = "aspect-default" + resource_type = "default" + scaling_polling_frequency = 3 + warming = true + } + # The warming runner group is used for the periodic warming job that creates + # warming archives for use by other runner groups. + warming = { + agent_idle_timeout_min = 1 + max_runners = 1 + min_runners = 0 + policies = { warming_manage : module.aspect_workflows.warming_management_policies["default"].arn } + project_id = "48413455" + queue = "aspect-warming" + resource_type = "default" + } + } +} diff --git a/.github/workflows/buildifier.yaml b/.github/workflows/buildifier.yaml deleted file mode 100644 index 6072277..0000000 --- a/.github/workflows/buildifier.yaml +++ /dev/null @@ -1,20 +0,0 @@ -name: Buildifier - -# Controls when the action will run. -on: - # Triggers the workflow on push or pull request events but only for the main branch - push: - branches: [main] - pull_request: - branches: [main] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -jobs: - check: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: buildifier - run: bazel run --enable_bzlmod //:buildifier.check diff --git a/.github/workflows/gitlab-sync.yaml b/.github/workflows/gitlab-sync.yaml new file mode 100644 index 0000000..4f41f5b --- /dev/null +++ b/.github/workflows/gitlab-sync.yaml @@ -0,0 +1,23 @@ +# Based off of https://dev.to/brunorobert/github-and-gitlab-sync-44mn + +name: GitlabSync + +on: + - workflow_dispatch + - push + - delete + +jobs: + sync: + name: Git Repo Sync + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: wangchucheng/git-repo-sync@v0.1.0 + continue-on-error: true + with: + target-url: https://gitlab.com/aspect-build/rules_jest.git + target-username: ${{ secrets.GITLAB_SYNC_USERNAME }} + target-token: ${{ secrets.GITLAB_SYNC_ACCESS_TOKEN }} diff --git a/.gitignore b/.gitignore index d734a06..1c0be0e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ bazel-* .bazelrc.user +.gitlab-aspect-workflows.yaml +**/.terraform/* node_modules example/node_modules diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..366d147 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,21 @@ +stages: + - "Setup Aspect Workflows" + - "Trigger Aspect Workflows" + +aspect-workflows-setup: + script: rosetta steps > .gitlab-aspect-workflows.yaml + stage: "Setup Aspect Workflows" + tags: + - aspect-workflows + - aspect-default + artifacts: + paths: + - .gitlab-aspect-workflows.yaml + +aspect-workflows-trigger: + stage: "Trigger Aspect Workflows" + trigger: + include: + - artifact: .gitlab-aspect-workflows.yaml + job: aspect-workflows-setup + strategy: depend