☠️
smadi0x86 Playground
  • 💀Welcome to smadi0x86 Playground
    • 🍷Resources
    • 🚬Projects
    • 🎓Certifications
    • 📌Pinned
    • ❓Questions
    • 📞Contact
  • 🏞️Cloud Native
    • Docker
      • Quick Reference
      • Introduction
      • Containers
      • Images
      • Storage & Volumes
      • Security
      • Cheatsheet
    • Git
    • Serverless Framework
    • YAML
  • 🔨Software Engineering
    • System Design
    • Environment Variables
    • JSON Web Tokens
  • 👾Architecture
    • C Language
      • Introduction
      • Calling Conventions
      • GCC Compilation
      • Libraries & Linking
      • I/O
      • Files
      • Pointers
      • Dynamic Memory Allocation
      • Data Types
      • Strings Manipulation
      • Bit Manipulation
      • Pre-processors
      • Macros
      • Type Qualifiers
    • C/C++ Build Systems
      • Fundamentals for Linking
      • Symbolic Linking
      • Cross-Platform Compilation
      • CMake for Building and Linking
      • Shared Libraries
      • Dynamic Linking and Dependency Management
    • Operating Systems
      • OS & Architecture
      • Processes
      • CPU Scheduling
      • Memory Management
  • 🛩️Cyber Warfare
    • Flight Physics
    • Communication
      • PWM & PPM
      • MAVLink
  • 🏴‍☠️Offensive Security
    • Active Directory
      • Introduction
    • Web Attacks
      • Server Side
        • OS Command Injection
        • Information Disclosure
        • Directory Traversal
        • Business Logic
        • Authentication
        • File Upload
        • SSRF
      • Client Side
        • CSRF
        • XSS
    • Recon
      • Active
        • Host discovery
        • Nmap
        • Mass Scan
      • Passive
        • Metadata
      • Web Applications
        • Discovery
        • Subdomains & Directories
        • SSL Certs
        • CMS
        • WAF Detection
      • Firewall Evasion
  • Binary Exploitation
    • Stack Smashing
      • x86
      • x86_64
    • pwntools
      • Processes and Communication
      • Logging and Context
      • Cyclic
      • Packing
      • ELF
      • ROP
  • 😈Advanced Persistent Threat
    • C2
      • Sliver
    • Malware
      • Windows Internals
        • PEB
      • Academy
        • Basics
      • Sektor7
        • Essentials
  • 💌Certifications
    • AWS Certified Cloud Practitioner (CLF-C01)
      • Cloud Foundations
      • Domain 1: Cloud Concepts
      • Domain 2: Security and Compliance
      • Domain 3: Technology
      • Domain 4: Billing and Pricing
    • AWS Certified Solutions Architect - Associate (SAA-C03)
      • Foundation
    • Certified Kubernetes Administrator (CKA)
      • Core Concepts
      • Scheduling
      • Logging & Monitoring
      • Application Lifecycle Management
      • Cluster Maintenance
      • Security
      • Storage
      • Networking
      • Design Kubernetes Cluster
      • Kubernetes The Kubeadm Way
      • Troubleshooting
      • JSONPATH
      • Lightning Lab
      • Mock Exams
      • Killer Shell
    • Certified Kubernetes Security (CKS)
      • Foundation
      • Cluster Setup
      • Cluster Hardening
      • Supply Chain Security
      • Runtime Security
      • System Hardening
      • Killer Shell
    • (KGAC-101) Kong Gateway Foundations
      • Introduction to APIs and API Management
      • Introduction to Kong Gateway
      • Getting Started with Kong Enterprise
      • Getting Started with Kong Konnect
      • Introduction to Kong Plugins
  • 📜Blog Posts
    • Modern Solutions For Preventing Ransomware Attacks
Powered by GitBook
On this page
  • Basic Syntax
  • Advanced Constructs
  • GitLab's .gitlab-ci.yml
  • Key Components
  • Advanced Concepts in .gitlab-ci.yml
  1. Cloud Native

YAML

YAML is a human-readable data serialization format. It is used for configuration files, deployment manifests, and data exchange between languages with different data structures.

Basic Syntax

Key-Value Pairs:

Simple assignments.

name: John Doe
age: 30

Lists:

Sequential arrays of data.

hobbies:
  - reading
  - hiking
  - coding

Maps:

Nested key-value assignments.

person:
  name: Jane
  age: 25

Comments:

Anything after # is a comment.

# This is a comment
key: value

Advanced Constructs

Multiline Strings:

Using the | character.

description: |
  This is a long string
  spanning multiple lines.

Anchors & Aliases:

Allow for duplicating properties.

base: &base
  name: Everyone
person1:
  <<: *base
  age: 30

Merging Data:

Combine data from two sources.

defaults: &defaults
  adapter: postgres
  host: localhost
development:
  database: mydb
  <<: *defaults

GitLab's .gitlab-ci.yml

Usually, YAML is used to write CI/CD pipelines, we will see a high level overview of how its used in GitLab pipelines.

The .gitlab-ci.yml file, employed by GitLab for CI/CD, is an excellent real-world example of YAML's utility.

Key Components

  1. image: Specifies the Docker image for CI/CD tasks.

  2. stages: Different stages of CI/CD, like build, test, and deploy.

  3. before_script: Commands run before all jobs.

  4. job: Defines commands for a specific stage.

Example Configuration:

image: python:3.9

stages:
  - build
  - test
  - deploy

before_script:
  - pip install -r requirements.txt

build:
  stage: build
  script:
    - echo "Building..."
    # Other build commands.

test:
  stage: test
  script:
    - echo "Testing..."
    - pytest

deploy:
  stage: deploy
  script:
    - echo "Deploying..."
    # Deployment commands.

Advanced Concepts in .gitlab-ci.yml

  1. cache: Caches directories between runs, like dependencies.

  2. variables: Pre-defined environment variables.

  3. tags: Labels assigned to runners to control job execution locations.

PreviousServerless FrameworkNextSystem Design

Last updated 1 year ago

🏞️
Page cover image