tdl-client-ruby
Submodules
Project contains submodules as mentioned in the .gitmodules
file:
- broker
- tdl/client-spec (gets cloned into features/spec)
- wiremock
Use the below command to update the submodules of the project:
git submodule update --init
Getting started
Ruby client to connect to the central kata server.
Installing
Install RBENV
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build
# Then activate
~/.rbenv/bin/rbenv init
Install ruby
rbenv install 3.4.2
rbenv local 3.4.2
ruby --version
If the above fails, you might need to install libyaml:
https://pyyaml.org/download/libyaml/
./configure
make
make install
Install bundler
gem install bundler
Install cucumber
gem install cucumber
Install all the gems in the project
bundle install
Testing
All test require the ActiveMQ broker and Wiremock to be started.
Start ActiveMQ
export ACTIVEMQ_CONTAINER=apache/activemq-classic:6.1.0
docker run -d -it --rm -p 28161:8161 -p 21613:61613 -p 21616:61616 --name activemq ${ACTIVEMQ_CONTAINER}
The ActiveMQ web UI can be accessed at: http://localhost:28161/admin/ use admin/admin to login
Start two Wiremock servers
export WIREMOCK_CONTAINER=wiremock/wiremock:3.7.0
docker run -d -it --rm -p 8222:8080 --name challenge-server ${WIREMOCK_CONTAINER}
docker run -d -it --rm -p 41375:8080 --name recording-server ${WIREMOCK_CONTAINER}
The Wiremock admin UI can be found at: http://localhost:8222/__admin/ and docs at http://localhost:8222/__admin/docs
Cleanup
Stop dependencies
docker stop activemq
docker stop recording-server
docker stop challenge-server
Tests
Run tests with:
bundle exec rake features
To run a single scenario execute cucumber path/to/file.feature:line_no
Recommendation is to use the cucumber command instead of rake always outside of CI.
To release
Set version manually in tdl-client-ruby.gemspec
:
VERSION = "0.29.1"
Commit the changes
export RELEASE_TAG="v$(cat tdl-client-ruby.gemspec | grep "VERSION =" | cut -d "\"" -f2)"
echo ${RELEASE_TAG}
git add --all
git commit -m "Releasing version ${RELEASE_TAG}"
git tag -a "${RELEASE_TAG}" -m "${RELEASE_TAG}"
git push --tags
git push
Wait for the Github build to finish, then go to: https://rubygems.org/gems/tdl-client-ruby
To manually build the RubyGems files
Build the gem:
bundle exec rake build
Deploy the gem to RubyGems:
bundle exec rake release