writing-skills
writing-skills
Use when creating new skills, editing existing skills, or verifying skills work before deployment
sap-btp-devopsSAP BTP DevOps — CI/CD pipeline configuration, MTA build automation, automated testing, transport integration (CTMS), GitHub Actions for BTP, SAP Continuous Integration and Delivery service, Jenkins. Use when setting up CI/CD for BTP, configuring deployment pipelines, or connecting Git to BTP deployments.
Independent GitHub snapshot · Automated classification · Original documentation governs
name: sap-btp-devops description: SAP BTP DevOps — CI/CD pipeline configuration, MTA build automation, automated testing, transport integration (CTMS), GitHub Actions for BTP, SAP Continuous Integration and Delivery service, Jenkins. Use when setting up CI/CD for BTP, configuring deployment pipelines, or connecting Git to BTP deployments. trigger:
CI/CD on SAP BTP — automated build, test, and deployment pipelines for CAP and Fiori applications.
cf install-plugin MTAPlugin (MTA deploy plugin)mbt (MTA Build Tool): npm install -g mbt# .pipeline/config.yml — placed in repo root
general:
productiveBranch: main
buildTool: mta
stages:
Build:
mtaBuild:
buildTarget: CF
mtaBuildTool: cloudMbt
Test:
npmTest:
command: npm test
Lint:
npmLint:
command: npm run abap:lint
Deploy to DEV:
cfDeploy:
deployType: standard
cfApiEndpoint: https://api.cf.us10.hana.ondemand.com
cfOrg: my-org
cfSpace: dev
deployTool: mtaDeployPlugin
Deploy to PRD:
cfDeploy:
cfSpace: prd
manualConfirmation: required
# Add webhook in Git provider pointing to CI/CD service
# BTP Cockpit → Continuous Integration and Delivery → Add repository → Connect webhook
# .github/workflows/btp-cicd.yml
name: BTP CI/CD
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: '20' }
- run: npm ci
- run: npm install -g mbt && mbt build
- run: npm test
- name: Deploy to DEV
run: |
cf login -a ${{ secrets.CF_API }} -u ${{ secrets.CF_USER }} \
-p ${{ secrets.CF_PASSWORD }} -o my-org -s dev
cf deploy mta_archives/*.mtar
- name: Smoke test
run: curl -f https://my-app-dev.cfapps.us10.hana.ondemand.com/health
deploy-prd:
needs: build-and-deploy
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
environment: production
steps:
- name: Deploy to PRD
run: |
cf login -a ${{ secrets.CF_API }} -u ${{ secrets.CF_USER }} \
-p ${{ secrets.CF_PASSWORD }} -o my-org -s prd
cf deploy mta_archives/*.mtar
# Add to .pipeline/config.yml stages
Transport:
uploadToTransportManagement:
transportManagementServiceCredentialsId: ctms-credentials
nodeName: dev-transport-node
pipeline {
agent any
stages {
stage('Build') { steps { sh 'mbt build' } }
stage('Test') { steps { sh 'npm test' } }
stage('Deploy DEV') {
steps {
withCredentials([usernamePassword(credentialsId: 'btp-credentials',
usernameVariable: 'CF_USER', passwordVariable: 'CF_PASSWORD')]) {
sh 'cf login -a $CF_API -u $CF_USER -p $CF_PASSWORD -o dev -s dev'
sh 'cf deploy mta_archives/*.mtar'
}
}
}
}
}
Pitfall: CF CLI token expires during long pipeline runs
Pitfall: MTA deploy times out
cf deploy --timeout 120 to extend. Split large MTAs into smaller deployment units.Pitfall: Production deploy without approval
manualConfirmation: required. In GitHub Actions use environment: production with required reviewers.Pitfall: Secrets exposed in pipeline logs
echo $CF_PASSWORD. Mask output in CI settings.Pitfall: Build cache hides dependency changes
node_modules; stale cache breaks after package.json update.npm ci (clean install) before mbt build. Clear cache: rm -rf node_modules .mta_archives on dependency changes.Pitfall: Smoke test passes but app is unhealthy
/health endpoint returns 200 even when dependent services are down.# 1. Verify pipeline config is valid
# SAP CI/CD: BTP Cockpit → CI/CD → Pipelines → Validate config
# GitHub Actions: push to PR branch → check Actions tab for green build
# 2. Build locally to catch errors before CI
mbt build
ls mta_archives/*.mtar # MTAR should exist
# 3. Verify deployment
cf apps
cf env my-app-dev | grep VCAP_SERVICES # Services bound
# 4. Run smoke test
curl -f https://my-app-dev.cfapps.us10.hana.ondemand.com/health
curl -f https://my-app-dev.cfapps.us10.hana.ondemand.com/odata/v4/Orders # API works
# 5. Verify CTMS transport uploaded
# BTP Cockpit → Transport Management → dev-transport-node → New entry should appear