Tip:
Highlight text to annotate it
X
Hello this is the Getting Started video for the Roxy Deployer
with MarkLogic. I'll go through the deployer's capabilities and then we'll download the
script and create a project
The ml script is the central way that you interact with the
with the deployer and so these commands that are listed here are all things you
can pass to the ml script to tell it to do something.
You can get that list also by just typing ml the command line
and it will give you a list of commands and if you type
ml -h then it'll give you some help for that specific command.
So the things across the top
are things that we can commonly do over the lifetime
a given project. We'll start with ml new and that will reach out to github
and actually download a copy of Roxy
to give you some initial files.
That'll give you the basic configuration
in some cases answers some source code and
it will do some initial configuration of that, so for instance with the new
command you can give it the name of your
application and it'll put that into your config file for you.
After you've got your
initial set of configuration files and
maybe a little bit of source, you might bootstrap
and the idea bootstrapping is that it will
apply a project's configuration to the target server.
From there you might use extend or create
These are two different scaffolding commands
so these will generate a bit of source code for you, give you a starting point so that
you can edit rather than trying to write something from scratch. And having done that
you can then deploy modules
ml some-target-environment deploy modules
that'll take your source code and put it into the modules database
on the MarkLogic instance the
modules database was created by the bootstrap command. You can also
ml some-environment deploy content
which will take the contents of your data directory and put it in your
content
database. That content database is also created by the bootstrap command.
From that point you'd likely run some tests
and then make some modifications the code and then
deploy modules again, so you go in that cycle there
at that point. The ml script knows about three different environments
initially: local, dev, and prod.
local is presumed to be the local machine which you working but
it can be whatever you point it to and
a lot of these commands are sensitive to the environment
so for instance when we taught bootstrap we could tell it to bootstrap
some
you know specific environment if you need to add additional environments that can be
done too.
So looking at the other commands that are available
the wipe command, this one's kind of a
sharp tool, it will completely remove your application from the
MarkLogic server that you target, so it's a
essentially opposite of bootstrap so
bootstrap will create application servers
a content database, a modules database, users, roles
for your application and wipe will clear all those off completely.
Clean is similar in that it takes some stuff but
all it does is empty out the contents
of either your content database or your models database
depending on which you specify. It leaves the configuration alone; it does not delete
the database, it just leads to content.
info is a command you can use to see
what Roxy thinks are the property values for specific environment
so we're going to have one set of files
and then you've got to a separate property file for each for the
environments
and so in order to make sure that those are
coming through with the values you expect you can you use the info command. Restart will
tell the MarkLogic instance to restart itself.
That's often useful after wipe because when an application server's
removed from MarkLogic
MarkLogic needs to restart in order to fully clear that application server out.
the Roxy deployer's been integrated with recordloader and xqsync
along with corb. recordloader and xqsync are a couple tools we can use to
push some content into MarkLogic. The init command
is actually run by [the new command] when we say new
it handles "init" also. What that does is it
creates the initial configuration files
and it will create a couple
of directories for you as well. The initcpf command
is similar. It will create a config file to help you set up
a set of CPF pipelines.
CPF to be dealt with in a future video.
So there are three different kinds of applications you can use Roxy to
build
First type is REST application and this relies on the MarkLogic
REST API. We use XQuery here to extend the REST API.
Those are referred to as service extensions in the MarkLogic documentation.
And this is really the primary way that we're intended to work with MarkLogic
as of version 6.
there's also, Roxy will do an MVC
XQuery application and so it will provide you an
an application structure around the MVC application pattern
and this approach does not use the rest API at all
and was primarily used with
versions before MarkLogic 6
Roxy itself goes back to MarkLogic 4.2
and still works with that.
And there's also the hybrid type of application where we get the best of both
worlds.
So the REST API gets set up
and also you get the XQuery MVC structure, so if you're not sure which
you want you can always go with hybrid
and then use whichever one feels appropriate.
Quick note that the MVC stuff will continue,
is still supported with MarkLogic 6+
and I expect that to continue. It's still around.
There are a couple prerequisites that you'll need to run Roxy.
The first obvious one is that you need a MarkLogic instance somewhere
for Roxy to set up with with your
environments and to deploy the source code and suchlike to.
So you might even have more than one of these, you might have something on your
laptop and you might have a dev environment and a production environment
you need Ruby because the ML script itself
relies on Ruby for all its functionality
then there are a couple features that require it a git client or Java
the git client is required by the ml new command
otherwise [Roxy] doesn't use it. Java is used by
recordloader, XQsync, and corb
and so naturally enough in order to use those features inside Roxy
you'll need Java to be available
okay so let's go ahead and get the ml script
and use that to create a project.
So what we're looking at right now is the
the github homepage for the Roxy project and you'll see that right in the base
directory there's an ml script and an ml.bat
so if you're using a Mac or Linux you with ml
if you're on Windows, ml.bat and you'll get the same features either way
I'm gonna switch over to the dev branch. That's when I use for most of my work.
I like to have the latest and greatest so I'll use that.
I'm going to click on the ml script and the Raw page will let you
just get it as an actual file, so... download
and
Save As...
and you'll notice that -- well, first off, I want to put it in my bin directory
that's already in my path
You'll notice that the browser's helpfully adding a .txt extension, which I don't
want, but if I get rid of it, it just puts it back, so
I'll just save it like that and then I'll move it.
ml.txt becomes ml.
So if you've got your bin directory in your
path already you can put it there if not
you put it somewhere else that will be in your path or
if that doesn't work just save it somewhere and
use the absolute path for it.
Now on Linux, I also need to set the permissions for it.
Notice it does not have execute permission, so let's do that real quick.
So now, I've got
the ml script in my path and we can
do something with it now. I'm going to use it to create a new project so I type
ml new and I'm going to call this
my-app and then there are couple options you can choose to pass it or not.
One is whether to use the dev branch or not.
By default you'll get the master branch so that's the
the stable version. I'm choosing to go with the latest features
so I'm using the dev branch. The other thing is you can specify the
app-type. You might recall
earlier I mentioned that you can do MVC
rest, or hybrid applications.
For this example I'm going to do hybrid app so that's going to get me
the REST API stuff and also the MVC structure.
Okay, so it's created directory based on the name that I gave it
and inside that directory it's got a bunch of initial stuff
Let's take a look at what we have.
The deploy directory
is the stuff that holds the actual configuration of your project
in particular the properties files and this ml-config.xml file
and I'll dive into the contents in those more
in a later video. There's also the rest-api directory that has the initial options
and properties for controlling the MarkLogic REST API.
There's a rest ext directory for making extensions to the REST API
nothing in the area and the source directory has the initial
NBC source code suits if you choose to use that
in also we have a version that txt file
version 1.4 is the current version that's on the
deaf branch and get a change log which is the major new features and bug fixes
that have gone into each
release as Read Me file misses the file you see when you first go to get home
and get the I'm
you to see the basic page but
we found to be good practice to you also but some documentation Bell
the application so you can write something here but the purpose
use excused
ans and also altoona
have deployed
so you may just list the basic steps
can't its old
and nope that's for a lot of projects
you know this these few steps might be enough
but for other projects who made CPF might have some custom steps from AP is
record locator
sue witty comebacks your project six months after you finish working with it
it's really handy to have explicit list have
here's what you need to do to set it up and of course
any other developer picks up the project will appreciate it as well
this format here's mark down it's not unique to you
to rock Seattle I'm suet it converts nicely to HTML
in
Mitsuwa the files and here's build-up properties
and you'll notice it's been seeded with the the name you gave the application
and also has the admin username and password to
this news via password username and password of the user that has
30 to create the applications typically admin or somebody with the admin ball
and now if you don't have the the password rate in the
the properties file that's fine too just deleted and Annabelle
property for needed
we also have initial setup ports here
this is for the its TDP application server
and the SEC part which is used to me two point process
now problem of course right now is that tired have something on 84 Deion 8041
so I'm gonna change that to some other towards
okay and with that a get some basic setup
stand percent on the server
so you'll see that I'm specifying environments
where I want to do something ask us find the command that I want to run
you know the I'm and when I see the local environment
what that does is it looks in here for what is the local server
by default that's good deal convinced but it could be any server you want
and likewise you can view other environments specify what those
they should have again more on that in future that is
now I'm going to you which the source could for the application as they exist
right now
I'm gonna push that into the model status yes station
so having done the bootstrap you'll see that I now have my app
and port 8030 and my epic CC on 8031
on the content the recent model cities farce reach
and there's been a user my app user created that as the
my Apple
so here's the simple out of the box stuff million this is an NBC
basic application and you may choose to use flutes rest either way is fine
what's this early but the content in there just for fun
to how that works newly created directory and thats
the default name for where rocks is going to look for dinner
sa configurable your
and gonna do softly to dataset the
came across online
against us find the environments time to deploy
earlier I said to the plea models this time until it simply contact
the
look some stuff up and there we go very basic
simple search results the issue is something to play with them in the box
from there you could you choose to work on customizing the search results and
some facets
I'm worry might through stuff out and
also means in HTML focused page was JavaScript
either way you're shown that you we can get something up and running pretty
quickly
and just to complete the cycle
in a local white is going to take everything done by bootstrap make it go
away
the
and so first thing it's going refresh this will notice that all the
my app stuff has gone away by rocks is telling us the
MarkLogic needs to be restarted this is a
despaired of how mark logic works when you to leave an application server it
needs to restart
in order to fully remove the application server memory from that this
configuration
thing you
it's all to restart
whenever you're now having seen that maybe skeptic Asian is good my basic
setup is good
next thing I want to do and initialize simple get repository
and everything to it
and just like that I have a
a git repository where everything's been checked in ideally a should have
actually done that before a
changed build-up properties file that
you get the point sue and that's a quick
getting started at this point if you felt along
you have the configuration for simple application
answers good for NBC application along configuration for the STPI
more on all those details leader