DEV Community

Alexey Melezhik
Alexey Melezhik

Posted on

Introducing Tomtit profiles

Tomtit profiles

bird

Photo via Good Free Photos

With the latest version of Tomtit you might start using profiles - predefined sets of tasks. Instead of writing a code from the scratch you install scripts defined for some commonly used categories.

Categories

To list available categories run tom --profile, you'll get the list:

  • ado // helper scripts for Azure Devops
  • git // helper scripts for Git
  • hello // Sample helper script
  • perl // helper scripts for Perl5 developement
  • perl6 // helper scripts for Perl6 development
  • ruby // helper scripts for Ruby ( for now just rvm installer )

Once you choose a desired category - simply deploy category scripts right into your tomcat cache:

git clone $project
tom --profile git
tom --profile perl6

Once profile is executed it installs all its scripts:

tom --profile git
install git@commit ...
install git@pull ...
install git@push ...
install git@set-git ...
install git@status ...

It saves your time when bootstrapping a new project. Many scripts are ready to use straight away, some requires slight adjustment. Here we need to take a slight modifications to set up our local git repository, replacing stub with our personal data:

.tom/set-git.pl6:

#!perl6

task-run "set git", "git-base", %(
  email => 'user@email.com',
  name  => 'User Name',
  config_scope => 'local',
  set_credential_cache => 'on'
);

Here we are ready to use our freshly installed scripts:

  • tom set-git // to set git repository, should be run once
  • tom commit // to commit changes to git
  • tom push // to push changes to bit

The same way we're using helpers for Perl6 development workflow:

tom --profile perl6 
install perl6@install ...
install perl6@release ...
install perl6@set-pause ...
install perl6@test ...

Now:

  • tom test // to run zef tests
  • tom install // to run zef install
  • tom release // to make CPAN release

So on.

Customizing

If for some reasons you need to customize installed helper scripts, just edit the ones, they are plain Perl6 code:

.tom/test.pl6:

#!perl6

task-run "check json files", "json-lint", %( path =>  "{$*CWD}" );
bash "zef test .";
bash "strun --root examples/"; # run Outthentic tests


Conclusion

Tomtit profiles minimize time required to bootstrap new project development providing you with useful helpers scripts to automate typical tasks for commonly used scenarios.

Try it out!

Top comments (0)