Content
Table of Contents | |
---|---|
|
...
|
Building Steps (Struts)
Getting ready
- Create an "Struts 2.x.y omnibus ticket" ticket in JIRA to refer to in upcoming release related commit comments and for general documentation purposes. Mark it with priority "Blocker".
- Switch to branch
develop
- Ensure that the master POM and Struts Annotations have current releases
- Review JIRA for any issues without a fix version set, and for any issues that should be resolved for the pending release.
- Ensure that there are no repositories or pluginRepositories listed in the poms.
- If you have committed all changes regarding the release process, close the omnibus ticket as it is the last open ticket for the upcoming release
- Release the upcoming version in JIRA (under Administration/Manage Releases) and tag the release date
- Add next milestone version to the JIRA roadmap
- Create DONE and TODO filters for the new version, share with all, and remove obsolete TODO filter
- Create a new Version Notes page in Confluence, link from Migration Guide, and link to prior release page and JIRA DONE filters of the version to release
Note |
---|
Before starting release process make sure that the Docs were exported to https://cwiki.apache.org/WW/! Check the Version Notes page! |
Obtain a fresh checkout.
Code Block |
---|
svn co https://svn.apache.org/repos/asf/struts/struts2/trunk STRUTS_#_#_#
|
Change site target
Edit the top pom.xml file and replace 2.x the url below with version number that's going to be released
...
<distributionManagement>
<site>
<id>apache-site</id>
<url>scp://people.apache.org/www/struts.apache.org/2.x/</url>
</site>
</distributionManagement>
- Export wiki pages and put them under
/docs
Update Draft Docs when needed
Checkout struts-site
project (see details at the bottom of this page) and perform export:
Code Block |
---|
cd struts-site
mvn package |
If build will fail try again - don't use clean
, the exporter is going to update only outdated pages. After successful export, commit updated files into struts-production
Be sure your local copy is up-to-date
Code Block |
---|
git fetch origin --prune
git checkout master
git pull |
Note |
---|
Please remember to keep BOM subproject in sync - |
...
Prepare release
Tag the release by using the "release:prepare" goal of Maven:
Code Block |
---|
mvn release:prepare -Dusername=yourSvnUsername -Dpassword=yourSvnPassword -DautoVersionSubmodules=true |
For a dry run, add '-DdryRun=true
'. If you do a dry run, use 'mvn release:clean
' to clean up after you have looked at the output.unmigrated-wiki-markup
When prompted for the SCM tag name, follow this pattern: {{ STRUTS_2_3_\[PATCH_VERSION\]}}
Note |
---|
For some reason, when using svn client 1.5, the release plugin might fail to tag the release, if it fails, run: |
...
]
...
Note |
---|
If you get the an error message above, try to re-run |
This step will (more information):
- Check that there are no uncommitted changes in the sources
- Check that there are no SNAPSHOT dependencies
- Change the version in the poms from x-SNAPSHOT to a new version (you will be prompted for the versions to use)
- Transform the SCM information in the POM to include the final destination of the tag
- Run the project tests against the modified POMs to confirm everything is in working order
- Commit the modified POMs
- Tag the code in the SCM with a version name (this will be prompted for)
- Bump the version in the POMs to a new value y-SNAPSHOT (these values will also be prompted for)
- Commit the modified POMs
Follow the link to get more information about performed operation by release plugin.
Perform the release
Code Block |
---|
mvn release:perform -DusernameDretryFailedDeploymentCount=yourSvnUsername10 |
This step will (more information):
- Checkout from an SCM URL with optional tag
- Run the predefined Maven goals to release the project (by default, deploy site-deploy)
Follow the link to get more information about performed operation by release plugin. After this step the artifacts will be hosted by Nexus. The -DretryFailedDeploymentCount=10
is needed when there are problems with network connection (used just in case).
If you need to run perform again, (or in a different box), do:
Code Block |
---|
svngit co http://svn.apache.org/repos/asf/struts/struts2/tags/$VERSION cd $VERSION mvn deploy site-checkout STRUTS_2_3_[PATCH_VERSION] mvn javadoc:javadoc deploy --no-plugin-updates -DperformRelease=true -Papache-release |
Next, log in to Nexus and close staging repository.
Note |
---|
Repository is identified by user name and public IP address, so if in meantime your IP changed, a new staging repository will be created so you must drop the old one (check the dates!) - if IP is the same, artifacts will be uploaded to the same repository as first attempt. |
Move the assemblies
To simplify testing, the assemblies have to be moved to the https:
/
...
/
...
dist.apache.org/
...
repos/dist/dev/struts/
$VERSION
dir.
After closing repository in Nexus, you must obtain the url where the assemblies are stored, it looks like belowcheck if the release files are available from staging repository as bellow:
Code Block |
---|
https://repository.apache.org/content/repositoriesgroups/orgapachestruts-300staging/org/apache/struts/struts2-assembly/$VERSION/ |
extract $REPOID, in the above example it's orgapachestruts-300.
In order to move the assemblies login to people.apache.org and execute the following code:
Code Block | none | none
---|
#!/bin/sh # create #create the destination directory echo "Creating working dir $VERSION" mkdir $VERSION cd $VERSION # get the distro echo "Getting distro $VERSION" wget -erobots=off -nv -l 1 --accept=zip,md5,sha1,asc -r --no-check-certificate -nd -nH https://repository.apache.org/content/repositoriesgroups/$REPOIDstaging/org/apache/struts/struts2-assembly/$VERSION # rename files echo "Renaming files" for f in *2-assembly*.zip* do mv $f `echo $f | sed s/2-assembly//g` done # remove unneeded files echo "Removing unneeded files" for f in struts2-assembly-*.pom* do rm $f done |
After that move the assemblies directory to the builds destination with
Code Block |
---|
mv $VERSION /www/people.apache.org/builds/struts/
|
Jira stuff
...
# remove unneeded hashes
echo "Removing unneeded files"
rm *.asc.md5
rm *.asc.sha1
cd ..
# checking in new version
echo "Pushing test version $VERSION"
svn --no-auth-cache co --depth empty https://dist.apache.org/repos/dist/dev/struts/ struts-dev
mv $VERSION struts-dev/
cd struts-dev
svn add --force ./
svn --no-auth-cache commit -m "Updates test release $VERSION"
cd ..
# cleaning up
rm -r struts-dev
echo "Done!" |
After this step artifacts are available for test here https://dist.apache.org/repos/dist/dev/struts/
...
Announce availability
Send a short e-mail to dev@struts.a.o informing about the new packages and to give people enough time to test the distribution (actual bits). Wait around a week before posting Vote. If no show-stoppers reported, start a vote thread for build quality designation.
Push changes
Do not forget to push your local changes to the Apache repo
Code Block |
---|
git push |
Vote on it
Post a release/quality vote to the dev list (and only the dev list). The example mail is on Sample Announcements page. announcements page. If the vote result is for an ASF release (i.e. not test build), update site, announce. If the vote result is for GA, push to central.
Copy files
After the vote, if the distribution is being mirrored (there was a favourable release vote) copy the Sources and Binariesmove all the artefacts from dev
folder into release
folder:
Code Block |
---|
ssh people.apache.org cd /www/peoplesvn mv https://dist.apache.org/buildsrepos/struts/$VERSION cp struts-$VERSION-src.* /www/www.apache.org/dist/struts/source cp struts-$VERSION-docs.* /www/www.apache.org/dist/struts/documentation cp struts-$VERSION-lib.* /www/wwwdist/dev/struts/$VERSION/ https://dist.apache.org/dist/struts/library cp struts-$VERSION-apps.* /www/www.apache.org/dist/struts/examples cp struts-$VERSION-all.* /www/www.apache.org/dist/struts/binaries |
If a new DTD was defined, copy it to /www/struts.apache.org/dtds/ and change permission to struts group (chwon :struts *.dtd) and write rights (chmod g+w *.dtd).
Note |
---|
The default setup on people.apache.org will leave the files and directories only changeable by the user who creates them. The last two steps will allow future releases to go smoothly. repos/dist/release/struts/ |
Promote release
Log in again to Nexus and release the repository, it will be automatically replicated across Maven Repositories
See Releasing a Maven-based project for further details.
...
Remove the old files from under https:/www/wwwdist.apache.org/repos/dist/release/struts/ to synchronize to synchronise only the latest version with peers. All the files from https:/www/wwwdist.apache.org/repos/dist/release/struts/ are are always mirrored to http://archive.apache.org/dist/struts/. You can use the below command:
No Format |
---|
svn del https://dist.apache.org/repos/dist/release/struts/2.3.x/
|
where x
is the previous version to remove (or one more previous to keep current and one version back).
Wait for rsync
Wait 24 hours before proceeding.
Update site
(Optional) - Update Security Bulletins
If the release will fix a - hopefully yet undisclosed - security issue, it's now time to update the Security Bulletins page and add a new announcement. For a template, just check former announcements
Update site (Struts 2 site)
Code Block |
---|
ssh people.apache.org
export VERSION=2.#.#
unzip /www/people.apache.org/builds/struts/$VERSION/struts-$VERSION-docs.zip -d ~/docs
#now the docs are under ~/docs/struts-$VERSION/docs
mkdir -p /www/struts.apache.org/$VERSION
mv ~/docs/struts-$VERSION/docs/* /www/struts.apache.org/$VERSION
chmod -R g+w /www/struts.apache.org/$VERSION
|
Edit /www/struts.apache.org/$VERSION/archetype-catalog.xml and update the version of artifacts
Update site (Struts top level site)
...
Make sure you have linked your Apache and Github account in Apache GitBox (Dual Master Git alowing you to directly push to GitHub), see https://gitbox.apache.org/setup/
Check out site src code
Code Block git clone https://github.com/apache/struts-site.git
or use SSH instead:
Code Block git clone git@github.com:apache/struts-site.git
- If a new DTD was defined, add it to
source/dtds
- Update current version and release date in
struts-site/_config.yml
- Update page source files
- struts-site/source/announce.md (if applicable, refer also to corresponding security bulletin)
- struts-site/source/downloads.html (Prior Releases section)
- struts-site/source/index.html (some parts will updated automatically with values defined in
_config.yml
)
- Generate site with Docker Jekyll image
- you must have Docker installed and running
- if you are doing this the first time, download the official Struts image to build the site from https://hub.docker.com/r/theapachestruts/struts-site-jekyll/
- start
docker-machine
- now you can use one of the bash scripts already provided in the
struts-site
:docker-run.sh
- used with Bashdocker-run.fish
- to use with Fish Shell (viafish docker-run.fish
)
- now you can check the generated site at http://localhost:4000
Commit the changes and the generated content
Now the changes must be deployed to production which is basically a separated Subversion repository, you check it out with command below:
Code Block |
---|
svn co https://svn.apache.org/repos/infra/websites/production/struts/content struts-production |
It's a good idea to keep that working copy to be used with future releases. Right now copy content of struts-site/content
folder to struts-production
folder, then commit changes. Next step is to update exported wiki pages. With current approach the pages are kept in struts-production/docs
.
Redeploy the docs (Optional)
...
Checkout source of the website and export Confluence pages
Code Block
svn co https://svn.apache.org/repos/asf/struts/site/trunk struts-site
...
cd struts-site
...
mvn package
Now the whole Confluence space is exported to
target/cwiki/WW/docs/
Checkout copy of production website (if you didn't that before)
Code Block svn co https://svn.apache.org/repos/infra/websites/production/struts/content/ struts-production
(you can checkout just a subtree, but it's better to checkout the whole repo especially when you want to update also the main web page)
Update production
Code Block cp -r struts-site/target/cwiki/WW/docs/* struts-production/docs/ cd struts-production svn commit "Updates production"
...
Code Block |
---|
mvn site:site
|
...
Code Block |
---|
mvn site-deploy
|
...
Rollback site target
Revert back the site target to 2.x and commit the change
Permissions
After updating the site, be sure that the permissions are set to group writeable ($ chmod -R g+w .
)
Post announcements
We leave this as the last step, once the artifacts have had time to sync up on the mirrors. Target it to: user@struts.a.o and announcements@struts, announcements@struts.a.o and announce@a.o, samples are available at Sample announcements page