Skip to content

Instantly share code, notes, and snippets.

@yogendra
Last active July 14, 2019 06:41
Show Gist options
  • Save yogendra/1c51452c3535602a534d57922b2f166b to your computer and use it in GitHub Desktop.
Save yogendra/1c51452c3535602a534d57922b2f166b to your computer and use it in GitHub Desktop.
PCF - Automation
root = true
[*]
end_of_line = lf
insert_final_newline = true
# Matches multiple files with brace expansion notation
[*.{js,jsx,html,sass,md}]
charset = utf-8
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false

PCF Automation

  1. Configure direnv by adding following to .envrc

    
    export PCF_ENV_NAME=havana
    export PCF_IAAS=google
    use toolsmith $PCF_ENV_NAME
    use pcf
    use pcf-pas
    
    
  2. Generate cert with certbot

       
    cd $CERTBOT_ROOT
    ./certs.sh generate-pcf gcp $PCF_DOMAIN
    cd -
    
    
  3. Copy ssl cert in the ssl/ dir

    
    mkdir -p ssl
    cp $CERTBOT_ROOT/.pcf-certs/certbot/config/archive/$PCF_DOMAIN/*.pem ./ssl
    
    
  4. Update om cert with

    
    om update-ssl-certificate --certificate-pem "`cat  ssl/fullchain1.pem`"  --private-key-pem "`cat ssl/privkey1.pem`" 
    
    
  5. Update PivNet token

    
    om curl  -x PUT -p /api/v0/settings/pivotal_network_settings -d "{\"pivotal_network_settings\": {\"api_token\":\"$OM_PIVNET_TOKEN\"}}"
    
    
  6. Update Bosh Director Security config - add Let's Encrypt CA cert

    
    om configure-director -ops-file director.yaml
    
    
  7. Download tiles

    
    om download-product -t $OM_PIVNET_TOKEN -o $TILES_DIR  --download-stemcell --stemcell-iaas $PCF_IAAS -f \*.pivotal -p credhub-service-broker -v 1.3.3
    
    
  8. Upload tiles

    
    om upload-product -p $TILES_DIR/credhub-service-broker-1.3.3.pivotal
    om upload-stemcell -s $TILES_DIR/light-bosh-stemcell-315.64-google-kvm-ubuntu-xenial-go_agent.tgz
    
    
  9. Stage product

    
    om stage-product -p credhub-service-broker -v 1.3.3
    
    
  10. Enable App Manager in CF

    
    om staged-config  -p cf  > cf.yaml
    yq.v2 w -i cf.yaml errand-config.deploy-autoscaler.post-deploy-state true
    yq.v2 w -i cf.yaml errand-config.deploy-notifications.post-deploy-state true
    yq.v2 w -i cf.yaml errand-config.deploy-notifications-ui.post-deploy-state true
    yq.v2 w -i cf.yaml errand-config.push-apps-manager.post-deploy-state true
    yq.v2 w -i cf.yaml errand-config.post-deploy-state.post-deploy-state true
    om 
            
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment