-
Notifications
You must be signed in to change notification settings - Fork 7
Add CICD scripts for automated deploys and QA #70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
28eb497
Added CICD files for automated deploys
fmadjdian 8ed50ed
Updated CICD files
fmadjdian 129f5ac
Remove unneeded file
fmadjdian d494d02
Updates to files and removed QA
fmadjdian a5c384f
Moved the location of pom.xml
fmadjdian f81992a
Update Jenkinsfile-OTA
fmadjdian 0a9436b
Update Jenkinsfile-PullRequestChecker
fmadjdian 847ca89
Update Jenkinsfile-PullRequestChecker
fmadjdian File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| def PIPELINE_AGENT_LABEL = 'Build-Medium' | ||
| def DOCKER_MAVEN_IMAGE = 'maven:3-eclipse-temurin-21' | ||
| def CICD_LAST_STARTED_STAGE = '' | ||
|
|
||
| pipeline { | ||
| agent { | ||
| label PIPELINE_AGENT_LABEL | ||
| } | ||
|
|
||
| environment { | ||
| JOB_NAME_CLEAN = env.JOB_BASE_NAME.toLowerCase() | ||
| GENERATED_BUILD_NAME = sh(script: "${CICD_SCRIPTS_DIR}/job/get_build_name.sh", returnStdout: true) | ||
|
|
||
| AERIUS_REGISTRY_HOSTNAME = credentials('DOCKER_REGISTRY_HOSTNAME') | ||
| AERIUS_REGISTRY_PATH = sh(script: "${CICD_SCRIPTS_DIR}/docker/get_registry_path.sh", returnStdout: true) | ||
| AERIUS_REGISTRY_URL = "${env.AERIUS_REGISTRY_HOSTNAME}/${env.AERIUS_REGISTRY_PATH}/" | ||
| AERIUS_IMAGE_TAG = sh(script: "${CICD_SCRIPTS_DIR}/docker/get_image_tag.sh", returnStdout: true) | ||
|
|
||
| } | ||
|
|
||
| stages { | ||
| stage('Init') { | ||
| steps { | ||
| buildName GENERATED_BUILD_NAME | ||
| } | ||
| } | ||
|
|
||
| stage('Maven') { | ||
| agent { | ||
| docker { | ||
| label PIPELINE_AGENT_LABEL | ||
| image DOCKER_MAVEN_IMAGE | ||
| reuseNode true | ||
| } | ||
| } | ||
| steps { | ||
| script { CICD_LAST_STARTED_STAGE = STAGE_NAME } | ||
| sh ''' | ||
| mvn clean versions:set -DnewVersion="${AERIUS_IMAGE_TAG}" -Pdeploy --no-transfer-progress | ||
| mvn clean package -Pdeploy -DskipTests -DfailIfNoTests=true --no-transfer-progress | ||
| ''' | ||
| } | ||
| } | ||
|
|
||
| stage('Docker Images') { | ||
|
|
||
| steps { | ||
| script { CICD_LAST_STARTED_STAGE = STAGE_NAME } | ||
| sh ''' | ||
| cd docker | ||
| "${CICD_SCRIPTS_DIR}"/docker/images_v1.0.sh | ||
| ''' | ||
| } | ||
| } | ||
|
|
||
| stage('Post job') { | ||
| environment { | ||
| DEPLOY_OTA_ENVIRONMENT_CICD_URL = credentials('DEPLOY_OTA_ENVIRONMENT_CICD_URL') | ||
| DEPLOY_OTA_ENVIRONMENT_CICD_LOGIN = credentials('DEPLOY_OTA_ENVIRONMENT_CICD_LOGIN') | ||
| FLAGS = "${env.JOB_SPECIFIC_FLAGS ?: ''}" | ||
| CICD_JOB_MESSAGES = sh(script: """${CICD_SCRIPTS_DIR}/job/add_job_duration.sh build "${currentBuild.durationString}" """, returnStdout: true) | ||
| } | ||
|
|
||
| steps { | ||
| script { CICD_LAST_STARTED_STAGE = STAGE_NAME } | ||
| sh ''' | ||
| "${CICD_SCRIPTS_DIR}"/job/postscript_v1.0.sh | ||
| ''' | ||
| } | ||
| } | ||
| } | ||
|
|
||
| post { | ||
| always { | ||
| withBuildUser { | ||
| script { | ||
| if (currentBuild.result != 'SUCCESS') { | ||
| env.CICD_LAST_STARTED_STAGE = CICD_LAST_STARTED_STAGE | ||
| mattermostSend( | ||
| channel: (env.MATTERMOST_CHANNEL ? "#${env.MATTERMOST_CHANNEL}" : null), | ||
| color: sh(script: """${CICD_SCRIPTS_DIR}/job/notify_mattermost_color.sh "${currentBuild.result}" """, returnStdout: true), | ||
| message: sh(script: """${CICD_SCRIPTS_DIR}/job/notify_mattermost_message.sh "${currentBuild.result}" "${currentBuild.durationString}" build """, returnStdout: true) | ||
| ) | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| def PIPELINE_AGENT_LABEL = 'PullRequestChecker' | ||
| def DOCKER_MAVEN_IMAGE = 'maven:3-eclipse-temurin-21' | ||
|
|
||
| pipeline { | ||
| agent { | ||
| label PIPELINE_AGENT_LABEL | ||
| } | ||
|
|
||
| stages { | ||
| stage('Build Maven') { | ||
| agent { | ||
| docker { | ||
| label PIPELINE_AGENT_LABEL | ||
| image DOCKER_MAVEN_IMAGE | ||
| reuseNode true | ||
| } | ||
| } | ||
|
|
||
| steps { | ||
| withCredentials([string(credentialsId: 'SONAR_TOKEN', variable: 'SONAR_TOKEN')]) { | ||
| sh 'mvn clean verify org.sonarsource.scanner.maven:sonar-maven-plugin::sonar -Pdeploy,sonar --no-transfer-progress -Dsonar.java.binaries=target -Dsonar.pullrequest.key=${CHANGE_ID} -Dsonar.pullrequest.branch=PR-${CHANGE_ID} -Dsonar.pullrequest.base=${CHANGE_TARGET}' | ||
| } | ||
| } | ||
| } | ||
|
|
||
| stage('Build Docker') { | ||
| steps { | ||
| sh ''' | ||
| cd docker | ||
| "${CICD_SCRIPTS_DIR}"/docker/images_v1.0.sh --no-push | ||
| ''' | ||
| } | ||
| } | ||
| } | ||
| } |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.