README.md in script-0.0.1 vs README.md in script-0.0.2

- old
+ new

@@ -1,43 +1,91 @@ -# Script +# Script<img width="40" align="left" src="https://cdn.codementor.io/assets/topic/category_header/ruby-on-rails-bc9ab2af8d92eb4e7eb3211d548a09ad.png"> -Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/script`. To experiment with that code, run `bin/console` for an interactive prompt. +The Script is everything you need to make the most of Ruby as fabulous scripting language. -TODO: Delete this and the text above, and describe your gem + * [Script](#script) + * [Setup](#setup) + * [Usage](#usage) + * [Contributing](#contributing) + * [License](#license) + * [Code of Conduct](#code-of-conduct) -## Installation +## Setup -Add this line to your application's Gemfile: +Install gem: -```ruby -gem 'script' ``` +gem install script +``` -And then execute: +And require it in your script file: - $ bundle +``` +require 'script' +``` -Or install it yourself as: +## Usage - $ gem install script +### Steps -## Usage +Reason about the step as a logical group of commands. Lets take for instance, the deploy script which builds a docker image, pushes it to Dockerhub and eventually creates the deployment on Kubernetes. -TODO: Write usage instructions here +```ruby +#!/usr/local/bin/ruby -## Development +require "script" -After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. +deploy = Script.new -To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org). +deploy.step("Setup tools") do + `sudo apt-get install -y google-cloud-sdk kubectl` + `gcloud auth activate-service-account $GCLOUD_SERVICE_ACCOUNT_NAME` + `gcloud config set project dummy-project` + `gcloud container clusters get-credentials default --zone us-east` + +end + +deploy.step("Deploy docker image") do + + `docker pull dummy` + `docker build --cache-from dummy -t dummy` + `docker build -t scripter/script .` + `docker push dummy` + +end + +deploy.step("Deploy to Kubernetes cluster") do + + `kubectl apply -f k8s.yml --record` + +end + +# Finally, run the script + +deploy.run +``` + +The steps are run in order in which they are registered. + ## Contributing -Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/script. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct. +``` +# Clone the repo +git clone git@github.com:bmarkons/script.git -## License +# Install +bundle install -The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT). +# Run tests +bundle exec rspec +``` +Pull requests are always welcome. In case you notice any bug or simply want to propose an improvement, please feel free to open an issue. + ## Code of Conduct -Everyone interacting in the Script project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/script/blob/master/CODE_OF_CONDUCT.md). +Please [be nice](https://github.com/bmarkons/script/blob/master/CODE_OF_CONDUCT.md). + +## License + +The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).