mavenCentralUsername=*Value* mavenCentralPassword=*Value* signing.secretKeyRingFile=*Path to your secring.kbx* signing.keyId=743B11D9 signing.password=*Password to unlock the secret key*
Components Publication
Regular Git Repository Update
-
Push the changes to the GitHub repository Open Source Components.
-
Verify that the build job in the CI pipeline was successful.
-
-
The continuous integration pipeline is triggered by the push to the GitHub repository. Check that the job has been completed successfully. See Readme.
The statistics for developer activities will be automatically updated.
A good sanity check before pushing to the repository is to run the following command before pushing the code to the repository:
./gradlew clean build test javadoc testCodeCoverageReport testAggregateTestReport -Pvaadin.productionMode
You can consult the various reports generated by opening <PROJECT_ROOT>/src/site/reports.html
in your browser.
Release Process
We use a monorepo to manage the source code of the libraries and the example application. All libraries are released and published together on the maven central repository.
-
push to GitHub and verify the build on the CI server
-
git commit -m "Release X.Y.Z"
-
git tag -a "tangly-os-X.Y.Z" -m "official release published on maven central"
-
git push origin --tags
-
./gradlew publishMavenJavaPublicationToMavenRepository -Pvaadin.productionMode
Run all build-related tasks with -Pvaadin.productionMode
due to a bug in the vaadin plugin.
Verify first that the example application runs correctly with the new artifacts.
Upon releasing the new version of the libraries, you have to wait until the artifacts are available on the maven central repository. Once the artifacts are available, you can push the new version of the example application to the GitHub repository. It triggers the CI/CD pipeline. |
You can check the release on the maven central repository under Maven Central net.tangly. The search index takes a few hours to be updated.
Log in the sonatype portal for the staging repository and close the repository. Search the component in
-
maven central repository to check the release.
-
sonatype repository to check the release.
Constraints
The build process of the Gradle build file requires these variables to run without errors.
You must create a gradle ~/.gradle/gradle.properties
file with the following content:
For mysterious reasons, the Maven Publish plugin does work only if you have a secring.kbx
file.
If necessary, run the command gpg --keyring secring.gpg --export-secret-keys > ~/.gnupg/secring.gpg
to create the file
[1].
Maven Central Publication
The following process is used to publish tangly open source component on Maven Central.
-
Publish artifacts of a component with the script
uploadToMavenCentral.sh
. Do not use the gradle taskgradle publishAllPublicationsToMavenRepository -Pvaadin.productionMode
. Sonatype cannot handle a parallel upload of multiple components and simply close the connections during upload (Status 2020-Q2).-
Pre-activity: test publishing with
gradle publishToMavenLocal
. -
Pre-activity: check on GitHub the product compiles through the CI continuous integration pipeline.
-
Post-activity: tag repository on git to identify the version of the published packages. The tag version semantic part must be the same as the package version on Maven Central.
The tag is of the form -AcronymComponent-MajorVersion-MinorVersion-PatchVersion-. -
Verify with
git tag label
andgit push origin --tags
.
-
-
Log into Sonatype Maven Central Repository.
-
Go to Staging Repositories.
-
Find your temporary repository at the end of the list.
-
Review the content of the repository,
-
Close the repository-button on the tool list.
-
Close stage is initiated and checks are performed. If everything was fine, the content was published.
-
Release the artifact-button on the tool list.
-
-
See Static Website Publication to update the website.
It takes up to one day until the component is visible in Maven Central website upon publication. On the positive side, the last publications were performed in less than 30 minutes. |
The final step is to create a release on GitHub and update the website.
Dependencies
Below the dependencies between tangly open source components as defined in the multi-modules Gradle Build Tool build file.
Decisions
-
The open source components are stored in a mono repository. Each component is declared as a Gradle module.
-
We use de facto standard Git.
-
We are hosted at GitHub [2]. Mirror repositories are hosted at GitLab [3].
-
The continuous delivery pipelines work for the primary and the mirror platforms. The build uses the eclipse-temurin Java distribution. This docker image is based on Ubuntu. The installation of additional packages is therefore simplified [4].
The synchronization is performed with the command
git push --prune
https://github.com/marcelbaumann/tangly-os.git
+refs/remotes/origin/*:refs/heads/* +refs/tags/*:refs/tags/* (1)
git remote (2)
git push origin (3)
git push origin-gitlab
git push origin-hslu
git push origin-bitbucket
1 | Push the repository with all remotes, references, and tags to GitHub specified repository |
2 | List all remotes associated with this git repository |
3 | Push the master branch to the origin-GitHub remote repository. The push shall trigger the continuous integration pipeline |
You must create a token for a developer account to be able to push changes and trigger the CI pipeline. The username is your account username. The password is the generated token [5]. Store it in a safe place.
Findings
-
We needed to manually publish the public key on keys.openpgp.org
-
Gradle build file has a condition including disabling the signing plugin on the CI pipeline because keys and associated authentication are not available. I decided not to upload private keys to bitbucket. See the documentation at the beginning of the Gradle build file for details.
Set the property if you want to sign the component artifacts and publish to Maven Central. |
Static Website Publication
Introduction
The static website uses Asciidoc to write all documents.
Configure Asciidoctor
The new version of the Hugo support configuration of Asciidoctor through config.toml
therefore no manipulation of asciidoctor is needed.
As a bonus, the files generated by PlantUml are created in the correct folder.
We still need to install the referenced packages.
sudo gem install asciidoctor-diagram (1)
sudo gem install asciidoctor-bibtex (2)
sudo gem install asciimath (3)
1 | Provides support for all diagrams such as plantUML and mermaid. |
2 | Provides support for formal bibliography references. |
3 | Provides support for mathematical and logical expressions in documents. |
Docsy Tailoring
The docsy theme is missing some features. It does not support AsciiDoc styling or commenting blogs. Our extensions follow the official rules on how a theme can be tailored and expanded.
The major changes are:
-
Inclusion of the styling sheet asciidoctor.scss to style AsciiDoc documents [6].
-
Inclusion of the shortcodes extension shortcodes.html layouts and the style file shortcodes.scss to support file attachments in the website [7].
-
Extension of the blog section with comments-uttereances.html to support comments on blog articles [8].
-
Changes in the header and footer partials to display mathematical expressions and well-styled copyright [9].
All changes are defined in the assets and layouts folders as part of our website content. Hugo’s algorithms select local overwritten files and ignore the corresponding theme files.\
The current structure of our extensions follows the official approach to how a Hugo module should be extended. We do not change any files in the theme. All changes are defined locally. We use the selection algorithm of Hugo to activate our tailoring and extensions. |
Create Website
The tangly open source components website is hosted under Documentation.
Read the instructions in the asciidoctor script file under the scripts' folder. Four scripts are provided to generate the Hugo static site with associated structure and theme.
-
the script initiateHugo.sh creates the layout of the site and retrieves the theme.
-
the script populateHugo.sh populates the site with our content.
Upon completion of local development, you must start a local Hugo server and generate the indexing files for lunr search. Before uploading the site, stop the Hugo local server.
-
the script completeHugo.sh generates the static pictures and copies them to the static folder and publish the whole site on GitHub.
Upon completion, the site is published on the web for all.
Set JDK Version under macOS
Install regular Java JDK such as the Oracle or OpenJDK distribution. They will be located under /Library/Java/JavaVirtualMachines.
If using bash or zsh shell, add the following commands to your .bash_profile or .zshrc [10].
alias java21 = "export JAVA_HOME=`/usr/libexec/java_home -v 21`; java -version"
alias java23 = "export JAVA_HOME=`/usr/libexec/java_home -v 23`; java -version"
You can set the exact version such as 17.0.1 to precisely select a JDK or set an overall version such as 17 to select a generic version.
After restarting your terminal, the command java17 will set JDK 17 to default JDK (if installed on your macOS).
The list of JDK can be found with
/usr/libexec/java_home -V
Create Docker Distribution
Generate the ERP application as a production release.
gradle install -DproductionMode=true (1)
gradle install -Pproduction
unzip ./build/distributions/net.tangly.erp.ui-<version>.zip (2)
docker build -t erp-docker . (3)
docker run -ti -p 8080:8080 erp-docker (4)
1 | Generates a production distribution stored under ./build/distributions |
2 | Unzip the packed distribution because the docker base image does not contain the unzip utility |
3 | Build the docker image named erp-docker |
4 | Run the docker image erp-docker and map the image port to 8080 |
secring.kbx
file and stored public and private keys into the pubring.kbx
file.