dms/diagrams/pipeline_stages.tex

56 lines
2.2 KiB
TeX

% Pipeline-Schema: Pipeline -> Stages -> Jobs mit needs/DAG-Pfeil
% Einbinden im Hauptdokument:
% \usepackage{tikz}
% \usetikzlibrary{positioning,arrows.meta,fit,backgrounds}
% und an der gewünschten Stelle:
% \input{diagrams/pipeline_stages}
\begin{figure}[H]
\centering
\resizebox{\columnwidth}{!}{%
\begin{tikzpicture}[
node distance=4mm and 6mm,
font=\footnotesize\sffamily,
every node/.style={align=center},
stage/.style={draw, rounded corners=3pt, minimum width=22mm, minimum height=6mm, fill=blue!10, font=\bfseries\footnotesize\sffamily},
job/.style={draw, rounded corners=2pt, minimum width=22mm, minimum height=6mm, fill=white},
arr/.style={-{Stealth[length=2mm]}},
dagarr/.style={-{Stealth[length=2mm]}, dashed, red!70!black, thick},
]
% Stage-Header
\node[stage] (s1) {lint};
\node[stage, right=12mm of s1] (s2) {test};
\node[stage, right=12mm of s2] (s3) {build};
\node[stage, right=12mm of s3] (s4) {deploy};
\draw[arr] (s1) -- (s2);
\draw[arr] (s2) -- (s3);
\draw[arr] (s3) -- (s4);
% Jobs unter den Stages
\node[job, below=of s1] (j1) {eslint};
\node[job, below=of s2] (j2a) {unit};
\node[job, below=of j2a] (j2b) {integration};
\node[job, below=of s3] (j3a) {bundle};
\node[job, below=of j3a] (j3b) {container};
\node[job, below=of s4] (j4a) {staging};
\node[job, below=of j4a] (j4b) {prod (manual)};
% needs/DAG: container startet sobald unit fertig ist, wartet nicht auf integration
\draw[dagarr] (j2a.east) to[bend right=28] node[midway, above, sloped, font=\tiny\itshape] {needs} (j3b.west);
% Pipeline-Klammer drumherum
\begin{pgfonlayer}{background}
\node[draw, dotted, rounded corners=4pt, fit=(s1)(s4)(j2b)(j3b)(j4b), inner sep=5mm, label={[anchor=south west, font=\small\bfseries, yshift=1.5mm]north west:Pipeline}] {};
\end{pgfonlayer}
\end{tikzpicture}%
}
\caption{Aufbau einer Pipeline aus Stages und Jobs. Durchgezogene Pfeile zeigen die starre Stage-Reihenfolge. Der gestrichelte Pfeil ist eine \texttt{needs}-Beziehung, die diese Reihenfolge aufbricht: \texttt{container} startet, sobald \texttt{unit} fertig ist, und wartet nicht auf \texttt{integration}.}
\label{fig:pipeline-stages}
\end{figure}