Coder Social home page Coder Social logo

juju-academy's Introduction

Juju Academy

This site is designed to be a split pane terminal emulator to help introduce people to the concepts of Juju before having to ever install Juju. While Juju is arguably best learned by simply installing and doing, this site is designed to get people started up just as fast.

Installation

You'll need bower to run this.

npm install -g bower

Then install all the bower things

bower install

Creating new lessons

Lessons are jsonp files stored in the lessons directory. The format is relatively light weight and only requires a few keys wrapped in a load_lesson call.

  • name - The title of the lesson
    'name': 'Title of lesson',
    
  • description - An array/list of paragraphs which discuss the lesson
    'description': [
      'First paragraph',
      'second paragraph',
      'last paragraph'
    ]
    
  • tasks - This is an object which each key being a unique identifier for the task

Creating tasks

A task is an object with several keys which outlines how the task is to be satisfied.

  • name - The title of the task
  • hint - A brief description of to help the user along if they get stuck
  • validate - This can either be a string, an object, or a function.
    • String - This should be a regular expression, used to determine if the task has been completed
    • Object - An object containing at least a match key, which is a regular expression. An additional echo key can be added to provide additional output to the terminal
    • Function - If a function, should implement a signature of Function(cmd, term, next) where cmd is the full command by the user, term is the terminal instance, and next is the function invoked when there isn't a match, passing at least a True or string as the first and only parameter.

Examples

{
  '00-first-task': {
    'name': 'First task!',
    'hint': 'Type, <code>first</code> to achieve this task',
    'validate': '^first$'
  },
  '01-second-task': {
    'name': 'Second task',
    'hint': 'Do this secondly',
    'validate': {
      'match': '^second .*$',
      'echo': 'This option is optional'
    }
  },
  '02-third-task': {
    'name': 'Last task!',
    'hint': 'This is the last one',
    'validate': function(cmd, term, next) {
      var m = cmd.match('^last (.*)$');
      if(!m) {
        return next(true);
      }
      term.echo('You said {0}'.format(m[1]));
      return next();
    }
  }
}

Creating new commands

juju-academy's People

Contributors

0xf2 avatar adamisrael avatar kwmonroe avatar marcoceppi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

juju-academy's Issues

Add `ls` command

ls (-a should always be assumed and -l should print long format, all other flags should just be ignored but accepted). This should traverse the #fs object and print the hierarchy

cat is unhealthy

demo@ubuntu:~$ cat
[USER]: Cannot read property '1' of null
TypeError: Cannot read property '1' of null
    at Array.eval (eval at <anonymous> (http://juju.academy/vendor/jquery/dist/jquery.min.js:
2:2533), <anonymous>:40:14)
    at Commands._exec (http://juju.academy/assets/js/commands.js:41:26)
    at http://juju.academy/assets/js/commands.js:44:19
    at Array.eval (eval at <anonymous> (http://juju.academy/vendor/jquery/dist/jquery.min.js:
2:2533), <anonymous>:11:14)
    at Commands._exec (http://juju.academy/assets/js/commands.js:41:26)
    at http://juju.academy/assets/js/commands.js:44:19
    at Array.eval (eval at <anonymous> (http://juju.academy/vendor/jquery/dist/jquery.min.js:
2:2533), <anonymous>:4:14)
    at Commands._exec (http://juju.academy/assets/js/commands.js:41:26)
    at http://juju.academy/assets/js/commands.js:44:19
    at Array.eval (eval at <anonymous> (http://juju.academy/vendor/jquery/dist/jquery.min.js:
2:2533), <anonymous>:341:14)

Enable tabcompletion

There should be a separate completion directory, which contains a dictionary of primary keys to function.

{
  'command': function(term, cb) {
    cb(['--flag', 'option', '~/.file']);
  },
  'other-command': function(term, cb) {
    // Do things
    cb(['more', 'options', 'to', 'reply', with']);
  }
}

Each key will be used to determine primary commands to autocomplete, for instance i there is a 'juju' key, then ju will tab complete to juju, subsequent tab completion requests will go to to the juju function defined in the completion dictionary.

Feedback from first run

First this is a solid tool to have get acclimated with Juju, and a framework to add in additional lessons as folks grow their skills and as the Juju community grows.

Feedback

General

  • Suggest to make it more apparent to click the task to see the hint.
  • I can't go back.

Opening Page

  • On the opening page it would be nice to have a link to juju.ubuntu.com and help.juju.academy 404's for me atm.

Setting Up Juju

  • I can't go back

  • It says "edit" ~/.juju/environments.yaml file, but I can't use vi, vim, sed, awk, perl, pico, nano, or emacs.

    demo@ubuntu:~$ perl
     perl: command not found
     demo@ubuntu:~$ sed
     sed: command not found
     demo@ubuntu:~$ awk
     awk: command not found
     demo@ubuntu:~$ vi
     vi: command not found
     demo@ubuntu:~$ vim
     vim: command not found
     demo@ubuntu:~$ pico
     pico: command not found
     demo@ubuntu:~$ nano
     nano: command not found
     demo@ubuntu:~$ emacs
     emacs: command not found
    
    • Which method would you like the user to edit the env.yaml file? Also, when you say edit the env.yaml to include the credentials of "demo"/"demo" do you want that in the form of keypairs, userpass, or something more generic. Perhaps being more specific on what method you want the user to edit env.yaml, and what yaml keys to enter may be helpful.

Your first bootstrap

  • First task I think is successful, but the command prompt returns command is not found
demo@ubuntu:~$ juju help commands
Sorry, help hasn't been implemented yet or action doesn't exist
demo@ubuntu:~$ juju help bootstrap
Sorry, help hasn't been implemented yet or action doesn't exist
demo@ubuntu:~$ juju help
Sorry, help hasn't been implemented yet or action doesn't exist

Really well put together. Looking forward to seeing how we can incorporate showing how deployed workload looks, ie seeing Wordpress running, or get the GUI deployed.

-thanks,
Antonio

Delete showing up as %7F in ajax requests

When using Delete key (not backspace), terminal reacts appropriately, however these key presses are some how captured and sent for processing causing havoc during $.getJSON request.

^H^H^H

edit command isn't obvious

All command line editors, vi, vim, emacs, nano, pico should all either open the edit command or error saying to use the edit command

feedback from #1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.