Skip to content

Commit

Permalink
Fix spring-enterprise-release-bundle.yml for async=false
Browse files Browse the repository at this point in the history
* Also fix `actions\spring-website-project-version-update` for an explicit API version,
since `{version}` placeholder is resolved as an Antora version, where not all projects provides an API as a part of Antora distribution
* Extracting common parts of the `curl` for `spring-enterprise-release-bundle.yml` script
  • Loading branch information
artembilan committed Dec 4, 2024
1 parent 02a5bb9 commit 7a9bb06
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ runs:
for VERSION in $VERSIONS_TO_UPDATE
do
VERSION_JSON='{"version": "'$VERSION'", "referenceDocUrl": "'https://docs.spring.io/$PROJECT/reference/\{version\}'", "apiDocUrl": "'https://docs.spring.io/$PROJECT/docs/\{version\}/api'", "isAntora": true}'
VERSION_JSON='{"version": "'$VERSION'", "referenceDocUrl": "'https://docs.spring.io/$PROJECT/reference/\{version\}'", "apiDocUrl": "'https://docs.spring.io/$PROJECT/docs/$VERSION/api'", "isAntora": true}'
eval $SPRING_WEBSITE_CLIENT/releases -X POST -d '"$VERSION_JSON"' --fail --show-error
done
Expand Down
16 changes: 6 additions & 10 deletions .github/workflows/spring-enterprise-release-bundle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,11 @@ jobs:
steps:

- run: |
curl -s -u "${{ secrets.ARTIFACTORY_USERNAME }}:${{ secrets.ARTIFACTORY_PASSWORD }}" \
-X POST -H "X-JFrog-Signing-Key-Name: packagesKey" -H "Content-Type: application/json" \
"${{ inputs.artifactoryUrl }}/lifecycle/api/v2/release_bundle?project=spring" \
-d '{"release_bundle_name": "${{ inputs.bundleName }}", "release_bundle_version": "${{ inputs.releaseVersion }}", "skip_docker_manifest_resolution": true, "source_type": "builds", "source": {"builds": [ {"build_repository": "spring-build-info", "build_name": "${{ inputs.buildName }}", "build_number": "${{ inputs.buildNumber }}", "include_dependencies": false}]}}'
ARTIFACTORY_CLIENT='curl -s -u "${{ secrets.ARTIFACTORY_USERNAME }}:${{ secrets.ARTIFACTORY_PASSWORD }}" -X POST -H "Content-Type: application/json" --fail --show-error --url "${{ inputs.artifactoryUrl }}/lifecycle/api/v2"'
sleep 10
curl -s -u "${{ secrets.ARTIFACTORY_USERNAME }}:${{ secrets.ARTIFACTORY_PASSWORD }}" \
-X POST -H "Content-Type: application/json" \
"${{ inputs.artifactoryUrl }}/lifecycle/api/v2/distribution/distribute/${{ inputs.bundleName }}/${{ inputs.releaseVersion }}?project=spring" \
-d '{"auto_create_missing_repositories": "false", "distribution_rules": [{"site_name": "JP-SaaS"}], "modifications": {"mappings": [{"input": "spring-enterprise-maven-prod-local/(.*)", "output": "spring-enterprise/$1"}]}}'
BUNDLE_JSON='{"release_bundle_name": "${{ inputs.bundleName }}", "release_bundle_version": "${{ inputs.releaseVersion }}", "skip_docker_manifest_resolution": true, "source_type": "builds", "source": {"builds": [ {"build_repository": "spring-build-info", "build_name": "${{ inputs.buildName }}", "build_number": "${{ inputs.buildNumber }}"}]}}'
eval $ARTIFACTORY_CLIENT/release_bundle?project=spring&async=false -H "X-JFrog-Signing-Key-Name: packagesKey" -d '"$BUNDLE_JSON"'
DISTRIBUTION_JSON='{"auto_create_missing_repositories": "false", "distribution_rules": [{"site_name": "JP-SaaS"}], "modifications": {"mappings": [{"input": "spring-enterprise-maven-prod-local/(.*)", "output": "spring-enterprise/$1"}]}}'
eval $ARTIFACTORY_CLIENT/distribution/distribute/${{ inputs.bundleName }}/${{ inputs.releaseVersion }}?project=spring -d '"$DISTRIBUTION_JSON"'

0 comments on commit 7a9bb06

Please sign in to comment.