<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">\documentclass[onecolumn,letterpaper,11pt]{article}

%===================================================================
% Include common packages, environments, counters etc
\input{common_latex/common_latex_packages}
\input{common_latex/common_latex_lab_format}
\input{common_latex/common_latex_definitions}
%===================================================================
\setcounter{tocdepth}{2}
%===================================================================

\begin{document}
\wikidoc{file=Lab.ClassSkillsGit}
\wikidoc{auth=tpaine@mit.edu}
\helplevelsubsec

%===================================================================
% Build the Cover Page in an environment style easy for wiki parsing
\begin{labcover}
\labtitle{Lab 3A - Using Version Control with GitHub}
\vspace{0.1in}
\labcourse{2.680 Unmanned Marine Vehicle Autonomy, Sensing and Communications}
\vspace{0.25in}
\labpng{0.55}{figures/gitcover.png}
\vspace{0.25in}
\labdate{February 11th, 2025}
\vspace{0.1in}
\labauth{Michael Benjamin, mikerb@mit.edu}
\labauth{Tyler Paine, tpaine@mit.edu}
\labauth{Department of Mechanical Engineering}
\labauth{MIT, Cambridge MA 02139}
\labtoc{footnotesize}
\end{labcover}
 
%===================================================================
% Add a blank page so first body page is on the right when doubleside
\blankpage

%===================================================================
\section{Overview and Objectives}
\label{sec_overview}
%===================================================================
  
%======================================================================
\newpage
\section{Bonus: Setting up CI/CD}
\label{sec_git_started}
%======================================================================

%=========================================================================
\subsection{Showing the CI pipeline badge}

First we need to create a registration token which will allow the code
in your repository to build on a remote server.

\vspace{0.1in}
\begin{itemize}
\item On the sidebar menu, navigate to Settings $&gt;$ CI/CD
\item Click Expand on the ``Runners'' section
\item First switch the toggle to ``off'' to disable instance runners
for this project.  The toggle is in the right column under ``Instance runners''.
\item Next, in the left column under ``Project runners'', look to the right of the 
blue button to create ``New project runner'' and click the small button
with three vertical dots. Copy the registration token and email it and your github 
url to Tyler at tpaine@mit.edu so he can add it to the server.
\item When your token has been registered, you should see a new runner appear
at the bottom of the left column.  (You may need to refresh the page.) When 
the runner appears you can finsh the setup as described below. 
\end{itemize}


By default, the project will launch a simple pipeline to test building your
code each new commit pushed to the server. Additional rules can be added to
limit when and how builds happen, or to define additional steps the server
should take. This should start running when you update your README.md file.
On GitLab.com, you can also launch the pipeline manually:

\vspace{0.1in}
\begin{itemize}
\item On the sidebar menu, navigate to CI/CD \var{-&gt;} Pipelines
\item Click on Run Pipeline
\item Select the branch you want to work from; the default is main
\item Click on Run Pipeline
\end{itemize}

\vspace{0.1in}
\noindent
When the pipeline fails, such as when a new source file has not been committed
and is thus not available on the server during the test build, the system will
produce an error and email you. GitLab will also display a marker next to the
latest commit hash, shown at the top of the content list, whenever a pipeline
is executed. An optional pipeline badge can also be displayed at the top of
the repository information.

\vspace{0.1in}
\noindent
On GitLab, the optional status badge can be added with the following steps:

\begin{itemize}
\item On the sidebar menu, navigate to your project site
        (i.e. https://gitlab.com/$&lt;$username$&gt;$/moos-ivp-$&lt;$username$&gt;$)
\item Go to Settings $&gt;$ General
\item Go to Settings \var{-&gt;} General
\item Expand the Badges section
\item Enter the following information:
  \begin{itemize}
    \item Name: Pipeline Status
    \item Link: \var{https://gitlab.com/{project\_path}}\var{/-/commits/{default\_branch}}
    \item Badge image URL: \var{https://gitlab.com/{project\_path}/badges/{default\_branch}/pipeline.svg}
  \end{itemize}
\end{itemize}

\vspace{0.1in}
\noindent
You can see the badge in the original GitLab repo
(\urlx{https://gitlab.com/moos-ivp/moos-ivp-extend)}, right under the
number of commits to the project.

% On GitHub.com, the badge can be added by inserting the following pointer
% in a new line at the top of the README.md file:

% \begin{consoleverb}
% ![workflow name - alt-text](https://github.com/&lt;OWNER&gt;/&lt;REPOSITORY&gt;/actions/workflows/\
% &lt;WORKFLOW_FILE&gt;/badge.svg)
% \end{consoleverb}
% \postverb

% The pipelines are defined using instruction sets specific to the server
% solution in use.
% Additional customizations may be added in the following files:

% \begin{itemize}
% \item GitLab.com : .gitlab-ci.yml
% % \item GitHub.com : .github/workflows/build\_extend.yml
% \end{itemize}


\end{document}

</pre></body></html>