Skip to content

Commit

Permalink
bootstrap-coa-env(*) Remove bucc from Docker file, make misc correcti…
Browse files Browse the repository at this point in the history
…ons and improvement
  • Loading branch information
lucaspinto committed Jul 19, 2018
1 parent 64a0209 commit f6756bd
Show file tree
Hide file tree
Showing 18 changed files with 113 additions and 56 deletions.
6 changes: 0 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@ RUN curl -sfL "https://codeclimate.com/downloads/test-reporter/test-reporter-lat
RUN curl -sfL "https://raw.githubusercontent.com/ekalinin/github-markdown-toc/master/gh-md-toc" > /usr/local/bin/gh-md-toc \
&& chmod a+x /usr/local/bin/gh-md-toc

RUN curl -sfL "https://github.com/starkandwayne/bucc/archive/v0.5.0.tar.gz" > bucc.tar.gz \
&& tar -xzf bucc.tar.gz \
&& cp bucc-0.5.0/bin/bucc /usr/local/bin/bucc \
&& chmod a+x /usr/local/bin/bucc \
&& rm -rf bucc.tar.gz bucc-0.5.0

# Download BOSH v2 CLI
RUN curl -o /usr/local/bin/bosh https://s3.amazonaws.com/bosh-cli-artifacts/bosh-cli-3.0.1-linux-amd64 \
&& echo "58e6853291c3535e77e5128af9f0e8e4303dd57e5a329aa976f197c010517975 */usr/local/bin/bosh" | shasum -a 256 -c - \
Expand Down
6 changes: 6 additions & 0 deletions ci/bootstrap-coa-env-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ resources:
skip_ssl_verification: ((cf-ops-automation-git-insecure))
paths: [ "Gemfile*", "Dockerfile" ]

- name: bucc
type: git
source:
uri: https://github.com/starkandwayne/bucc

jobs:
- name: build-cached-image
plan:
Expand All @@ -42,6 +47,7 @@ jobs:
trigger: true
- get: cf-ops-automation
trigger: true
- get: bucc
- task: generate_private_params_file
file: cf-ops-automation/concourse/tasks/generate_coa_env_bootstrap_private_prereqs.yml
params:
Expand Down
11 changes: 5 additions & 6 deletions ci/bootstrap_coa_env/prereqs.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
inactive_steps:
- deploy_transiant_infra
# - upload_stemcell
- upload_cloud_config
# - install_git_server
- upload_stemcell
# - upload_cloud_config
# - install_git_server

bucc:
path: /Users/lucaspinto/workspace/src/github.com/starkandwayne/bucc/bin/
path: bucc/bin/
cpi: virtualbox

stemcell:
Expand Down Expand Up @@ -78,7 +78,7 @@ pipeline_credentials:
secrets-branch: master
paas-templates-branch: master
cf-ops-automation-uri: http://github.com/orange-cloudfoundry/cf-ops-automation/
cf-ops-automation-branch: 113_coa_env_bootstrap
cf-ops-automation-branch: master
cf-ops-automation-tag-filter: ""
iaas-type: virtualbox
s3-stemcell-access-key-id: ""
Expand All @@ -90,4 +90,3 @@ pipeline_credentials:
stemcell-version: "3586.25"
s3-stemcell-endpoint: https://s3.amazonaws.com
s3-stemcell-skip-ssl-verification: false

7 changes: 3 additions & 4 deletions concourse/pipelines/template/depls-pipeline.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@ resources:
source:
bucket: ((s3-stemcell-bucket))
region_name: ((s3-stemcell-region-name))
# customization is required to remove bosh prefix in stemcell name
regexp: ((stemcell-name-prefix))/bosh-stemcell-(.*)-((stemcell-main-name)).tgz
regexp: ((stemcell-name-prefix))((stemcell-main-name))/bosh-stemcell-(.*)-((stemcell-main-name)).tgz
access_key_id: ((s3-stemcell-access-key-id))
secret_access_key: ((s3-stemcell-secret-key))
endpoint: ((s3-stemcell-endpoint))
Expand Down Expand Up @@ -452,7 +451,7 @@ jobs:
- get: secrets-full-writer
params: { submodules: none}
- get: bosh-stemcell
version: { path: ((stemcell-name-prefix))/bosh-stemcell-((stemcell-version))-((stemcell-main-name)).tgz }
version: { path: ((stemcell-name-prefix))((stemcell-main-name))/bosh-stemcell-((stemcell-version))-((stemcell-main-name)).tgz }
trigger: true
attempts: 2
- get: cf-ops-automation
Expand Down Expand Up @@ -831,7 +830,7 @@ jobs:
echo "check-resource -r $BUILD_PIPELINE_NAME/<%= name %> --from version:((<%= name %>-version))" >> result-dir/flight-plan
<% end %>
<% end %>
echo "check-resource -r $BUILD_PIPELINE_NAME/bosh-stemcell --from path:((stemcell-name-prefix))/bosh-stemcell-((stemcell-version))-((stemcell-main-name)).tgz" >> result-dir/flight-plan
echo "check-resource -r $BUILD_PIPELINE_NAME/bosh-stemcell --from path:((stemcell-name-prefix))((stemcell-main-name))/bosh-stemcell-((stemcell-version))-((stemcell-main-name)).tgz" >> result-dir/flight-plan
params:
BUILD_PIPELINE_NAME: <%= depls %>-generated
- task: fly-into-concourse
Expand Down
3 changes: 3 additions & 0 deletions docs/reference_dataset/another-world-root-depls.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ another-world-root-depls
### The shared files

* [shared](/docs/reference_dataset/shared/shared)
* [certs](/docs/reference_dataset/shared/shared/certs)
* [internal_paas-ca](/docs/reference_dataset/shared/shared/certs/internal_paas-ca)
* [server-ca.crt](/docs/reference_dataset/shared/shared/certs/internal_paas-ca/server-ca.crt)
* [meta.yml](/docs/reference_dataset/shared/shared/meta.yml)
* [pipeline-credentials.yml](/docs/reference_dataset/shared/shared/pipeline-credentials.yml)
* [secrets.yml](/docs/reference_dataset/shared/shared/secrets.yml)
Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
-----BEGIN CERTIFICATE-----
MIIDFDCCAfygAwIBAgIRAJhACeUupTq0v90nAyb+vUowDQYJKoZIhvcNAQELBQAw
MzEMMAoGA1UEBhMDVVNBMRYwFAYDVQQKEw1DbG91ZCBGb3VuZHJ5MQswCQYDVQQD
EwJjYTAeFw0xODA3MTEwOTE4MjZaFw0xOTA3MTEwOTE4MjZaMDMxDDAKBgNVBAYT
A1VTQTEWMBQGA1UEChMNQ2xvdWQgRm91bmRyeTELMAkGA1UEAxMCY2EwggEiMA0G
CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDMlqBlpRz8h1nnqGm1rdOTRZO+yddM
l4YwvDf9hpPVm0gqFrmIlcGFVTZ6+PbU9x8kklx+BwmB9dA2D1Vo1VMz7VQPsGu4
1pEmSLpaxz86LshW8JjCDauMblFIm+baB0o5MmukJzZzqdQv4kn2s5+57fVUQz33
k20T1mahuA0INzbHwO4vX1WGteInTH3GsDLOyVGSMTrpuUAUZgfU8IR019BzgaiA
YIBRU//VRv68PesQFtOXxOcM9V0BiTrs3yGRWGevvcfqP/6EI6qA+b+AJi/IhxbR
O+fxo58lUIRw0OrmmoEDuuHO6kCCe590YLU5wAttvp8baahLFrsEBTIJAgMBAAGj
IzAhMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEB
CwUAA4IBAQDGvUob4v0Mm2MIpE0IAbEa0oDCGiF99PhYHZwrvpdQjr/iVHd/7i+y
I7q4YFswRGj5oGj5zRjW9bFVKB6DJsyBD0NpcLTy7VEewkT8mwd2GmZkmRWFQYcA
2RUhIFGpYSI+g7ed6ZuPX2P4+92mxURHElTAuRTrrw5vqUVsebZO49tuvyXqmghP
AyKvSQanegmNviGdkHTWKPyD3nP2Ms0lBgGZxFfhlN4sPTWHxfEpud4xLX/AhW6X
8QS3GQ4QwevfKnUekbciU7CASVCymAKupFAxjksyz8xmHvalXe83HK+G7AmsYkEl
YowS7B+zXRNZHGoagYkRSBeaSKlIpZXF
-----END CERTIFICATE-----

-----BEGIN CERTIFICATE-----
MIIDIzCCAgugAwIBAgIQXfwhBdIQCH/pi/B59xULtjANBgkqhkiG9w0BAQsFADA7
MQwwCgYDVQQGEwNVU0ExFjAUBgNVBAoTDUNsb3VkIEZvdW5kcnkxEzARBgNVBAMT
CkNyZWRIdWIgQ0EwHhcNMTgwNzExMDkxODI5WhcNMTkwNzExMDkxODI5WjA7MQww
CgYDVQQGEwNVU0ExFjAUBgNVBAoTDUNsb3VkIEZvdW5kcnkxEzARBgNVBAMTCkNy
ZWRIdWIgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDZQjH7chAg
I+MRVSlom44sTi0btEFyTyRwD55eKDq/LcJmx3Fcu2NHBA7nluoCs4Y4IYYI7WcA
F051qzpSWqjWBcDJigqAGt0q3rcxnkbHRl6qsig2edm/E3AQnVqHuQ79bGlamSl2
R29uRptSAOTlSCNpEQmkjvyUD2U7ojM26J2TIPVeDsg8vy0IQADmY+FCRGT0QWtC
aN7AvaFeGB4ZnSYj88BjnWElzUIyiTFpa+jEFvVrtvCjJuT9S9oetSgkZHRmI9kh
f3CdC1UlFGmeHFD1Qgey2wp2cqTBfaLjKE4wR/6ij9t5skX6VXQn9y23QK5Ctzc/
mRsGkBjYp9R/AgMBAAGjIzAhMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTAD
AQH/MA0GCSqGSIb3DQEBCwUAA4IBAQC42IWQ6gNa1zchaxR0VIyRdE8uJkRru/YD
baXH+q1bvE0QjSRwMeOnAzN2MFWqU9PI7H+6yCbEhUOQgLPdn9nuUTaGvR6Re5Ic
tR7Kj19nTxFbsIEfpFXm2hyOG6YKDBNlRQnf6pXh2UJrY9XfIegz+1lBM8s2Nhyb
f9sB7Z9flx/Ah0+V5ssUVKRCnxNSGq2N3K08+O7HK8a965EC2MlIfKk8DMvoypBz
AJnP7XTR1/+MjGn4QZtnof3e+9wfIu1GgMUgo9kLXzsCXdRnB+MurDXEdwmwoTHr
g6jT8gO4A2fiUZCJlFstDRleedwEUT5DTx0uFcdl6ya1k6eqrtlg
-----END CERTIFICATE-----
11 changes: 11 additions & 0 deletions docs/reference_dataset/hello-world-root-depls.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@ hello-world-root-depls
* [private-config-operators.yml](/docs/reference_dataset/config_repository/hello-world-root-depls/secrets/private-config-operators.yml)
* [private-runtime-operators.yml](/docs/reference_dataset/config_repository/hello-world-root-depls/secrets/private-runtime-operators.yml)
* [secrets.yml](/docs/reference_dataset/config_repository/hello-world-root-depls/secrets/secrets.yml)
* [terraform-config](/docs/reference_dataset/config_repository/hello-world-root-depls/terraform-config)
* [secrets](/docs/reference_dataset/config_repository/hello-world-root-depls/terraform-config/secrets)
* [meta.yml](/docs/reference_dataset/config_repository/hello-world-root-depls/terraform-config/secrets/meta.yml)
* [secrets.yml](/docs/reference_dataset/config_repository/hello-world-root-depls/terraform-config/secrets/secrets.yml)
* [spec](/docs/reference_dataset/config_repository/hello-world-root-depls/terraform-config/spec)
* [my-private-terraform-spec.tf](/docs/reference_dataset/config_repository/hello-world-root-depls/terraform-config/spec/my-private-terraform-spec.tf)
* [terraform-sample](/docs/reference_dataset/config_repository/hello-world-root-depls/terraform-sample)
* [secrets](/docs/reference_dataset/config_repository/hello-world-root-depls/terraform-sample/secrets)
* [meta.yml](/docs/reference_dataset/config_repository/hello-world-root-depls/terraform-sample/secrets/meta.yml)
Expand All @@ -149,6 +155,9 @@ hello-world-root-depls
### The shared files

* [shared](/docs/reference_dataset/shared/shared)
* [certs](/docs/reference_dataset/shared/shared/certs)
* [internal_paas-ca](/docs/reference_dataset/shared/shared/certs/internal_paas-ca)
* [server-ca.crt](/docs/reference_dataset/shared/shared/certs/internal_paas-ca/server-ca.crt)
* [meta.yml](/docs/reference_dataset/shared/shared/meta.yml)
* [pipeline-credentials.yml](/docs/reference_dataset/shared/shared/pipeline-credentials.yml)
* [secrets.yml](/docs/reference_dataset/shared/shared/secrets.yml)
Expand Down Expand Up @@ -181,6 +190,8 @@ hello-world-root-depls
* [Staticfile](/docs/reference_dataset/template_repository/hello-world-root-depls/cf-apps-deployments/generic-app/template/Staticfile)
* [index.html](/docs/reference_dataset/template_repository/hello-world-root-depls/cf-apps-deployments/generic-app/template/index.html)
* [manifest-tpl.yml](/docs/reference_dataset/template_repository/hello-world-root-depls/cf-apps-deployments/generic-app/template/manifest-tpl.yml)
* [post-deploy.sh](/docs/reference_dataset/template_repository/hello-world-root-depls/cf-apps-deployments/generic-app/template/post-deploy.sh)
* [pre-cf-push.sh](/docs/reference_dataset/template_repository/hello-world-root-depls/cf-apps-deployments/generic-app/template/pre-cf-push.sh)
* [hello-world-root-depls-versions.yml](/docs/reference_dataset/template_repository/hello-world-root-depls/hello-world-root-depls-versions.yml)
* [pipeline-sample](/docs/reference_dataset/template_repository/hello-world-root-depls/pipeline-sample)
* [concourse-pipeline-config](/docs/reference_dataset/template_repository/hello-world-root-depls/pipeline-sample/concourse-pipeline-config)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ resources:
source:
bucket: ((s3-stemcell-bucket))
region_name: ((s3-stemcell-region-name))
# customization is required to remove bosh prefix in stemcell name
regexp: ((stemcell-name-prefix))/bosh-stemcell-((.*))--((stemcell-main-name)).tgz
regexp: ((stemcell-name-prefix))((stemcell-main-name))/bosh-stemcell-(.*)-((stemcell-main-name)).tgz
access_key_id: ((s3-stemcell-access-key-id))
secret_access_key: ((s3-stemcell-secret-key))
endpoint: ((s3-stemcell-endpoint))
Expand All @@ -101,8 +100,8 @@ resources:
client: ((bosh-username))
client_secret: ((bosh-password))
deployment: bosh-deployment-sample
ca_cert:
- name: fe-int-micro-for-micro-depls
ca_cert: "-----BEGIN CERTIFICATE-----\nMIIDFDCCAfygAwIBAgIRAJhACeUupTq0v90nAyb+vUowDQYJKoZIhvcNAQELBQAw\nMzEMMAoGA1UEBhMDVVNBMRYwFAYDVQQKEw1DbG91ZCBGb3VuZHJ5MQswCQYDVQQD\nEwJjYTAeFw0xODA3MTEwOTE4MjZaFw0xOTA3MTEwOTE4MjZaMDMxDDAKBgNVBAYT\nA1VTQTEWMBQGA1UEChMNQ2xvdWQgRm91bmRyeTELMAkGA1UEAxMCY2EwggEiMA0G\nCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDMlqBlpRz8h1nnqGm1rdOTRZO+yddM\nl4YwvDf9hpPVm0gqFrmIlcGFVTZ6+PbU9x8kklx+BwmB9dA2D1Vo1VMz7VQPsGu4\n1pEmSLpaxz86LshW8JjCDauMblFIm+baB0o5MmukJzZzqdQv4kn2s5+57fVUQz33\nk20T1mahuA0INzbHwO4vX1WGteInTH3GsDLOyVGSMTrpuUAUZgfU8IR019BzgaiA\nYIBRU//VRv68PesQFtOXxOcM9V0BiTrs3yGRWGevvcfqP/6EI6qA+b+AJi/IhxbR\nO+fxo58lUIRw0OrmmoEDuuHO6kCCe590YLU5wAttvp8baahLFrsEBTIJAgMBAAGj\nIzAhMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEB\nCwUAA4IBAQDGvUob4v0Mm2MIpE0IAbEa0oDCGiF99PhYHZwrvpdQjr/iVHd/7i+y\nI7q4YFswRGj5oGj5zRjW9bFVKB6DJsyBD0NpcLTy7VEewkT8mwd2GmZkmRWFQYcA\n2RUhIFGpYSI+g7ed6ZuPX2P4+92mxURHElTAuRTrrw5vqUVsebZO49tuvyXqmghP\nAyKvSQanegmNviGdkHTWKPyD3nP2Ms0lBgGZxFfhlN4sPTWHxfEpud4xLX/AhW6X\n8QS3GQ4QwevfKnUekbciU7CASVCymAKupFAxjksyz8xmHvalXe83HK+G7AmsYkEl\nYowS7B+zXRNZHGoagYkRSBeaSKlIpZXF\n-----END CERTIFICATE-----\n"
- name: concourse-target
type: concourse-pipeline
source:
target: ((concourse-hello-world-root-depls-target))
Expand Down Expand Up @@ -692,20 +691,28 @@ jobs:
./scripts/generate-depls.rb --depls ${ROOT_DEPLOYMENT} -t ../templates -p . -o concourse
params:
ROOT_DEPLOYMENT: hello-world-root-depls
- put: fe-int-micro-for-micro-depls
- put: concourse-target
params:
pipelines:
- name: bosh-sample-generated
- name: hello-world-root-depls-generated
team: main
config_file: concourse-hello-world-root-depls-pipeline/concourse/pipelines/bosh-sample-generated.yml
config_file: concourse-hello-world-root-depls-pipeline/concourse/pipelines/hello-world-root-depls-generated.yml
vars_files:
# trick to manage <depls>-versions.yml (not included in secrets)
- paas-templates-wip/hello-world-root-depls/hello-world-root-depls-versions.yml
# trick to manage <depls>-versions.yml (not included in secrets)
- secrets-full/shared/concourse-credentials.yml
- name: bosh-sample-cf-apps-generated
- name: hello-world-root-depls-init-generated
team: main
config_file: concourse-hello-world-root-depls-pipeline/concourse/pipelines/bosh-sample-cf-apps-generated.yml
config_file: concourse-hello-world-root-depls-pipeline/concourse/pipelines/hello-world-root-depls-init-generated.yml
vars_files:
# trick to manage <depls>-versions.yml (not included in secrets)
- paas-templates-wip/hello-world-root-depls/hello-world-root-depls-versions.yml
# trick to manage <depls>-versions.yml (not included in secrets)
- secrets-full/shared/concourse-credentials.yml
- name: hello-world-root-depls-cf-apps-generated
team: main
config_file: concourse-hello-world-root-depls-pipeline/concourse/pipelines/hello-world-root-depls-cf-apps-generated.yml
vars_files:
# trick to manage <depls>-versions.yml (not included in secrets)
- paas-templates-wip/hello-world-root-depls/hello-world-root-depls-versions.yml
Expand All @@ -716,15 +723,15 @@ jobs:
output_mapping: {updated-git-resource: updated-secrets}
file: cf-ops-automation/concourse/tasks/git_update_a_file_from_generated.yml
params:
OLD_FILE: concourse/pipelines/bosh-sample-generated.yml
OLD_FILE: concourse/pipelines/hello-world-root-depls-generated.yml
NEW_FILE: "concourse/pipelines/hello-world-root-depls-generated.yml"
COMMIT_MESSAGE: "hello-world-root-depls generated pipeline auto update - [skip ci]"
- task: update-concourse-cf-apps-pipeline
input_mapping: {reference-resource: updated-secrets, generated-resource: concourse-hello-world-root-depls-pipeline}
output_mapping: {updated-git-resource: updated-secrets}
file: cf-ops-automation/concourse/tasks/git_update_a_file_from_generated.yml
params:
OLD_FILE: concourse/pipelines/bosh-sample-cf-apps-generated.yml
OLD_FILE: concourse/pipelines/hello-world-root-depls-cf-apps-generated.yml
NEW_FILE: "concourse/pipelines/hello-world-root-depls-cf-apps-generated.yml"
COMMIT_MESSAGE: "hello-world-root-depls cf-apps generated pipeline auto update - [skip ci]"
- put: secrets-full-writer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,12 @@ jobs:
- paas-templates-full/hello-world-root-depls/hello-world-root-depls-versions.yml
# trick to manage <depls>-versions.yml (not included in secrets)
- secrets-full/shared/concourse-credentials.yml
- name: hello-world-root-depls-cf-apps-generated
team: main
config_file: concourse-hello-world-root-depls-pipeline/concourse/pipelines/hello-world-root-depls-cf-apps-generated.yml
vars_files:
# trick to manage <depls>-versions.yml (not included in secrets)
- paas-templates-full/hello-world-root-depls/hello-world-root-depls-versions.yml
# trick to manage <depls>-versions.yml (not included in secrets)
- secrets-full/shared/concourse-credentials.yml

2 changes: 1 addition & 1 deletion lib/coa_env_bootstrapper/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def self.run(prereqs_path)
ceb = new(prereqs_path)
ceb.run
ensure
ceb.config_dir && FileUtils.remove_entry_secure(ceb.config_dir)
ceb&.config_dir && FileUtils.remove_entry_secure(ceb.config_dir)
end

def run
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env ruby -w


def credential_list(pipelines_path)
creds_list = []

Expand All @@ -12,9 +11,13 @@ def credential_list(pipelines_path)
creds_list << pipeline_content.scan(/\(\(([\w|-]*)\)\)/).flatten.uniq
end

creds_list.flatten.uniq
creds_list.flatten.uniq.sort
end

path = ARGV[0]
creds = credential_list(path)
puts creds.join("\n")
if path = ARGV[0]
creds = credential_list(path)
puts "Found credentials in alphabetical order:"
puts creds.join("\n")
else
puts "Usage:\n./scripts/extract_pipeline_credentials_list.rb </path/to/pipeline> OR\n./scripts/extract_pipeline_credentials_list.rb </path/to/pipelines/directory>"
end
3 changes: 0 additions & 3 deletions spec/helpers/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,3 @@ def fixtures_dir(path = '')
File.join(File.join(File.dirname(__FILE__), '..', path, 'fixtures'))
end

def new_tmpdir_path
File.join(File.join(File.dirname(__FILE__), '../..', 'tmp', SecureRandom.uuid))
end
6 changes: 2 additions & 4 deletions spec/lib/coa_env_bootstrapper/base_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,9 @@
end

describe '#write_source_profile' do
let(:tmpdirpath) { new_tmpdir_path }
let(:tmpdirpath) { Dir.mktmpdir }

before { FileUtils.mkdir tmpdirpath }

after { FileUtils.rmdir tmpdirpath }
after { FileUtils.remove_entry_secure tmpdirpath }

context 'when we pass a set of bosh credentials' do
let(:bosh_yml_path) { File.join(fixtures_dir('lib'), 'coa_env_bootstrapper', 'bosh_prereqs.yml') }
Expand Down
12 changes: 4 additions & 8 deletions spec/lib/coa_env_bootstrapper/bosh_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,10 @@
let(:cloud_config_fixtures_path) { File.join(fixtures_dir('lib'), 'coa_env_bootstrapper', 'cloud_config.yml') }
let(:ceb) { CoaEnvBootstrapper::Base.new([cloud_config_fixtures_path]) }
let(:bosh) { described_class.new(ceb) }
let(:tmpdirpath) { File.join("tmp", "upload_cloud_config") }
let(:tmpdirpath) { Dir.mktmpdir("upload_cloud_config") }
let(:cloud_config_yaml) { File.join(tmpdirpath, 'cloud-config.yml') }

before { FileUtils.mkdir tmpdirpath }

after { FileUtils.rm_r tmpdirpath }
after { FileUtils.remove_entry_secure tmpdirpath }

it "creates a cloud-config from the prereqs and uploads it" do
allow(bosh).to receive(:run_cmd)
Expand All @@ -87,12 +85,10 @@
let(:git_server_manifest_path) { File.join(fixtures_dir('lib'), 'coa_env_bootstrapper', 'git_server_manifest.yml') }
let(:ceb) { CoaEnvBootstrapper::Base.new([git_server_manifest_path]) }
let(:bosh) { described_class.new(ceb) }
let(:tmpdirpath) { new_tmpdir_path }
let(:tmpdirpath) { Dir.mktmpdir }
let(:manifest_path) { File.join(tmpdirpath, 'git-server.yml') }

before { FileUtils.mkdir tmpdirpath }

after { FileUtils.rm_r tmpdirpath }
after { FileUtils.remove_entry_secure tmpdirpath }

context "when the release is not already uploaded" do
let(:command_answer) { "" }
Expand Down
6 changes: 2 additions & 4 deletions spec/lib/coa_env_bootstrapper/concourse_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require 'coa_env_bootstrapper/concourse'

describe CoaEnvBootstrapper::Concourse do
let(:config_dir) { new_tmpdir_path }
let(:config_dir) { Dir.mktmpdir }
let(:fly_login_cmd) do
"fly login --target concourse-target \
--concourse-url http://example.com \
Expand All @@ -15,9 +15,7 @@
let(:pipeline_creds_path) { File.join(fixtures_dir('lib'), 'coa_env_bootstrapper', 'pipeline_creds.yml') }
let(:ceb) { CoaEnvBootstrapper::Base.new([concourse_creds_path]) }

before { FileUtils.mkdir config_dir }

after { FileUtils.rm_r config_dir }
after { FileUtils.remove_entry_secure config_dir }

describe '.new'

Expand Down
6 changes: 2 additions & 4 deletions spec/lib/coa_env_bootstrapper/git_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@
end

context "when there is a config dir" do
let(:tmpdir_path) { new_tmpdir_path }
let(:tmpdirpath) { Dir.mktmpdir }

before { FileUtils.mkdir tmpdir_path }

after { FileUtils.rm_r tmpdir_path }
after { FileUtils.remove_entry_secure tmpdirpath }

it "runs a set of git commands"
end
Expand Down
Empty file removed tmp/.gitkeep
Empty file.

0 comments on commit f6756bd

Please sign in to comment.