Skip to content
  • femiadeyemi's avatar
    use maven assembly plugin for packaging and restructure the CI/CD · ab9fb8ed
    femiadeyemi authored
    Motivation:
    
    The maven assembly is now use for packaging of the helmholtz-
    marketplace-server. Hence, the ci/cd needs to be adjusted to
    pick up the new structure.
    
    Modification:
    
    - add helmholtz-marketplace-webapp as a dependency to the project
    - add maven assembly plugin with the instruction of how to package
        the distribution inside the distribution.xml. Inside this file
        the helmholtz-marketplace-webapp.jar file will be upacked and
        the output will be put inside the webapp directory
    - create a shell script that can be use to start the server
    - in the application.yml file, add a custom location for the static
        files, which is webapp directory
    - adjust the dockerfile to reflect the new package structure
    - adjust the matcher in the security configuration to allow access
        to the static files
    - in the ci, add a build stage and rename test_sonar to
        code_quality_analysis
    - move the sonar test job into the ci.yml file
    - delete static-code-analysis.yml since it is no longer needed
    - rename the profile name for the sonar test in the pom file
        from static-code-analysis to sonar
    - run sonar test provided the ci/cd is not trigger by upstream
        repository, that is, helmholtz-marketplace-webapp
    
    Result:
    
    1. Create distribution package for the project. The tar file created
    will have a structure like this:
    
    | | |____hm-server
    | | | |____bin
    | | | | |____start.sh
    | | | |____classes/
    | | | |____webapp
    | | | | |____index.html
    | | | | |____images/
    | | | | |____styles/
    | | | |____lib
    | | | | |____helmholtz-marketplace-server-0.0.1-SNAPSHOT.jar
    
    2. A stable ci/cd that get trigger by push, merge-request and
    pipeline. The following stages are now in the ci:
    - build: check if the code compile
    - test: both unit and integration test
    - sonar: mainly for code quality analysis
    - package: when trigger by pipiline it will use the newly available
        snapshot of helmholtz-marketplace-webapp
    - deploy: push the artifact into the docker container that will
        be push into the docker hub
    
    Target: master
    ab9fb8ed