一键导入
build-and-release
Use when working on safeguard-bash Azure Pipelines, Docker packaging, version derivation, GitHub releases, or Docker Hub publishing.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when working on safeguard-bash Azure Pipelines, Docker packaging, version derivation, GitHub releases, or Docker Hub publishing.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Use when making Safeguard API calls, working with invoke-safeguard-method.sh, using SCIM filters or query parameters, creating users/assets/accounts, or understanding Safeguard API conventions and gotchas.
Use when understanding how safeguard-bash is organized, how scripts share authentication and session state, how the utils library fits together, or how to add new commands safely.
Use when working on A2A (application-to-application) scripts, certificate authentication, credential retrieval, access request brokering, A2A service management, event subscriptions, or event discovery.
Use when creating a new CLI script in src/, adding a new command to safeguard-bash, or extending an existing script with new functionality. Covers the full script template, flag conventions, login file integration, and how to add a corresponding test suite.
Use when running tests, writing tests, investigating test failures, or setting up a test environment against a live Safeguard appliance. Covers the test framework API, suite lifecycle, assertion patterns, and the test runner.
基于 SOC 职业分类
| name | build-and-release |
| description | Use when working on safeguard-bash Azure Pipelines, Docker packaging, version derivation, GitHub releases, or Docker Hub publishing. |
| File | Role |
|---|---|
build.yml | Main Azure DevOps pipeline entry point |
pipeline-templates/global-variables.yml | Shared version and publish variables |
pipeline-templates/build-steps.yml | Common build/package steps reused by both jobs |
pipeline-templates/versionnumber.sh | Computes VersionString and ReleaseTag |
docker/Dockerfile | Runtime image definition |
docker/build.sh | Local build helper for Docker image + zip artifact |
docker/run.sh | Local helper for running the image |
The repo uses Azure DevOps Pipelines, not GitHub Actions.
build.ymlbuild.yml imports pipeline-templates/global-variables.yml and defines both
CI and PR behavior.
Push builds run for:
mainmasterrelease-*v*PR validation runs for:
mainmasterrelease-*Both trigger blocks exclude documentation-only changes:
**/*.mdLICENSEdocs/.github/CODEOWNERS| Job | Condition | What it does |
|---|---|---|
PRValidation | Build.Reason == PullRequest | Runs the shared build/package steps only |
BuildAndPublish | Build.Reason != PullRequest | Runs the shared build/package steps, creates a GitHub release, and optionally pushes Docker images |
Both jobs run on ubuntu-latest.
pipeline-templates/build-steps.ymlThe shared template performs the packaging work in this order:
pipeline-templates/versionnumber.shdocker/build.sh $(VersionString) $(Build.SourceVersion)oneidentity/safeguard-bash:latestdocker/build.sh is the real build implementation used by the pipeline. It:
oneidentity/safeguard-bash:<version>-alpineoneidentity/safeguard-bash:latestsafeguard-bash-<version>.zipinstall-local.sh, src/, samples/, and test/docker/Dockerfile builds the runtime image from alpine, installs the shell
and network tooling, copies repository content into /scripts, /samples, and
/test, and defaults the shell to launch with connect-safeguard.sh available.
pipeline-templates/global-variables.yml currently defines:
version: "8.2.0"
That is the base version used by the release helper.
A tag build is detected when Build.SourceBranch starts with refs/tags/.
versionnumber.sh then enforces this format:
v<major>.<minor>.<patch>
If the tag is valid:
VersionString becomes the tag without the leading vReleaseTag stays the original tag, for example v8.2.0If the tag is not semver-shaped, the script exits non-zero and the release build fails.
For non-tag builds, versionnumber.sh:
VersionString equal to the base version from global-variables.ymlexpr $buildId - 103500ReleaseTag=dev/v<base-version>-pre<buildNumber>Example:
8.2.0103900dev/v8.2.0-pre400global-variables.yml also sets:
isTagBuildisPrereleaseshouldPublishDockershouldPublishDocker is only true for tag builds, so Docker Hub publishing is
release-only even though the image is built on every pipeline run.
From the repo root:
./docker/build.sh <version> <commit-sha>
Example:
./docker/build.sh 8.2.0 abcdef1234567890
This produces:
oneidentity/safeguard-bash:8.2.0-alpineoneidentity/safeguard-bash:latestsafeguard-bash-8.2.0.zipYou can run the same helper the pipeline uses:
./pipeline-templates/versionnumber.sh 8.2.0 103900 main false
./pipeline-templates/versionnumber.sh 8.2.0 103900 v8.2.0 true
The script writes Azure DevOps variable commands to stdout, so use it mainly to
verify the derived VersionString and ReleaseTag behavior.
./docker/run.sh
./docker/run.sh -c /bin/bash
Use -v <hostdir> with docker/run.sh if you need to mount certs or keys into
/volume.
Every pipeline run publishes a build artifact named:
safeguard-bash-$(VersionString)
The artifact contains the generated zip file.
The BuildAndPublish job always creates a GitHub release in:
OneIdentity/safeguard-bash
Pipeline behavior:
$(Build.SourceVersion)userSpecifiedTag$(ReleaseTag)So merges to main, master, or release-* produce prerelease-style GitHub
releases even when Docker images are not pushed.
The pipeline pushes Docker images only when shouldPublishDocker == true, which
means tag builds only.
Published tags:
oneidentity/safeguard-bash:$(VersionString)-alpineoneidentity/safeguard-bash:latestThe login step uses a fixed Docker Hub username:
danpetersonoi
and reads the secret token from Azure Key Vault.
The release path depends on Azure DevOps resources that are external to the repo.
| Resource | Where used | Purpose |
|---|---|---|
PangaeaBuild-GitHub | GitHubRelease@1 | Create GitHub releases in OneIdentity/safeguard-bash |
SafeguardOpenSource | AzureKeyVault@2 | Authorize access to the Azure Key Vault holding publish secrets |
The pipeline reads secrets from:
SafeguardBuildSecrets
Requested secrets:
DockerHubAccessTokenDockerHubPasswordOnly DockerHubAccessToken is actually consumed by the current Docker login
command. DockerHubPassword is still requested, so treat it as part of the
expected release environment unless the pipeline is cleaned up.
The pipeline also assumes:
ubuntu-latestversionnumber.sh and docker/build.shIf a release change touches versioning, Docker tags, GitHub release behavior, or
publish secrets, inspect all of build.yml, pipeline-templates/, and
docker/build.sh together before changing anything.