Jenkins and other CI
Jenkins, Buildkite, Tekton, Argo Workflows and laptops use service-account tokens. Create the account, bind it to the repositories it needs and create a token exactly as in GitHub Actions:
E=https://entrepot.example.comcurl -fsS -H "Authorization: Bearer $ADMIN" -X POST $E/api/v1/service-accounts -d '{"name":"jenkins"}'curl -fsS -H "Authorization: Bearer $ADMIN" -X POST $E/api/v1/role-bindings \ -d '{"role":"developer","subjectType":"user","subject":"sa:jenkins","repositoryPattern":"*-internal"}'curl -fsS -H "Authorization: Bearer $ADMIN" -X POST $E/api/v1/service-accounts/jenkins/tokens \ -d '{"name":"ci","scopes":["read","write"],"expiresInDays":90}' | jq -r .secretStore the secret in Jenkins as a Secret text credential (for example
entrepot-token) or as Username with password with any username.
Jenkinsfile
Section titled “Jenkinsfile”pipeline { agent { docker { image 'node:22' } } environment { ENTREPOT_TOKEN = credentials('entrepot-token') } stages { stage('Publish') { steps { sh ''' npm config set registry https://entrepot.example.com/repository/npm-internal/ npm config set //entrepot.example.com/repository/npm-internal/:_authToken "$ENTREPOT_TOKEN" npm ci && npm publish ''' } } }}stage('Publish') { environment { TWINE_USERNAME = 'token' TWINE_PASSWORD = credentials('entrepot-token') } steps { sh ''' python -m build twine upload --repository-url https://entrepot.example.com/repository/pypi-internal/ dist/* ''' }}stage('Image') { steps { withCredentials([string(credentialsId: 'entrepot-token', variable: 'ENTREPOT_TOKEN')]) { sh ''' echo "$ENTREPOT_TOKEN" | docker login entrepot.example.com -u token --password-stdin docker build -t entrepot.example.com/docker-internal/acme/web:$GIT_COMMIT . docker push entrepot.example.com/docker-internal/acme/web:$GIT_COMMIT ''' } }}stage('Upload') { steps { withCredentials([string(credentialsId: 'entrepot-token', variable: 'ENTREPOT_TOKEN')]) { sh 'curl -f -H "Authorization: Bearer $ENTREPOT_TOKEN" -T target/app.jar "https://entrepot.example.com/repository/files/acme/app/$BUILD_NUMBER/app.jar"' } }}Always pass the token through an environment variable inside single-quoted
sh strings, so Groovy doesn’t interpolate it into the build log.
Token hygiene
Section titled “Token hygiene”- One service account per pipeline or team, so the audit log tells you who published what.
- Restrict tokens with scopes (
readfor build agents that only install) and expiry (expiresInDays). - A scoped credential can’t create a broader token.
- Tokens are stored as SHA-256 hashes; list and revoke them with
GET/DELETE /api/v1/service-accounts/<name>/tokens[/<id>]or in the UI (Administration → Service accounts).