Skip to content

Commit

Permalink
move pipeline to cff concourse
Browse files Browse the repository at this point in the history
change aws account keys
remove arn_role
update some of the tasks
  • Loading branch information
nader-ziada committed Nov 14, 2024
1 parent 717c212 commit 7c49386
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 60 deletions.
2 changes: 1 addition & 1 deletion ci/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

set -eu

fly -t bosh-ecosystem sp -p bosh-aws-cpi \
fly -t bosh sp -p bosh-aws-cpi \
-c ci/pipeline.yml

71 changes: 29 additions & 42 deletions ci/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ shared:
params: &prepare-director-params
INFRASTRUCTURE: aws
DIRECTOR_VARS_FILE: |
access_key_id: ((aws-cpi-integration-tests_assume_aws_access_key.username))
secret_access_key: ((aws-cpi-integration-tests_assume_aws_access_key.password))
role_arn: ((aws-cpi-integration-tests_assume_aws_access_key.role_arn))
access_key_id: ((aws-admin.username))
secret_access_key: ((aws-admin.password))
region: us-west-1
- &deploy-director
Expand Down Expand Up @@ -39,9 +38,8 @@ shared:
file: bosh-cpi-src/ci/tasks/ensure-terminated.yml
image: bosh-integration-image
params:
AWS_ACCESS_KEY_ID: ((bosh_cpis_assume_aws_access_key.username))
AWS_SECRET_ACCESS_KEY: ((bosh_cpis_assume_aws_access_key.password))
AWS_ASSUME_ROLE_ARN: ((bosh_cpis_assume_aws_access_key.role_arn))
AWS_ACCESS_KEY_ID: ((aws-admin.username))
AWS_SECRET_ACCESS_KEY: ((aws-admin.password))
AWS_DEFAULT_REGION: us-west-1

- &teardown
Expand Down Expand Up @@ -99,12 +97,10 @@ jobs:
file: bosh-cpi-src/ci/tasks/run-integration.yml
image: bosh-integration-image
params:
AWS_ACCESS_KEY_ID: ((aws-cpi-integration-tests_assume_aws_access_key.username))
AWS_SECRET_ACCESS_KEY: ((aws-cpi-integration-tests_assume_aws_access_key.password))
AWS_ROLE_ARN: ((aws-cpi-integration-tests_assume_aws_access_key.role_arn))
BOSH_AWS_PERMISSIONS_AUDITOR_KEY_ID: ((iam-permission-auditor_assume_aws_access_key.username))
BOSH_AWS_PERMISSIONS_AUDITOR_SECRET_KEY: ((iam-permission-auditor_assume_aws_access_key.password))
BOSH_AWS_PERMISSIONS_AUDITOR_ROLE_ARN: ((iam-permission-auditor_assume_aws_access_key.role_arn))
AWS_ACCESS_KEY_ID: ((aws-test-user.username))
AWS_SECRET_ACCESS_KEY: ((aws-test-user.password))
BOSH_AWS_PERMISSIONS_AUDITOR_KEY_ID: ((aws-permission-auditor.username))
BOSH_AWS_PERMISSIONS_AUDITOR_SECRET_KEY: ((aws-permission-auditor.password))
AWS_DEFAULT_REGION: us-west-1
BOSH_AWS_KMS_KEY_ARN: ((arn_keys.aws_kms_key_arn))
BOSH_AWS_KMS_KEY_ARN_OVERRIDE: ((arn_keys.aws_kms_key_arn_override))
Expand Down Expand Up @@ -154,7 +150,6 @@ jobs:
-o pipelines/shared/assets/ops/remove-hm.yml
-o bosh-deployment/external-ip-with-registry-not-recommended.yml
-o pipelines/shared/assets/ops/remove-provider-cert.yml
-o bosh-deployment/aws/cpi-assume-role-credentials.yml
- do:
- <<: *deploy-director
- <<: *run-bats
Expand Down Expand Up @@ -206,7 +201,6 @@ jobs:
-o bosh-deployment/external-ip-with-registry-not-recommended.yml
-o pipelines/shared/assets/ops/remove-provider-cert.yml
-o pipelines/aws/assets/ops/iam-instance-profile-ops-file.yml
-o bosh-deployment/aws/cpi-assume-role-credentials.yml
- do:
- <<: *deploy-director
- <<: *run-end-2-end
Expand Down Expand Up @@ -311,7 +305,7 @@ jobs:
provider: gcs
options:
credentials_source: static
json_key: '((cloud-foundry-gcp-credentials))'
json_key: '((gcp_json_key))'
- put: bosh-cpi-src-out
params:
repository: release_repo
Expand Down Expand Up @@ -367,9 +361,8 @@ jobs:
- get: ruby-release
trigger: true
- get: bosh-integration-image
- get: bosh-ecosystem-concourse-image
- task: bump-ruby-package
image: bosh-ecosystem-concourse-image
image: bosh-integration-image
file: ruby-release/ci/tasks/shared/bump-ruby-package.yml
input_mapping:
bosh-release: bosh-cpi-src
Expand All @@ -385,7 +378,7 @@ jobs:
provider: gcs
options:
credentials_source: static
json_key: '((cloud-foundry-gcp-credentials))'
json_key: '((gcp_json_key))'
RUBY_VERSION_PATH: src/bosh_aws_cpi/.ruby-version
- task: run-unit-specs
file: bosh-cpi-src/ci/tasks/run-unit-specs.yml
Expand All @@ -401,28 +394,28 @@ resource_types:
type: registry-image
source:
repository: ljfranklin/terraform-resource
username: ((docker.username))
password: ((docker.password))
username: ((dockerhub_username))
password: ((dockerhub_password))
- name: gcs
type: registry-image
source:
repository: frodenas/gcs-resource
username: ((docker.username))
password: ((docker.password))
username: ((dockerhub_username))
password: ((dockerhub_password))

resources:
- name: bosh-cpi-dev-artifacts
type: gcs
source:
versioned_file: bosh-aws-cpi-dev-release.tgz
bucket: bosh-aws-cpi-pipeline
json_key: ((cloud-foundry-gcp-credentials))
json_key: ((gcp_json_key))
- name: bosh-cpi-release-notes
type: gcs
source:
versioned_file: release-notes
bucket: bosh-aws-cpi-pipeline
json_key: ((cloud-foundry-gcp-credentials))
json_key: ((gcp_json_key))
- name: bosh-cpi-src-in
type: git
source:
Expand Down Expand Up @@ -454,26 +447,25 @@ resources:
key: current-version # dev-release version
bucket: bosh-aws-cpi-pipeline
driver: gcs
json_key: ((cloud-foundry-gcp-credentials))
json_key: ((gcp_json_key))
- name: release-version-semver
type: semver
source:
key: release-current-version
bucket: bosh-aws-cpi-pipeline
driver: gcs
json_key: ((cloud-foundry-gcp-credentials))
json_key: ((gcp_json_key))
- name: environment
type: terraform_type
source:
backend_type: gcs
backend_config:
bucket: bosh-aws-cpi-pipeline
prefix: terraform
credentials: ((cloud-foundry-gcp-credentials))
credentials: ((gcp_json_key))
vars:
access_key: ((bosh_cpis_assume_aws_access_key.username))
secret_key: ((bosh_cpis_assume_aws_access_key.password))
role_arn: ((bosh_cpis_assume_aws_access_key.role_arn))
access_key: ((aws-admin.username))
secret_key: ((aws-admin.password))
region: us-west-1
public_key: ((integration_vm_keypair.public_key))
- name: pipelines
Expand Down Expand Up @@ -508,33 +500,28 @@ resources:
type: registry-image
source:
repository: bosh/integration
username: ((docker.username))
password: ((docker.password))
username: ((dockerhub_username))
password: ((dockerhub_password))
- name: bosh-ruby-release-registry-image
type: registry-image
source:
repository: bosh/ruby-release
username: ((docker.username))
password: ((docker.password))
username: ((dockerhub_username))
password: ((dockerhub_password))
- name: ruby-release
type: git
source:
uri: https://github.com/cloudfoundry/bosh-package-ruby-release.git
- name: bosh-ecosystem-concourse-image
type: registry-image
source:
repository: bosh/bosh-ecosystem-concourse
username: ((docker.username))
password: ((docker.password))
- name: bosh-security-scanner-registry-image
type: registry-image
source:
repository: bosh/security-scanner
username: ((docker.username))
password: ((docker.password))
username: ((dockerhub_username))
password: ((dockerhub_password))
- name: weekly
type: time
source:
start: 3:00 -0700
stop: 4:30 -0700
days: [ Saturday ]
initial_version: true
20 changes: 9 additions & 11 deletions ci/tasks/ensure-terminated.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,15 @@ set -e
: ${AWS_DEFAULT_REGION:?}


if [ -n "${AWS_ASSUME_ROLE_ARN}" ]; then
aws configure --profile creds_account set aws_access_key_id "${AWS_ACCESS_KEY_ID}"
aws configure --profile creds_account set aws_secret_access_key "${AWS_SECRET_ACCESS_KEY}"
aws configure --profile resource_account set source_profile "creds_account"
aws configure --profile resource_account set role_arn "${AWS_ASSUME_ROLE_ARN}"
aws configure --profile resource_account set region "${AWS_DEFAULT_REGION}"
unset AWS_ACCESS_KEY_ID
unset AWS_SECRET_ACCESS_KEY
unset AWS_DEFAULT_REGION
export AWS_PROFILE=resource_account
fi
aws configure --profile creds_account set aws_access_key_id "${AWS_ACCESS_KEY_ID}"
aws configure --profile creds_account set aws_secret_access_key "${AWS_SECRET_ACCESS_KEY}"
aws configure --profile resource_account set source_profile "creds_account"
aws configure --profile resource_account set region "${AWS_DEFAULT_REGION}"
unset AWS_ACCESS_KEY_ID
unset AWS_SECRET_ACCESS_KEY
unset AWS_DEFAULT_REGION
export AWS_PROFILE=resource_account

metadata=$(cat environment/metadata)
vpc_id=$(echo ${metadata} | jq --raw-output ".vpc_id")

Expand Down
1 change: 0 additions & 1 deletion ci/tasks/ensure-terminated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ params:
AWS_ACCESS_KEY_ID: ""
AWS_SECRET_ACCESS_KEY: ""
AWS_DEFAULT_REGION: ""
AWS_ASSUME_ROLE_ARN: ""
4 changes: 1 addition & 3 deletions ci/tasks/run-integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ export BOSH_AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
if [ "${AWS_SESSION_TOKEN}" ]; then
export BOSH_AWS_SESSION_TOKEN=${AWS_SESSION_TOKEN}
fi
if [ "${AWS_ROLE_ARN}" ]; then
export BOSH_AWS_ROLE_ARN=${AWS_ROLE_ARN}
fi

export BOSH_AWS_DEFAULT_KEY_NAME=$(echo ${metadata} | jq -e --raw-output ".default_key_name")
export BOSH_AWS_REGION=$(echo ${metadata} | jq -e --raw-output ".region")
export BOSH_AWS_SUBNET_ID=$(echo ${metadata} | jq -e --raw-output ".subnet_id")
Expand Down
2 changes: 0 additions & 2 deletions ci/tasks/run-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@ run:
params:
AWS_ACCESS_KEY_ID: ""
AWS_SECRET_ACCESS_KEY: ""
AWS_ROLE_ARN: ""
AWS_DEFAULT_REGION: ""
BOSH_AWS_KMS_KEY_ARN: ""
BOSH_AWS_KMS_KEY_ARN_OVERRIDE: ""
BOSH_AWS_PERMISSIONS_AUDITOR_KEY_ID: ""
BOSH_AWS_PERMISSIONS_AUDITOR_SECRET_KEY: ""
BOSH_AWS_PERMISSIONS_AUDITOR_ROLE_ARN: ""
BOSH_AWS_CPI_API_VERSION:
BOSH_AWS_WINDOWS_IMAGE_ID:

0 comments on commit 7c49386

Please sign in to comment.