Skip to content

All edits in firdaus_changes branch

S A Firdaus requested to merge firdaus_changes into main

Blocks https://gitlab.com/gitlab-org/professional-services-automation/pipelinecoe/applications/maven-example/-/merge_requests/1

All the edits made in firdaus_changes are below

  1. Added - local: 'Test.gitlab-ci.yml' into Application.gitlab-ci.yml
include:
    - local: 'Build.gitlab-ci.yml'
    - local: 'Test.gitlab-ci.yml'
    - local: 'Deployment.gitlab-ci.yml'
    - local: 'Terraform.gitlab-ci.yml'
  1. Added ant build in Build.gitlab-ci.yml
# Ant
.ant-build:
    image: ${CONTAINER_PATH}/ant-container:latest
    script: 
        - ant compile
        - ant jar
  1. Added qualitygate and nexus into Deployment.gitlab-ci.yml
#Qaulitygate Check
.qualitygate-build:
   stage: deploy
   image: ${CONTAINER_PATH}/qualitygate-check:latest
   services:
      - docker:dind
   script:
      - echo "Checking code against policy..."
      - chmod +x validate.sh
      - ./validate.sh $apikey $CI_PROJECT_ID $CI_PIPELINE_ID $CI_PROJECT_DIR
   allow_failure: false

# Nexus  
.nexus-deploy-image:
    image: docker:latest
    services:
      - docker:dind
    script:
      - echo "Deploying image to Nexus registry"
      - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
      - docker pull $CI_REGISTRY_IMAGE
      - docker login -u $NEXUS_USER -p $NEXUS_PWD http://$NEXUS_REGISTRY_PATH
      - docker tag $CI_REGISTRY_IMAGE $NEXUS_REGISTRY_PATH/$CI_PROJECT_NAME 
      - docker push $NEXUS_REGISTRY_PATH/$CI_PROJECT_NAME

.nexus-mvn-deploy:
    image: ${CONTAINER_PATH}/maven-container:latest
    script: 
        - mvn $MAVEN_CLI_OPTS deploy -DskipTests -s settings.xml
  1. Added mvn into Test.gitlab-ci.yml
.mvn-test:
  image: ${CONTAINER_PATH}/maven-container:latest
  stage: test
  script:
    - mvn $MAVEN_CLI_OPTS verify
  artifacts:
    when: always
    reports:
      junit:
        - target/surefire-reports/TEST-*.xml
        - target/failsafe-reports/TEST-*.xml
Edited by S A Firdaus

Merge request reports