Skillets and GitHub¶
The Skillet Framework uses GitHub as the primary option for storing skillets.
Click below to jump to a specific section:
Create a New GitHub Repository¶
Login to GitHub and select New to add a new repository.
README.md
file and an MIT license are recommended. You can also add a .gitignore
file, primarily to ignore pushing any EDI directories such as .idea/ used by PyCharm.Add SSH Keys from PanHandler into GitHub¶
Import a Repository into PanHandler¶
Create a Skillet Directory¶
Prerequisites for creating a skillet directory:
A new repository created on GitHub
Text editor/IDE of choice (PyCharm, Sublime, etc.)
From the steps above, make sure that you’ve cloned the link for the repo you just created. In a terminal/bash shell enter the following:
> git clone {GitHub repository link}This will add a directory to your local machine with the contents of the repository. Open this directory in your text editor/IDE. If you don’t already have a
README.md
file, you can add one now. Follow the ‘Configuration Tutorial’ to learn what to add in theREADME.md
file.Create a sub-directory that will contain the skillet content. Name the sub-directory something relevant to the skillet that will be created here.
Add a file with the name
.skillet.yaml
inside the sub-directory and anotherREADME.md
.Leave these files blank for now; they will be populated later on in the tutorial.
Use Submodules¶
A submodule is a reference within a host Github repository that points to a specific commit in an external repository. Submodules are used to include external content in a repository in a manner that can be easy updates and referenced. In terms of skillets, the Playlist Include skillet framework uses submodules to reference
To initiate a submodule within a host repository, use the command git submodule add <submodule_clone_link>
. This is
similar to cloning a repository to a host machine. The contents of the submodule repository will be ‘copied’ to the
working tree of the host repository and will be viewable if the host repository is cloned. It is recommended to navigate
to a folder within the host repository before initiating a submodule to keep your working tree clean. On GitHub, the
submodule will appear similarly to the ones below.
When a submodule is added to a host repository for the first time, a new .gitmodules
file will be created automatically.
This file contains information about the connection between the submodule and host repository. Adding more than one
submodule will create additional entries in the .gitmodules
file.
An example of an entry in the .gitmodules
file is:
[submodule "submodules/ironskillet-components"]
path = submodules/ironskillet-components
url = https://gitlab.com/panw-gse/as/ironskillet-components.git
When cloning a repository with a submodule, existing submodules will need to be initiated and updated before use. To do this, run the following commands:
clone the repository
open the repository
run
git submodule init
run
git submodule update
Submodules are tied to a specific commit when initiated, so they will need to be updated to pull the newest
content from the submodule repository as needed. This can be done using the git submodule update --remote --merge
command. This will update all submodules added within a host repository to the latest commit.