From 3faa80a7c6eeb2cc8de86ed1d16e095ca85962d5 Mon Sep 17 00:00:00 2001 From: Dima Denysenko Date: Tue, 14 Nov 2023 21:07:50 +0200 Subject: [PATCH] chore: drop pipeline configuration --- .drone/Dockerfile | 14 - .drone/pipelines.yml | 602 ------------------------------------------- 2 files changed, 616 deletions(-) delete mode 100644 .drone/Dockerfile delete mode 100644 .drone/pipelines.yml diff --git a/.drone/Dockerfile b/.drone/Dockerfile deleted file mode 100644 index 8a6787c..0000000 --- a/.drone/Dockerfile +++ /dev/null @@ -1,14 +0,0 @@ -ARG BASE_IMAGE - -FROM $BASE_IMAGE - -LABEL maintainer="maintainer@knowhowto.dev" -ARG BUILD_VERSION -ENV APPLICATION_BUILD_VERSION ${BUILD_VERSION} - -WORKDIR /opt/app - -COPY ./target/*.jar /opt/app/app.jar - -ENTRYPOINT [ "sh", "-c", "java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -Duser.timezone=UTC -jar /opt/app/app.jar"] -EXPOSE 8080 diff --git a/.drone/pipelines.yml b/.drone/pipelines.yml deleted file mode 100644 index 2836e97..0000000 --- a/.drone/pipelines.yml +++ /dev/null @@ -1,602 +0,0 @@ -kind : pipeline -name : CodeVerification -type : docker - -trigger : - event : - - push - - tag - -volumes : - - name : m2cache - host : - path : /app/.m2 - -steps : - - - name : mysql-healthcheck - image : mysql:5.7.42 - pull : if-not-exists - commands : - - while ! mysqladmin ping -h db -u svc_testing -psvc_testing --silent; do sleep 1; done - - mysql -h db -u svc_testing -psvc_testing -e "CREATE TABLE IF NOT EXISTS svc_testing_db.pipelines (id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(50) NOT NULL);" - - - name : code-coverage-gate - image : know-how.download/svc-builder:openjdk-21-slim-bookworm - pull : if-not-exists - volumes : - - name : m2cache - path : /root/.m2 - environment : - DATASOURCE_DRIVER : com.mysql.cj.jdbc.Driver - DATASOURCE_URL : jdbc:mysql://db:3306/svc_testing_db?serverTimezone=UTC&rewriteBatchedStatements=true&characterEncoding=UTF-8 - DEPLOYER_USERNAME : - from_secret : DEPLOYER_USERNAME - DEPLOYER_PASSWORD : - from_secret : DEPLOYER_PASSWORD - commands : - - javac -version - - mvn -version - - node --version - - npm --version - - npx --version - - npm install - - mvn clean verify -Dstyle.color=always -Dmaven.javadoc.skip=true -s ../maven-settings.xml -Ddeployer.username=$DEPLOYER_USERNAME -Ddeployer.password=$DEPLOYER_PASSWORD - - mvn install -Dstyle.color=always -Dmaven.javadoc.skip=true -DskipTests -Dmaven.test.skip=true --file bookingdb-support/pom.xml -s ../maven-settings.xml -Ddeployer.username=$DEPLOYER_USERNAME -Ddeployer.password=$DEPLOYER_PASSWORD - - - name : static-analysis-gate - depends_on : - - code-coverage-gate - image : know-how.download/svc-builder:openjdk-21-slim-bookworm - pull : if-not-exists - volumes : - - name : m2cache - path : /root/.m2 - environment : - DEPLOYER_USERNAME : - from_secret : DEPLOYER_USERNAME - DEPLOYER_PASSWORD : - from_secret : DEPLOYER_PASSWORD - SONAR_HOST : - from_secret : SONAR_HOST - SONAR_TOKEN : - from_secret : SONAR_TOKEN - commands : - - mvn org.apache.maven.plugins:maven-dependency-plugin:3.5.0:copy-dependencies -Dmdep.prependGroupId=true -Dstyle.color=always -s ../maven-settings.xml -Ddeployer.username=$DEPLOYER_USERNAME -Ddeployer.password=$DEPLOYER_PASSWORD - - mvn sonar:sonar '-Dsonar.java.libraries=target/dependency/*.jar' '-Dsonar.java.test.libraries=target/classes,target/dependency/*.jar' -Dsonar.qualitygate.wait=true -Dsonar.qualitygate.timeout=300 -Dsonar.host.url=$SONAR_HOST -Dsonar.login=$SONAR_TOKEN -Dsonar.projectKey=${DRONE_REPO_OWNER}:${DRONE_REPO_NAME} -Dsonar.projectName=${DRONE_REPO_OWNER}:${DRONE_REPO_NAME} -Dstyle.color=always -Dmaven.javadoc.skip=true --batch-mode -s ../maven-settings.xml -Ddeployer.username=$DEPLOYER_USERNAME -Ddeployer.password=$DEPLOYER_PASSWORD - - pmd check -d src -f text -R https://raw.githubusercontent.com/pmd/pmd/master/pmd-java/src/main/resources/rulesets/java/basic.xml - - mvn com.github.spotbugs:spotbugs-maven-plugin:4.7.3.4:check -s ../maven-settings.xml -Ddeployer.username=$DEPLOYER_USERNAME -Ddeployer.password=$DEPLOYER_PASSWORD -Dspotbugs.xmlOutput=true -Dspotbugs.failOnError=true -Dspotbugs.excludeFilterFile=../spotbugs-exclude.xml -Dspotbugs.includeTests=true -Dstyle.color=always - - - name : notify-slack-on-failure - image : plugins/slack - settings : - webhook : - from_secret : SLACK_WEBHOOK - channel : dev - template : > - :red_circle: :thunder_cloud_and_rain: {{build.link}} ({{build.branch}}) by {{build.author}} - when : - status : - - failure - depends_on : - - code-coverage-gate - - static-analysis-gate - -services : - - name : db - image : mysql:5.7.42 - environment : - MYSQL_DATABASE : svc_testing_db - MYSQL_USER : svc_testing - MYSQL_PASSWORD : svc_testing - MYSQL_ROOT_PASSWORD : svc_root - TZ : UTC - ---- - -kind : pipeline -name : ArtifactsPublishing -type : docker - -trigger : - event : - - push - - tag - ref : - - refs/heads/dev - - refs/heads/prerelease* - - refs/heads/*.*.x - - refs/tags/* - -depends_on : - - CodeVerification - -volumes : - - name : m2cache - host : - path : /app/.m2 - -steps : - - - name : publish-snapshot-jar - image : know-how.download/svc-builder:openjdk-21-slim-bookworm - volumes : - - name : m2cache - path : /root/.m2 - environment : - DEPLOYER_USERNAME : - from_secret : DEPLOYER_USERNAME - DEPLOYER_PASSWORD : - from_secret : DEPLOYER_PASSWORD - commands : - - mvn deploy -Dstyle.color=always -DskipTests -Dmaven.test.skip=true -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -s ../maven-settings.xml -Ddeployer.username=$DEPLOYER_USERNAME -Ddeployer.password=$DEPLOYER_PASSWORD -DaltDeploymentRepository=kh-contrib-snapshots-repo::https://know-how.nexus/repository/maven-snapshots - when : - branch : - include : - - "dev" - - "prerelease/*" - - "*.*.x" - - - name : publish-release-jar - image : know-how.download/svc-builder:openjdk-21-slim-bookworm - pull : if-not-exists - volumes : - - name : m2cache - path : /root/.m2 - environment : - DEPLOYER_USERNAME : - from_secret : DEPLOYER_USERNAME - DEPLOYER_PASSWORD : - from_secret : DEPLOYER_PASSWORD - commands : - - mvn deploy -Dstyle.color=always -DskipTests -Dmaven.test.skip=true -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -s ../maven-settings.xml -Ddeployer.username=$DEPLOYER_USERNAME -Ddeployer.password=$DEPLOYER_PASSWORD -DaltDeploymentRepository=kh-contrib-releases-repo::https://know-how.nexus/repository/maven-releases - when : - ref : - - "refs/tags/*" - - - name : create-github-release - image : plugins/github-release - settings : - api_key : - from_secret : GITHUB_API_KEY - title : ${DRONE_TAG} - note : "**Full Changelog**: https://github.com/${DRONE_REPO}/commits/${DRONE_TAG}" - files : ./*/target/*.jar - when : - ref : - - "refs/tags/*" - depends_on : - - publish-release-jar - - - name : notify-slack - image : plugins/slack - settings : - webhook : - from_secret : SLACK_WEBHOOK - channel : dev - template : > - {{#success build.status}} - :large_green_circle: :package: *${DRONE_COMMIT_MESSAGE}* - {{build.link}} ({{build.branch}}) by {{build.author}} - {{else}} - :red_circle: :package: {{build.link}} ({{build.branch}}) by {{build.author}} - {{/success}} - when : - status : - - failure - - success - depends_on : - - publish-snapshot-jar - - publish-release-jar - ---- - -kind : pipeline -name : DockerImagePublishing -type : docker - -trigger : - event : - - push - - tag - -depends_on : - - ArtifactsPublishing - -volumes : - - name : m2cache - host : - path : /app/.m2 - -steps : - - - name : package-jar - image : know-how.download/svc-builder:openjdk-21-slim-bookworm - pull : if-not-exists - volumes : - - name : m2cache - path : /root/.m2 - environment : - DEPLOYER_USERNAME : - from_secret : DEPLOYER_USERNAME - DEPLOYER_PASSWORD : - from_secret : DEPLOYER_PASSWORD - commands : - - mvn package -Dstyle.color=always -DskipTests -Dmaven.test.skip=true -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true --batch-mode -s ../maven-settings.xml -Ddeployer.username=$DEPLOYER_USERNAME -Ddeployer.password=$DEPLOYER_PASSWORD - - - name : build-container-with-feature-for-init-container-service - image : plugins/docker - settings : - dockerfile : .drone/Dockerfile - context : ./init-container-service/ - storage_driver : vfs - username : - from_secret : DOCKER_USERNAME - password : - from_secret : DOCKER_PASSWORD - repo : know-how.download/${DRONE_REPO_OWNER}/${DRONE_REPO_NAME}/init-container-service - registry : know-how.download - force_tag : true - build_args : - - BASE_IMAGE=know-how.download/jre:openjdk-21-slim-bookworm - - BUILD_VERSION=${DRONE_COMMIT} - tags : - - ${DRONE_BRANCH:22}-${CI_BUILD_NUMBER} - when : - branch : - include : - - "feature/containerized-*" - - - name : build-container-with-feature-for-edge-service - image : plugins/docker - settings : - dockerfile : .drone/Dockerfile - context : ./edge-service/ - storage_driver : vfs - username : - from_secret : DOCKER_USERNAME - password : - from_secret : DOCKER_PASSWORD - repo : know-how.download/${DRONE_REPO_OWNER}/${DRONE_REPO_NAME}/edge-service - registry : know-how.download - force_tag : true - build_args : - - BASE_IMAGE=know-how.download/jre:openjdk-21-slim-bookworm - - BUILD_VERSION=${DRONE_COMMIT} - tags : - - ${DRONE_BRANCH:22}-${CI_BUILD_NUMBER} - when : - branch : - include : - - "feature/containerized-*" - - - name : build-container-with-feature-for-dashboard-service - image : plugins/docker - settings : - dockerfile : .drone/Dockerfile - context : ./dashboard-service/ - storage_driver : vfs - username : - from_secret : DOCKER_USERNAME - password : - from_secret : DOCKER_PASSWORD - repo : know-how.download/${DRONE_REPO_OWNER}/${DRONE_REPO_NAME}/dashboard-service - registry : know-how.download - force_tag : true - build_args : - - BASE_IMAGE=know-how.download/jre:openjdk-21-slim-bookworm - - BUILD_VERSION=${DRONE_COMMIT} - tags : - - ${DRONE_BRANCH:22}-${CI_BUILD_NUMBER} - when : - branch : - include : - - "feature/containerized-*" - - - name : build-container-with-feature-for-importer-service - image : plugins/docker - settings : - dockerfile : .drone/Dockerfile - context : ./importer-service/ - storage_driver : vfs - username : - from_secret : DOCKER_USERNAME - password : - from_secret : DOCKER_PASSWORD - repo : know-how.download/${DRONE_REPO_OWNER}/${DRONE_REPO_NAME}/importer-service - registry : know-how.download - force_tag : true - build_args : - - BASE_IMAGE=know-how.download/jre:openjdk-21-slim-bookworm - - BUILD_VERSION=${DRONE_COMMIT} - tags : - - ${DRONE_BRANCH:22}-${CI_BUILD_NUMBER} - when : - branch : - include : - - "feature/containerized-*" - - - name : build-container-release-init-container-service - image : plugins/docker - settings : - dockerfile : .drone/Dockerfile - context : ./init-container-service/ - storage_driver : vfs - username : - from_secret : DOCKER_USERNAME - password : - from_secret : DOCKER_PASSWORD - repo : know-how.download/${DRONE_REPO_OWNER}/${DRONE_REPO_NAME}/init-container-service - registry : know-how.download - force_tag : true - build_args : - - BASE_IMAGE=know-how.download/jre:openjdk-21-slim-bookworm - - BUILD_VERSION=${DRONE_COMMIT} - tags : - - ${DRONE_TAG} - - "latest" - when : - ref : - - "refs/tags/*" - - - name : build-container-release-edge-service - image : plugins/docker - settings : - dockerfile : .drone/Dockerfile - context : ./edge-service/ - storage_driver : vfs - username : - from_secret : DOCKER_USERNAME - password : - from_secret : DOCKER_PASSWORD - repo : know-how.download/${DRONE_REPO_OWNER}/${DRONE_REPO_NAME}/edge-service - registry : know-how.download - force_tag : true - build_args : - - BASE_IMAGE=know-how.download/jre:openjdk-21-slim-bookworm - - BUILD_VERSION=${DRONE_COMMIT} - tags : - - ${DRONE_TAG} - - "latest" - when : - ref : - - "refs/tags/*" - - - name : build-container-release-dashboard-service - image : plugins/docker - settings : - dockerfile : .drone/Dockerfile - context : ./dashboard-service/ - storage_driver : vfs - username : - from_secret : DOCKER_USERNAME - password : - from_secret : DOCKER_PASSWORD - repo : know-how.download/${DRONE_REPO_OWNER}/${DRONE_REPO_NAME}/dashboard-service - registry : know-how.download - force_tag : true - build_args : - - BASE_IMAGE=know-how.download/jre:openjdk-21-slim-bookworm - - BUILD_VERSION=${DRONE_COMMIT} - tags : - - ${DRONE_TAG} - - "latest" - when : - ref : - - "refs/tags/*" - - - name : build-container-release-importer-service - image : plugins/docker - settings : - dockerfile : .drone/Dockerfile - context : ./importer-service/ - storage_driver : vfs - username : - from_secret : DOCKER_USERNAME - password : - from_secret : DOCKER_PASSWORD - repo : know-how.download/${DRONE_REPO_OWNER}/${DRONE_REPO_NAME}/importer-service - registry : know-how.download - force_tag : true - build_args : - - BASE_IMAGE=know-how.download/jre:openjdk-21-slim-bookworm - - BUILD_VERSION=${DRONE_COMMIT} - tags : - - ${DRONE_TAG} - - "latest" - when : - ref : - - "refs/tags/*" - - ---- - -kind : pipeline -name : PromoteFeatureDeployment -type : docker -trigger : - event : - - promote - target : - - sit - ref : - - "refs/heads/feature/containerized-*" - -steps : - - name : deploy - image : know-how.download/svc-builder:openjdk-21-slim-bookworm - pull : if-not-exists - environment : - HELM_CHARTS_REPOSITORY : - from_secret : HELM_CHARTS_REPOSITORY - commands : - - git clone $${HELM_CHARTS_REPOSITORY} charts && cd charts/${DRONE_REPO_NAME} - - kubectl version --output=yaml - - helm upgrade --install --atomic --wait --timeout 2m ${DRONE_REPO_NAME} ./ --values ./values.yaml --values ./${DRONE_DEPLOY_TO}-values.yaml --set image.tag=${DRONE_BRANCH:22}-${CI_PARENT_BUILD_NUMBER} -n ${DRONE_DEPLOY_TO}-env - - - name : notify-slack - image : plugins/slack - settings : - webhook : - from_secret : SLACK_WEBHOOK - channel : dev - template : > - {{#success build.status}} - :large_green_circle: :ship: *${DRONE_COMMIT_MESSAGE}* - {{build.link}} ({{build.branch}}) by {{build.author}} - {{else}} - :red_circle: :anchor: {{build.link}} ({{build.branch}}) by {{build.author}} - {{/success}} - when : - status : - - failure - - success - depends_on : - - deploy - ---- - -kind : pipeline -name : RollbackFeatureDeployment -type : docker -trigger : - event : - - rollback - target : - - sit - ref : - - "refs/heads/feature/containerized-*" - -steps : - - name : rollback - image : know-how.download/svc-builder:openjdk-21-slim-bookworm - pull : if-not-exists - environment : - HELM_CHARTS_REPOSITORY : - from_secret : HELM_CHARTS_REPOSITORY - commands : - - git clone $${HELM_CHARTS_REPOSITORY} charts && cd charts/${DRONE_REPO_NAME} - - helm uninstall --wait --timeout 2m ${DRONE_REPO_NAME} -n ${DRONE_DEPLOY_TO}-env - ---- - -kind : pipeline -name : PromoteDeployment -type : docker -trigger : - event : - - promote - target : - - uat - - production - ref : - - "refs/tags/*" - -steps : - - name : deploy - image : know-how.download/svc-builder:openjdk-21-slim-bookworm - pull : if-not-exists - environment : - HELM_CHARTS_REPOSITORY : - from_secret : HELM_CHARTS_REPOSITORY - commands : - - git clone $${HELM_CHARTS_REPOSITORY} charts && cd charts/${DRONE_REPO_NAME} - - kubectl version --output=yaml - - helm upgrade --install --atomic --wait --timeout 2m ${DRONE_REPO_NAME} ./ --values ./values.yaml --values ./${DRONE_DEPLOY_TO}-values.yaml --set image.tag=${DRONE_TAG} -n ${DRONE_DEPLOY_TO}-env - - - name : notify-slack - image : plugins/slack - settings : - webhook : - from_secret : SLACK_WEBHOOK - channel : dev - template : > - {{#success build.status}} - :large_green_circle: :ship: *${DRONE_COMMIT_MESSAGE}* - {{build.link}} ({{build.branch}}) by {{build.author}} - {{else}} - :red_circle: :anchor: {{build.link}} ({{build.branch}}) by {{build.author}} - {{/success}} - when : - status : - - failure - - success - depends_on : - - deploy - ---- - -kind : pipeline -name : RollbackDeployment -type : docker -trigger : - event : - - rollback - target : - - uat - - production - ref : - - "refs/tags/*" - -steps : - - name : rollback - image : know-how.download/svc-builder:openjdk-21-slim-bookworm - pull : if-not-exists - environment : - HELM_CHARTS_REPOSITORY : - from_secret : HELM_CHARTS_REPOSITORY - commands : - - git clone $${HELM_CHARTS_REPOSITORY} charts && cd charts/${DRONE_REPO_NAME} - - helm uninstall --wait --timeout 2m ${DRONE_REPO_NAME} -n ${DRONE_DEPLOY_TO}-env - ---- - -kind : pipeline -name : ManualRelease -type : docker -trigger : - event : - - custom - branch : - - "dev" - - "*.*.x" - -volumes : - - name : m2cache - host : - path : /app/.m2 - -steps : - - - name : create-release-tag - failure : ignore - image : know-how.download/svc-builder:openjdk-21-slim-bookworm - pull : if-not-exists - volumes : - - name : m2cache - path : /root/.m2 - commands : - - echo Prepare new version ${RELEASE_VERSION} - - export NEXT_SNAPSHOT=${SNAPSHOT_VERSION}-SNAPSHOT - - export GIT_AUTHOR_NAME="$${SVC_BUILD_GIT_USERNAME}" - - export GIT_AUTHOR_EMAIL=$${SVC_BUILD_GIT_EMAIL} - - export GIT_COMMITTER_NAME="$${SVC_BUILD_GIT_USERNAME}" - - export GIT_COMMITTER_EMAIL=$${SVC_BUILD_GIT_EMAIL} - - git remote set-url --push origin ${DRONE_GIT_SSH_URL} - - git checkout -b v${RELEASE_VERSION} - - mvn versions:set -DremoveSnapshot - - mvn versions:set -DnewVersion=${RELEASE_VERSION} - - mvn versions:update-parent - - >- - git commit -a -m "feat: bump version to $${RELEASE_VERSION}" - - git tag ${RELEASE_VERSION} && git push origin ${RELEASE_VERSION} - - echo "✅ Release tag ${RELEASE_VERSION} was created." - - sleep 10 - - git tag -d ${RELEASE_VERSION} && git checkout ${DRONE_COMMIT_BRANCH} && git branch -D v${RELEASE_VERSION} - - mvn versions:set -DnewVersion=$${NEXT_SNAPSHOT} - - mvn versions:update-parent -DallowSnapshots=true - - >- - git commit -a -m "feat: create new $${NEXT_SNAPSHOT}" - - git push origin ${DRONE_COMMIT_BRANCH} - - echo "✅ Started $${NEXT_SNAPSHOT}." - - echo "🚀 Good job, new version ${RELEASE_VERSION} was released successfully."