Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
32 changes: 32 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,35 @@ jobs:
- uses: golangci/golangci-lint-action@v9
with:
working-directory: src/brats/

lint-bosh-nats-sync:
name: lint (bosh-nats-sync)
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v7
Comment thread
aramprice marked this conversation as resolved.
with:
persist-credentials: false
- uses: actions/setup-go@v6
Comment thread
aramprice marked this conversation as resolved.
with:
go-version-file: src/bosh-nats-sync/go.mod
- uses: golangci/golangci-lint-action@v9
with:
working-directory: src/bosh-nats-sync/

test-bosh-nats-sync:
name: test (bosh-nats-sync)
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: actions/setup-go@v6
with:
go-version-file: src/bosh-nats-sync/go.mod
- name: Run tests
run: go test -race ./...
working-directory: src/bosh-nats-sync/
1 change: 0 additions & 1 deletion .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ jobs:
sub_project:
- common:parallel
- monitor:parallel
- nats_sync:parallel
- release:parallel
- integration_support:parallel
steps:
Expand Down
149 changes: 149 additions & 0 deletions ci/fly-bats.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
---
# Standalone pipeline for running the BOSH Acceptance Test suite (BATs)
# against a specific branch.
#
# Intended to be driven by `bundle exec rake fly:bats` from src/, which
# pushes the current branch and sets this pipeline automatically.
#
# Manual usage:
# fly -t bosh set-pipeline -p bats-local \
# -c ci/fly-bats.yml \
# --var bosh_repo=https://github.com/cloudfoundry/bosh.git \
# --var bosh_branch=my-feature-branch \
# --var env_name=bats-local \
# --var stemcell_name=bosh-google-kvm-ubuntu-noble \
# --var deploy_args="-o bosh-deployment/external-ip-not-recommended.yml" \
# --var bat_rspec_flags=""
# fly -t bosh unpause-pipeline -p bats-local
# fly -t bosh trigger-job -j bats-local/bats -w

resources:
- name: bosh
type: git
source:
uri: ((bosh_repo))
branch: ((bosh_branch))

# bosh-ci is the same repo as bosh but filtered to ci/ paths so that
# scripts under ci/bats/ are available at bosh-ci/ in the task workspace.
- name: bosh-ci
type: git
source:
uri: ((bosh_repo))
branch: ((bosh_branch))
paths: [ci]

- name: bosh-cli
type: github-release
source:
owner: cloudfoundry
repository: bosh-cli
access_token: ((github_public_repo_token))

- name: stemcell
type: bosh-io-stemcell
source:
name: bosh-google-kvm-ubuntu-noble

- name: bats
type: git
source:
uri: https://github.com/cloudfoundry/bosh-acceptance-tests.git
branch: master

- name: bosh-deployment
type: git
source:
uri: https://github.com/cloudfoundry/bosh-deployment
branch: master

- name: integration-image
type: registry-image
source:
repository: ghcr.io/cloudfoundry/bosh/integration
tag: main
username: ((github_read_write_packages.username))
password: ((github_read_write_packages.password))

jobs:
- name: bats
serial: true
plan:
- do:
- in_parallel:
- get: bosh
- get: bosh-ci
- get: bosh-cli
params:
globs: [bosh-cli-*-linux-amd64]
- get: stemcell
- get: bats
- get: bosh-deployment
- get: integration-image

- task: make-candidate
image: integration-image
file: bosh-ci/ci/tasks/make-candidate.yml

- task: compile-bosh-release
config:
platform: linux
# ubuntu-noble-stemcell ships the BOSH agent at /var/vcap/bosh/bin/bosh-agent.
image_resource:
type: registry-image
source:
repository: ghcr.io/cloudfoundry/ubuntu-noble-stemcell
inputs:
- name: release
outputs:
- name: compiled-release
run:
path: /bin/bash
args:
- -exc
- |
# golang-1.26-linux on this branch is a stub (env files only; no binary
# blob in GCS yet). Install Go 1.26.3 and drop a shim at
# /usr/local/bin/go so `go build` works even though $GOROOT/bin is empty.
GO_VERSION=1.26.3
if ! /usr/local/go/bin/go version 2>/dev/null | grep -q "go${GO_VERSION}"; then
curl -sSfL "https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz" \
| tar -C /usr/local -xz
fi
cat > /usr/local/bin/go <<'GOSHIM'
#!/bin/bash
export GOROOT=/usr/local/go
exec /usr/local/go/bin/go "$@"
GOSHIM
chmod +x /usr/local/bin/go

/var/vcap/bosh/bin/bosh-agent compile \
--output-directory compiled-release \
release/*.tgz

- task: run-bats
image: integration-image
input_mapping:
bosh-release: compiled-release
config:
platform: linux
inputs:
- name: bosh
- name: bosh-ci
- name: bosh-cli
- name: bosh-deployment
- name: stemcell
- name: bats
- name: bosh-release
caches:
- path: cache-dot-bosh-dir
params:
BAT_INFRASTRUCTURE: gcp
GCP_JSON_KEY: ((gcp_json_key))
GCP_PROJECT_ID: ((gcp_project_id))
STEMCELL_NAME: ((stemcell_name))
ENV_NAME: ((env_name))
DEPLOY_ARGS: ((deploy_args))
BAT_RSPEC_FLAGS: ((bat_rspec_flags))
run:
path: bosh/ci/tasks/run-bats-pipeline.sh
27 changes: 27 additions & 0 deletions ci/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1414,6 +1414,16 @@ jobs:
output_repo: bosh-out
params:
SOURCE_PATH: src/brats/
- task: bump-bosh-nats-sync-deps
file: golang-release/ci/tasks/shared/bump-deps.yml
input_mapping:
input_repo: bosh-out
output_mapping:
output_repo: bosh-out
params:
SOURCE_PATH: src/bosh-nats-sync/
GO_PACKAGE: golang-1.26-linux
GOOS_LIST: linux
- task: lint-brats
file: bosh-ci/ci/tasks/lint-brats.yml
image: integration-image
Expand Down Expand Up @@ -1455,6 +1465,8 @@ jobs:
trigger: true
params:
globs: [ nats-server-v*-linux-amd64.tar.gz ]
- get: golang-release
trigger: true
- task: bump-nginx-packages
file: nginx-release/ci/shared/bump-nginx-package.yml
image: integration-image
Expand Down Expand Up @@ -1518,6 +1530,21 @@ jobs:
options:
credentials_source: static
json_key: '((gcp_json_key))'
- task: bump-golang-package
file: golang-release/ci/tasks/shared/bump-golang-package.yml
input_mapping:
input_repo: bosh-out
output_mapping:
output_repo: bosh-out
params:
GIT_USER_NAME: *git_user_name
GIT_USER_EMAIL: *git_user_email
PACKAGES: ["golang-1.26-linux"]
PRIVATE_YML: |
blobstore:
options:
credentials_source: static
json_key: '((gcp_json_key))'
- task: bump-ruby-package
file: ruby-release/ci/tasks/shared/bump-ruby-package.yml
input_mapping:
Expand Down
Loading
Loading