FreeTDS Cloud Foundry buildpack
Go to file
Stark & Wayne CI Bot 4864f2481c bump freetds v1.2.18 2020-12-18 09:06:48 +00:00
bin initial scaffold 2019-06-08 07:30:09 +09:30
ci move to pipes 2020-01-03 11:35:53 +01:00
fixtures Bump rack from 2.0.7 to 2.0.8 in /fixtures/rubyapp (#1) 2019-12-20 08:55:27 +10:00
scripts full path to $OUTPUT_BLOBS_DIR due to folder change 2019-06-09 08:02:00 +09:30
src/freetds update test 2019-08-08 10:18:35 +10:00
.envrc initial scaffold 2019-06-08 07:30:09 +09:30
.gitignore script/readme to compile freetds + update manifest.yml 2019-06-08 11:48:18 +09:30
README.md link to CI 2019-06-10 06:00:20 +09:30
VERSION bump freetds v1.2.18 2020-12-18 09:06:48 +00:00
manifest.yml bump freetds v1.2.18 2020-12-18 09:06:48 +00:00

README.md

FreeTDS Cloud Foundry buildpack

FreeTDS is a set of libraries for Unix and Linux that allows your programs to natively talk to Microsoft SQL Server and Sybase databases.

This Cloud Foundry supply buildpack can be used in conjunction with your normal application buildpack (ruby_buildpack for example), to allow dependencies to be installed that require TinyTDS (the Ruby tiny_tds rubygem for example).

The FreeTDS library and binaries are already precompiled, so this buildpack is very fast to use from your first deployment.

Without this buildpack, your application deployment to Cloud Foundry might fail with an error like:

  Installing tiny_tds 2.1.2 with native extensions
  Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
...
Failed! Do you have FreeTDS 0.95.80 or higher installed?
...
  In Gemfile:
    tiny_tds
  **ERROR** Unable to install gems: exit status 5

This buildpack's CI pipeline automatically watches for new releases of FreeTDS and self-publishes new releases of the buildpack. Watch this repo for new releases.

Usage

Simple add freetds_buildpack or https://github.com/starkandwayne/freetds-buildpack to the start of your manifest.yml buildpacks list.

For example, from fixtures/rubyapp/manifest.yml:

applications:
- name: rubyapp
  buildpacks:
  - freetds_buildpack
  - ruby_buildpack

If you use freetds_buildpack then your Cloud Foundry administrator will need to install the freetds_buildpack using cf create-buildpack.

If you cannot get a Cloud Foundry administrator to do this, then use the Git URL:

applications:
- name: rubyapp
  buildpacks:
  - https://github.com/starkandwayne/freetds-buildpack
  - ruby_buildpack

Buildpack Developer Documentation

To build this buildpack, run the following command from the buildpack's directory:

  1. Source the .envrc file in the buildpack directory.

    source .envrc
    

    To simplify the process in the future, install direnv which will automatically source .envrc when you change directories.

  2. Install buildpack-packager

    ./scripts/install_tools.sh
    
  3. Build the buildpack

    buildpack-packager build -stack cflinuxfs3 -cached
    
  4. Use in Cloud Foundry

    Upload the buildpack to your Cloud Foundry.

    cf create-buildpack freetds_buildpack freetds_buildpack-*.zip 100
    cf push -p fixtures/rubyapp -f fixtures/rubyapp/manifest.yml
    

Testing

Buildpacks use the Cutlass framework for running integration tests.

To test this buildpack, run the following command from the buildpack's directory:

  1. Source the .envrc file in the buildpack directory.

    source .envrc
    

    To simplify the process in the future, install direnv which will automatically source .envrc when you change directories.

  2. Run integration tests

    ./scripts/integration.sh
    

    To run integration tests against CFDev:

    cf login -a https://api.dev.cfdev.sh --skip-ssl-validation -u admin -p admin
    CUTLASS_SCHEMA=https CUTLASS_SKIP_TLS_VERIFY=true ./scripts/integration.sh
    

    More information can be found on Github cutlass.

Reporting Issues

Open an issue on this project.