Skip to content

Commit

Permalink
CI: Updated pipeline and dockerfile for Cryo CI
Browse files Browse the repository at this point in the history
[#176850008]
  • Loading branch information
gbandres98 committed Jun 15, 2021
1 parent 045d7e1 commit 52683ae
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 38 deletions.
17 changes: 15 additions & 2 deletions ci/dockerfiles/deployment/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
FROM golang
FROM golang:1.13
MAINTAINER https://github.com/cloudfoundry/bosh-bootloader

ARG GITHUB_TOKEN
ENV TERRAFORM_VERSION 0.15.3
ENV RUBY_VERSION 3.0.1

# Create testuser
RUN mkdir -p /home/testuser && \
groupadd -r testuser -g 433 && \
useradd -u 431 -r -g testuser -d /home/testuser -s /usr/sbin/nologin -c "Docker image test user" testuser && \
chown testuser:testuser /home/testuser

RUN \
apt-get update && \
apt-get -qqy install --fix-missing \
runit \
apt-transport-https \
openssl \
silversearcher-ag \
Expand Down Expand Up @@ -80,4 +87,10 @@ RUN curl https://bootstrap.pypa.io/get-pip.py | python3

# Install yq
RUN pip install yq
RUN pip install -U awscli
RUN pip install -U awscli

# Install ginkgo
RUN go get -u github.com/onsi/ginkgo/ginkgo

RUN chown -R testuser:testuser /usr/local/go/pkg
RUN chown -R testuser:testuser /go
69 changes: 34 additions & 35 deletions ci/pipelines/bosh-bootloader.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ resources:
source:
uri: git@github.com:cloudfoundry/bosh-bootloader.git
branch: main
private_key: ((bbl_readwrite_deploy_key.private_key))
private_key: ((readwrite_deploy_key.private_key))
# ignore_paths:
# - docs/**
# - README.md
Expand All @@ -64,7 +64,7 @@ resources:
source:
uri: git@github.com:cloudfoundry/bosh-bootloader.git
branch: gh-pages
private_key: ((bbl_readwrite_deploy_key.private_key))
private_key: ((readwrite_deploy_key.private_key))

- name: relint-envs
type: git
Expand All @@ -91,8 +91,8 @@ resources:
bucket: bbl-version
region_name: us-east-1
key: bbl-version-bump-deployments
access_key_id: ((bbl_s3_aws_access_key_id))
secret_access_key: ((bbl_s3_aws_secret_access_key))
access_key_id: ((s3_aws.access_key_id))
secret_access_key: ((s3_aws.secret_access_key))

# - name: bbl-release
# type: github-release
Expand All @@ -107,7 +107,7 @@ resources:
source:
owner: cloudfoundry
repository: bosh-bootloader
access_token: ((cf_deployment_release_bot_access_token))
access_token: ((github.access_token))
drafts: false

- name: homebrew-tap
Expand Down Expand Up @@ -151,8 +151,8 @@ resources:
type: docker-image
source:
repository: relintdockerhubpushbot/cf-deployment-concourse-tasks-bbl-dev
username: ((dockerhub.username))
password: ((dockerhub.password))
username: ((bbl_dockerhub.username))
password: ((bbl_dockerhub.password))
email: cf-release-integration+dockerhub-push-bot@pivotal.io

- name: cf-deployment-concourse-tasks-docker-image
Expand All @@ -165,7 +165,7 @@ resources:
source:
uri: git@github.com:cloudfoundry/bosh-bootloader.git
branch: main
private_key: ((bbl_readwrite_deploy_key.private_key))
private_key: ((readwrite_deploy_key.private_key))
paths:
- dockerfiles/cf-deployment-concourse-tasks-bbl-dev

Expand All @@ -174,7 +174,7 @@ resources:
source:
uri: git@github.com:cloudfoundry/bosh-bootloader.git
branch: bump-deployments-ci
private_key: ((bbl_readwrite_deploy_key.private_key))
private_key: ((readwrite_deploy_key.private_key))

- name: concourse-smoke-tests
type: git
Expand Down Expand Up @@ -244,7 +244,7 @@ jobs:
input_mapping:
bbl-release: bbl-release-official
params:
DEPLOY_KEY: ((bbl_readwrite_deploy_key.private_key))
DEPLOY_KEY: ((readwrite_deploy_key.private_key))

- put: bump-deployments-ci
resource: bosh-bootloader-bump-deployments-ci
Expand All @@ -260,8 +260,6 @@ jobs:
resource: bosh-bootloader
- get: bosh-bootloader
resource: bosh-bootloader-bump-deployments-ci
passed:
- bump-deployments
trigger: true
- get: version
resource: version-bump-deployments
Expand Down Expand Up @@ -290,7 +288,7 @@ jobs:
# - task: download-terraform
# file: bbl-ci/ci/tasks/download-terraform/task.yml
# params:
# TF_VERSION: 0.11.7
# TF_VERSION: 0.15.3
#
# - in_parallel:
# - task: plan
Expand Down Expand Up @@ -357,17 +355,18 @@ jobs:
- task: download-terraform
file: bbl-ci/ci/tasks/download-terraform/task.yml
params:
TF_VERSION: 0.11.7
TF_VERSION: 0.15.3

- task: bbl-tests
file: bbl-ci/ci/tasks/acceptance/task.yml
params:
BBL_IAAS: gcp
BBL_GCP_SERVICE_ACCOUNT_KEY: ((bbl_gcp_service_account_json))
BBL_GCP_SERVICE_ACCOUNT_KEY: ((bbl_gcp.service_account_json))
BBL_GCP_REGION: us-central1
BBL_TEST_ENV_ID_PREFIX: bump-deployments
BBL_TEST_PACKAGES: bbl
BBL_DOWN_TIMEOUT: 20m
RUN_TEST: ssh

- name: bbl-downstream-docker-image-bump-deployments
plan:
Expand All @@ -392,7 +391,7 @@ jobs:
- task: download-terraform
file: bbl-ci/ci/tasks/download-terraform/task.yml
params:
TF_VERSION: 0.11.7
TF_VERSION: 0.15.3

- task: generate-version-from-sha
file: bbl-ci/ci/tasks/generate-version-from-sha/task.yml
Expand Down Expand Up @@ -720,7 +719,7 @@ jobs:
image: cf-deployment-concourse-tasks-bbl-dev
params:
BBL_IAAS: gcp
BBL_GCP_SERVICE_ACCOUNT_KEY: ((bbl_gcp_service_account_json))
BBL_GCP_SERVICE_ACCOUNT_KEY: ((bbl_gcp.service_account_json))
BBL_GCP_REGION: us-central1
BBL_ENV_NAME: bump-deployments-downstream
BBL_STATE_DIR: bump-deployments/bbl-gcp-cf
Expand All @@ -730,7 +729,7 @@ jobs:
image: cf-deployment-concourse-tasks-bbl-dev
params:
BBL_IAAS: gcp
BBL_GCP_SERVICE_ACCOUNT_KEY: ((bbl_gcp_service_account_json))
BBL_GCP_SERVICE_ACCOUNT_KEY: ((bbl_gcp.service_account_json))
BBL_GCP_REGION: us-central1
BBL_LB_CERT: ((bbl_cf_ssl_cert.certificate))
BBL_LB_KEY: ((bbl_cf_ssl_cert.private_key))
Expand All @@ -748,7 +747,7 @@ jobs:
image: cf-deployment-concourse-tasks-bbl-dev
params:
BBL_STATE_DIR: bump-deployments/bbl-gcp-cf
BBL_GCP_SERVICE_ACCOUNT_KEY: ((bbl_gcp_service_account_json))
BBL_GCP_SERVICE_ACCOUNT_KEY: ((bbl_gcp.service_account_json))
input_mapping:
bbl-state: updated-bbl-state
ensure:
Expand All @@ -762,7 +761,7 @@ jobs:
image: cf-deployment-concourse-tasks-bbl-dev
params:
BBL_STATE_DIR: bump-deployments/bbl-gcp-cf
GCP_DNS_SERVICE_ACCOUNT_KEY: ((bbl_dns_service_account_json))
GCP_DNS_SERVICE_ACCOUNT_KEY: ((bbl_dns.service_account_json))
GCP_DNS_ZONE_NAME: infrastructure
GCP_DNS_RECORD_SET_NAME: bump-deployments-cf.infrastructure.cf-app.com
ACTION: add
Expand All @@ -776,7 +775,7 @@ jobs:
bbl-state: updated-bbl-state
params:
BBL_STATE_DIR: bump-deployments/bbl-gcp-cf
BBL_GCP_SERVICE_ACCOUNT_KEY: ((bbl_gcp_service_account_json))
BBL_GCP_SERVICE_ACCOUNT_KEY: ((bbl_gcp.service_account_json))
ensure:
put: relint-envs
params:
Expand All @@ -790,7 +789,7 @@ jobs:
bbl-state: updated-bbl-state
params:
BBL_STATE_DIR: bump-deployments/bbl-gcp-cf
BBL_GCP_SERVICE_ACCOUNT_KEY: ((bbl_gcp_service_account_json))
BBL_GCP_SERVICE_ACCOUNT_KEY: ((bbl_gcp.service_account_json))
SYSTEM_DOMAIN: bump-deployments-cf.infrastructure.cf-app.com
VARS_STORE_FILE: bump-deployments/bbl-gcp-cf/deployment-vars.yml
OPS_FILES: "operations/use-compiled-releases.yml"
Expand All @@ -801,7 +800,7 @@ jobs:
image: cf-deployment-concourse-tasks-bbl-dev
params:
BBL_STATE_DIR: bump-deployments/bbl-gcp-cf
GCP_DNS_SERVICE_ACCOUNT_KEY: ((bbl_dns_service_account_json))
GCP_DNS_SERVICE_ACCOUNT_KEY: ((bbl_dns.service_account_json))
GCP_DNS_ZONE_NAME: infrastructure
GCP_DNS_RECORD_SET_NAME: bump-deployments-cf.infrastructure.cf-app.com
ACTION: remove
Expand All @@ -815,7 +814,7 @@ jobs:
bbl-state: updated-bbl-state
params:
BBL_STATE_DIR: bump-deployments/bbl-gcp-cf
BBL_GCP_SERVICE_ACCOUNT_KEY: ((bbl_gcp_service_account_json))
BBL_GCP_SERVICE_ACCOUNT_KEY: ((bbl_gcp.service_account_json))

- task: bosh-cleanup
file: cf-deployment-concourse-tasks/bosh-cleanup/task.yml
Expand All @@ -825,7 +824,7 @@ jobs:
params:
CLEAN_ALL: true
BBL_STATE_DIR: bump-deployments/bbl-gcp-cf
BBL_GCP_SERVICE_ACCOUNT_KEY: ((bbl_gcp_service_account_json))
BBL_GCP_SERVICE_ACCOUNT_KEY: ((bbl_gcp.service_account_json))

- task: destroy-infrastructure
file: cf-deployment-concourse-tasks/bbl-destroy/task.yml
Expand All @@ -834,7 +833,7 @@ jobs:
bbl-state: updated-bbl-state
params:
BBL_STATE_DIR: bump-deployments/bbl-gcp-cf
BBL_GCP_SERVICE_ACCOUNT_KEY: ((bbl_gcp_service_account_json))
BBL_GCP_SERVICE_ACCOUNT_KEY: ((bbl_gcp.service_account_json))
ensure:
put: relint-envs
params:
Expand All @@ -858,7 +857,7 @@ jobs:
bbl-state: updated-bbl-state
params:
BBL_STATE_DIR: bump-deployments/bbl-gcp-cf
BBL_GCP_SERVICE_ACCOUNT_KEY: ((bbl_gcp_service_account_json))
BBL_GCP_SERVICE_ACCOUNT_KEY: ((bbl_gcp.service_account_json))

- task: bosh-cleanup
file: cf-deployment-concourse-tasks/bosh-cleanup/task.yml
Expand All @@ -868,14 +867,14 @@ jobs:
params:
CLEAN_ALL: true
BBL_STATE_DIR: bump-deployments/bbl-gcp-cf
BBL_GCP_SERVICE_ACCOUNT_KEY: ((bbl_gcp_service_account_json))
BBL_GCP_SERVICE_ACCOUNT_KEY: ((bbl_gcp.service_account_json))

- task: remove-from-gcp-dns
file: runtime-ci/tasks/manage-gcp-dns/task.yml
image: cf-deployment-concourse-tasks-bbl-dev
params:
BBL_STATE_DIR: bump-deployments/bbl-gcp-cf
GCP_DNS_SERVICE_ACCOUNT_KEY: ((bbl_dns_service_account_json))
GCP_DNS_SERVICE_ACCOUNT_KEY: ((bbl_dns.service_account_json))
GCP_DNS_ZONE_NAME: infrastructure
GCP_DNS_RECORD_SET_NAME: bump-deployments-cf.infrastructure.cf-app.com
ACTION: remove
Expand All @@ -889,7 +888,7 @@ jobs:
bbl-state: updated-bbl-state
params:
BBL_STATE_DIR: bump-deployments/bbl-gcp-cf
BBL_GCP_SERVICE_ACCOUNT_KEY: ((bbl_gcp_service_account_json))
BBL_GCP_SERVICE_ACCOUNT_KEY: ((bbl_gcp.service_account_json))
on_failure:
put: relint-envs
params:
Expand Down Expand Up @@ -926,7 +925,7 @@ jobs:
image: cf-deployment-concourse-tasks-bbl-dev
params:
BBL_IAAS: gcp
BBL_GCP_SERVICE_ACCOUNT_KEY: ((bbl_gcp_service_account_json))
BBL_GCP_SERVICE_ACCOUNT_KEY: ((bbl_gcp.service_account_json))
BBL_GCP_REGION: us-central1
BBL_ENV_NAME: bump-deployments-gcp-concourse
BBL_STATE_DIR: bump-deployments/bbl-gcp-concourse
Expand All @@ -936,7 +935,7 @@ jobs:
image: cf-deployment-concourse-tasks-bbl-dev
params:
BBL_IAAS: gcp
BBL_GCP_SERVICE_ACCOUNT_KEY: ((bbl_gcp_service_account_json))
BBL_GCP_SERVICE_ACCOUNT_KEY: ((bbl_gcp.service_account_json))
BBL_GCP_REGION: us-central1
BBL_ENV_NAME: bump-deployments-gcp-concourse
BBL_STATE_DIR: bump-deployments/bbl-gcp-concourse
Expand All @@ -948,7 +947,7 @@ jobs:
image: cf-deployment-concourse-tasks-bbl-dev
params:
BBL_STATE_DIR: bump-deployments/bbl-gcp-concourse
BBL_GCP_SERVICE_ACCOUNT_KEY: ((bbl_gcp_service_account_json))
BBL_GCP_SERVICE_ACCOUNT_KEY: ((bbl_gcp.service_account_json))
input_mapping:
bbl-state: updated-bbl-state
ensure:
Expand Down Expand Up @@ -1006,7 +1005,7 @@ jobs:
bbl-state: updated-bbl-state
params:
BBL_STATE_DIR: bump-deployments/bbl-gcp-concourse
BBL_GCP_SERVICE_ACCOUNT_KEY: ((bbl_gcp_service_account_json))
BBL_GCP_SERVICE_ACCOUNT_KEY: ((bbl_gcp.service_account_json))
on_failure:
put: relint-envs
params:
Expand Down Expand Up @@ -1191,7 +1190,7 @@ jobs:
- task: download-terraform
file: bbl-ci/ci/tasks/download-terraform/task.yml
params:
TF_VERSION: 0.11.7
TF_VERSION: 0.15.3

- task: build-binaries
file: bbl-ci/ci/tasks/build-release/task.yml
Expand Down
2 changes: 1 addition & 1 deletion ci/tasks/create-bosh-deployment-source-file/task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ platform: linux
image_resource:
type: docker-image
source:
repository: cfinfrastructure/deployment
repository: cryogenics/bbl-deployment

inputs:
- name: bbl-ci
Expand Down
2 changes: 2 additions & 0 deletions ci/tasks/test-bosh-bootloader/task
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ function main() {
pushd "${GOPATH}/src/github.com/cloudfoundry" > /dev/null
ln -s "${ROOT}/bosh-bootloader"
local username="testuser"
chown -R ${username}:${username} /usr/local/go/pkg
chown -R ${username}:${username} /go
chpst -u ${username}:${username} env HOME=/home/${username} ./bosh-bootloader/scripts/test
popd > /dev/null
}
Expand Down

0 comments on commit 52683ae

Please sign in to comment.