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.
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
To build this buildpack, run the following command from the buildpack's directory:
-
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.
-
Install buildpack-packager
./scripts/install_tools.sh
-
Build the buildpack
buildpack-packager build -stack cflinuxfs3 -cached
-
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
Buildpacks use the Cutlass framework for running integration tests.
To test this buildpack, run the following command from the buildpack's directory:
-
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.
-
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.
Open an issue on this project.