| name | automation-engineer |
| description | Comprehensive automation engineering skill for CI/CD pipelines, testing automation, deployment automation, monitoring, and workflow orchestration. Specializes in modern DevOps practices and infrastructure automation. |
| author | SellerFin Team |
| license | MIT |
Automation Engineer
Build comprehensive automation systems for development, testing, deployment, and operations. This skill covers CI/CD pipelines, infrastructure automation, testing strategies, and monitoring systems for modern applications.
Core Automation Domains
1. CI/CD Pipeline Automation
- GitHub Actions workflows
- GitLab CI/CD pipelines
- Jenkins pipeline scripting
- Azure DevOps pipelines
- Automated testing integration
- Deployment automation
- Release management
2. Infrastructure as Code (IaC)
- Terraform configurations
- AWS CloudFormation
- Kubernetes manifests
- Docker containerization
- Ansible playbooks
- Helm charts
- Infrastructure provisioning
3. Testing Automation
- Unit test automation
- Integration test suites
- End-to-end testing
- Performance testing
- Security scanning
- Accessibility testing
- Visual regression testing
4. Deployment & Release Automation
- Blue-green deployments
- Canary releases
- Rolling updates
- Feature flags
- Database migrations
- Environment management
- Rollback strategies
GitHub Actions Workflows
Continuous Integration Workflow
name: CI Pipeline
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run linting
run: npm run lint
- name:
[, ]
Deployment Workflow
name: Deploy to Production
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
environment: production
steps:
- uses: actions/checkout@v4
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Deploy to ECS
run: |
# Update ECS service
aws ecs update-service \
--cluster sellerfi-prod \
--service sellerfi-web \
--force-new-deployment
- name: Run database migrations
run: |
npm run db:migrate
env:
End-to-End Testing Workflow
name: E2E Tests
on:
schedule:
- cron: '0 2 * * *'
workflow_dispatch:
jobs:
e2e:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Install Playwright browsers
run: npx playwright install --with-deps
- name: Start application
run: |
npm run build
npm run start &
npx wait-on http://localhost:3000
- name:
Infrastructure as Code
Terraform Configuration
# infrastructure/main.tf
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.0"
}
}
backend "s3" {
bucket = "sellerfi-terraform-state"
key = "prod/terraform.tfstate"
region = "us-east-1"
}
}
# VPC Configuration
resource "aws_vpc" "main" {
cidr_block = "10.0.0.0/16"
enable_dns_hostnames = true
enable_dns_support = true
tags = {
Name = "sellerfi-vpc"
Environment = var.environment
}
}
# ECS Cluster
resource "aws_ecs_cluster" "main" {
name = "sellerfi-${var.environment}"
setting {
name = "containerInsights"
value = "enabled"
}
}
# Application Load Balancer
resource "aws_lb" "main" {
name = "sellerfi-alb"
internal = false
load_balancer_type = "application"
security_groups = [aws_security_group.alb.id]
subnets = aws_subnet.public[*].id
enable_deletion_protection = true
tags = {
Environment = var.environment
}
}
# RDS Database
resource "aws_db_instance" "postgres" {
identifier = "sellerfi-${var.environment}"
engine = "postgres"
engine_version = "15.4"
instance_class = var.db_instance_class
allocated_storage = var.db_allocated_storage
db_name = var.db_name
username = var.db_username
password = var.db_password
vpc_security_group_ids = [aws_security_group.rds.id]
db_subnet_group_name = aws_db_subnet_group.main.name
backup_retention_period = 7
backup_window = "03:00-04:00"
maintenance_window = "sun:04:00-sun:05:00"
skip_final_snapshot = false
final_snapshot_identifier = "sellerfi-${var.environment}-final-snapshot"
tags = {
Environment = var.environment
}
}
Kubernetes Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: sellerfi-web
namespace: production
spec:
replicas: 3
selector:
matchLabels:
app: sellerfi-web
template:
metadata:
labels:
app: sellerfi-web
spec:
containers:
- name: web
image: sellerfi/web:latest
ports:
- containerPort: 3000
env:
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: sellerfi-secrets
key: database-url
- name: NEXTAUTH_SECRET
valueFrom:
secretKeyRef:
name: sellerfi-secrets
key: nextauth-secret
resources:
Automated Testing Suites
Playwright Test Suite
import { test, expect } from '@playwright/test'
test.describe('Business Listing Flow', () => {
test.beforeEach(async ({ page }) => {
await page.goto('/login')
await page.fill('[data-testid="email"]', 'seller@example.com')
await page.fill('[data-testid="password"]', 'password123')
await page.click('[data-testid="login-button"]')
await expect(page).toHaveURL('/dashboard')
})
test('should create a new business listing', async ({ page }) => {
await page.click('[data-testid="create-listing"]')
await expect(page).toHaveURL('/listings/new')
await page.fill('[data-testid="business-title"]', 'Test Business')
await page.selectOption('[data-testid="industry"]', 'technology')
page.(, )
page.(, )
page.(, )
page.()
(page.()).()
})
(, ({ page }) => {
page.()
page.()
(page.()).()
(page.()).()
})
})
Performance Testing
import { check } from 'k6'
import http from 'k6/http'
export let options = {
stages: [
{ duration: '2m', target: 100 },
{ duration: '5m', target: 100 },
{ duration: '2m', target: 200 },
{ duration: '5m', target: 200 },
{ duration: '2m', target: 0 },
],
thresholds: {
http_req_duration: ['p(99)<1500'],
http_req_failed: ['rate<0.1'],
},
}
export default function () {
let response = http.get('https://sellerfi.com/')
check(response, {
'homepage loads successfully': r. === ,
: r.. < ,
})
response = http.()
(response, {
: r. === ,
})
response = http.(, {
: {
: + __ENV.,
},
})
(response, {
: r. === ,
: {
{
.(r.)
} (e) {
}
},
})
}
Database Migration Automation
Migration Scripts
import { Knex } from 'knex'
export async function up(knex: Knex): Promise<void> {
await knex.schema.createTable('users', (table) => {
table.uuid('id').primary().defaultTo(knex.raw('gen_random_uuid()'))
table.string('email').notNullable().unique()
table.string('password_hash').notNullable()
table.string('first_name')
table.string('last_name')
table.enu('role', ['buyer', 'seller', 'admin']).notNullable()
table.boolean('email_verified').defaultTo(false)
table.timestamps(true, true)
})
knex..(, {
table.().().(knex.())
table.().().().()
table.().()
table.()
table.()
table.(, , )
table.(, , )
table.(, , )
table.()
table.(, )
table.(, [, , , ]).()
table.(, )
})
knex..(, {
table.([, ])
table.([])
table.([])
})
}
(): <> {
knex..()
knex..()
}
Automated Migration Runner
import { knex } from '../lib/database'
async function runMigrations() {
try {
console.log('Running database migrations...')
await knex.migrate.latest()
console.log('Migrations completed successfully')
if (process.env.NODE_ENV === 'development') {
console.log('Running database seeds...')
await knex.seed.run()
console.log('Seeds completed successfully')
}
} catch (error) {
console.error('Migration failed:', error)
process.exit(1)
} finally {
await knex.destroy()
}
}
runMigrations()
Monitoring & Alerting Automation
Application Monitoring
import { createPrometheusMetrics } from 'prom-client'
export class MonitoringService {
private static instance: MonitoringService
private httpRequestDuration = createPrometheusMetrics.createHistogram({
name: 'http_request_duration_seconds',
help: 'Duration of HTTP requests in seconds',
labelNames: ['method', 'route', 'status_code'],
})
private databaseQueryDuration = createPrometheusMetrics.createHistogram({
name: 'database_query_duration_seconds',
help: 'Duration of database queries in seconds',
labelNames: ['operation', 'table'],
})
private activeUsers = createPrometheusMetrics.createGauge({
name: 'active_users_total',
help: 'Number of currently active users',
})
static getInstance(): MonitoringService {
if (!MonitoringService.instance) {
MonitoringService.instance = new MonitoringService()
}
return .
}
() {
.
.(method, route, statusCode.())
.(duration / )
}
() {
.
.(operation, table)
.(duration / )
}
() {
..(count)
}
}
Health Check Automation
import { NextApiRequest, NextApiResponse } from 'next'
import { prisma } from '../../lib/prisma'
interface HealthCheck {
status: 'healthy' | 'unhealthy'
timestamp: string
services: {
database: 'up' | 'down'
redis: 'up' | 'down'
external_apis: 'up' | 'down'
}
version: string
uptime: number
}
export default async function health(
req: NextApiRequest,
res: NextApiResponse<HealthCheck>
) {
const startTime = Date.now()
const healthCheck: HealthCheck = {
status: 'healthy',
timestamp: new Date().toISOString(),
services: {
: ,
: ,
:
},
: process.. || ,
: process.()
}
{
prisma.
healthCheck.. =
} (error) {
healthCheck. =
}
{
healthCheck.. =
} (error) {
healthCheck. =
}
{
healthCheck.. =
} (error) {
}
statusCode = healthCheck. === ? :
res.(statusCode).(healthCheck)
}
Deployment Strategies
Blue-Green Deployment Script
#!/bin/bash
set -e
CLUSTER_NAME="sellerfi-prod"
SERVICE_NAME="sellerfi-web"
IMAGE_TAG=$1
if [ -z "$IMAGE_TAG" ]; then
echo "Usage: $0 <image-tag>"
exit 1
fi
echo "Starting blue-green deployment..."
CURRENT_TASK_DEF=$(aws ecs describe-services --cluster $CLUSTER_NAME --services $SERVICE_NAME --query 'services[0].taskDefinition' --output text)
NEW_TASK_DEF=$(aws ecs describe-task-definition --task-definition $CURRENT_TASK_DEF --query 'taskDefinition' --output json | \
jq --arg IMAGE_TAG "$IMAGE_TAG" '.containerDefinitions[0].image = "sellerfi/web:" + $IMAGE_TAG' | \
jq 'del(.taskDefinitionArn, .revision, .status, .requiresAttributes, .placementConstraints, .compatibilities)')
NEW_REVISION=$(echo $NEW_TASK_DEF | aws ecs register-task-definition --cli-input-json file:///dev/stdin --query 'taskDefinition.revision' --output text)
echo "Created new task definition revision: $NEW_REVISION"
aws ecs update-service --cluster $CLUSTER_NAME --service $SERVICE_NAME --task-definition "${CURRENT_TASK_DEF%:*}:$NEW_REVISION"
aws ecs services-stable --cluster --services
curl -f https://sellerfi.com/health
This automation engineering skill provides comprehensive automation solutions for modern application development, deployment, and operations, specifically tailored for SellerFi's needs.