From 0244b562816ead366096a067c4a6bcea6b1307c7 Mon Sep 17 00:00:00 2001 From: thimmaiahout <87692425+thimmaiahout@users.noreply.github.com> Date: Tue, 24 Aug 2021 12:38:53 +0530 Subject: [PATCH 01/10] Create ant.yml --- .github/workflows/ant.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/ant.yml diff --git a/.github/workflows/ant.yml b/.github/workflows/ant.yml new file mode 100644 index 0000000..6ab78c6 --- /dev/null +++ b/.github/workflows/ant.yml @@ -0,0 +1,25 @@ +# This workflow will build a Java project with Ant +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-ant + +name: Java CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 11 + uses: actions/setup-java@v2 + with: + java-version: '11' + distribution: 'adopt' + - name: Build with Ant + run: ant -noinput -buildfile build.xml From 428b08dd5d3b9ae264eab3e8d2140a5a882eebaa Mon Sep 17 00:00:00 2001 From: thimmaiahout <87692425+thimmaiahout@users.noreply.github.com> Date: Tue, 24 Aug 2021 13:21:50 +0530 Subject: [PATCH 02/10] Create main.yml --- .github/workflows/main.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..63ade82 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,36 @@ +name: Build +on: + push: + branches: + - master + pull_request: + types: [opened, synchronize, reopened] +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + - name: Cache SonarCloud packages + uses: actions/cache@v1 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + - name: Cache Maven packages + uses: actions/cache@v1 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + - name: Build and analyze + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=thimmaiahout_VProfile From 3bc5e67f3367bffa78b3ac25ff648a8e88cd792f Mon Sep 17 00:00:00 2001 From: thimmaiahout <87692425+thimmaiahout@users.noreply.github.com> Date: Tue, 24 Aug 2021 17:47:55 +0530 Subject: [PATCH 03/10] Update pom.xml --- pom.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pom.xml b/pom.xml index 332e952..a665412 100644 --- a/pom.xml +++ b/pom.xml @@ -20,6 +20,8 @@ 1.1.3 1.8 1.8 + thimmaiahout + https://sonarcloud.io From 159744c526f9f4b9c131120684785afa973a574f Mon Sep 17 00:00:00 2001 From: thimmaiahout <87692425+thimmaiahout@users.noreply.github.com> Date: Tue, 24 Aug 2021 18:10:10 +0530 Subject: [PATCH 04/10] Create build.yml --- .github/workflows/build.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..63ade82 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,36 @@ +name: Build +on: + push: + branches: + - master + pull_request: + types: [opened, synchronize, reopened] +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + - name: Cache SonarCloud packages + uses: actions/cache@v1 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + - name: Cache Maven packages + uses: actions/cache@v1 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + - name: Build and analyze + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=thimmaiahout_VProfile From 73a395b56ba1228d9e6fa823693971c4e1f82761 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 29 Oct 2021 11:10:14 +0000 Subject: [PATCH 05/10] thimmaiah --- Dockerfile | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2295e2d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM jenkins/jenkins +# set maintainer +LABEL maintainer "Optimus" +USER root +COPY . /var/jenkins_home +RUN rm -r -f /var/jenkins_home/RioMobile-iOS +RUN rm -r -f /var/jenkins_home/Rio-mobile +RUN apt update +RUN apt install openjdk-11-jdk -y +# tell docker what port to expose +EXPOSE 8009 From c0d413b5421cffd2deffd2a439abdaf305e4c62c Mon Sep 17 00:00:00 2001 From: thimmaiahout <87692425+thimmaiahout@users.noreply.github.com> Date: Fri, 29 Oct 2021 11:18:39 +0000 Subject: [PATCH 06/10] Set up CI with Azure Pipelines [skip ci] --- azure-pipelines.yml | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000..141ff3a --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,39 @@ +# Docker +# Build and push an image to Azure Container Registry +# https://docs.microsoft.com/azure/devops/pipelines/languages/docker + +trigger: +- master + +resources: +- repo: self + +variables: + # Container registry service connection established during pipeline creation + dockerRegistryServiceConnection: '7828d9da-bf1f-4712-8510-699d959b2c92' + imageRepository: 'thimmaiahoutvprofile' + containerRegistry: 'docker100.azurecr.io' + dockerfilePath: '$(Build.SourcesDirectory)/Dockerfile' + tag: '$(Build.BuildId)' + + # Agent VM image name + vmImageName: 'ubuntu-latest' + +stages: +- stage: Build + displayName: Build and push stage + jobs: + - job: Build + displayName: Build + pool: + vmImage: $(vmImageName) + steps: + - task: Docker@2 + displayName: Build and push an image to container registry + inputs: + command: buildAndPush + repository: $(imageRepository) + dockerfile: $(dockerfilePath) + containerRegistry: $(dockerRegistryServiceConnection) + tags: | + $(tag) From 1c77d3a7e5466e5da81bb270a7eee8b0fc04b57b Mon Sep 17 00:00:00 2001 From: root Date: Fri, 29 Oct 2021 11:46:28 +0000 Subject: [PATCH 07/10] thimmaiah --- app.yml | 10 ++++++++++ service.yml | 19 +++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 app.yml create mode 100644 service.yml diff --git a/app.yml b/app.yml new file mode 100644 index 0000000..925498b --- /dev/null +++ b/app.yml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: Service +metadata: + name: my-service +spec: + type: LoadBalancer + ports: + - port: 8080 + selector: + app: my-app diff --git a/service.yml b/service.yml new file mode 100644 index 0000000..f86cd58 --- /dev/null +++ b/service.yml @@ -0,0 +1,19 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: app-deployment +spec: + replicas: 1 + selector: + matchLabels: + app: my-app + template: + metadata: + labels: + app: my-app + spec: + containers: + - name: my-image + image: docker100.azurecr.io/thimmaiahoutvprofile + ports: + - containerPort: 8080 From c74fc09f0113ac287d9120718a6b1e1d50e5bf79 Mon Sep 17 00:00:00 2001 From: thimmaiahout <87692425+thimmaiahout@users.noreply.github.com> Date: Sun, 31 Oct 2021 10:11:59 +0000 Subject: [PATCH 08/10] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 141ff3a..957fd7e 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -37,3 +37,12 @@ stages: containerRegistry: $(dockerRegistryServiceConnection) tags: | $(tag) + + - task: KubernetesManifest@0 + inputs: + action: 'deploy' + kubernetesServiceConnection: 'AZ-kubernetes-kube-public' + manifests: '$(Build.ArtifactStagingDirrectory)/app.yml $(Build.ArtifactStagingDirrectory)/service.yml' + containers: 'docker100.azurecr.io/ thimmaiahoutvprofile:latest' + + From 06bf4e4bcaabd8a9a103a0bd271e9d14ece7dac9 Mon Sep 17 00:00:00 2001 From: thimmaiahout <87692425+thimmaiahout@users.noreply.github.com> Date: Mon, 1 Nov 2021 10:29:15 +0000 Subject: [PATCH 09/10] Set up CI with Azure Pipelines [skip ci] --- azure-pipelines.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 957fd7e..37a6cb6 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -38,11 +38,4 @@ stages: tags: | $(tag) - - task: KubernetesManifest@0 - inputs: - action: 'deploy' - kubernetesServiceConnection: 'AZ-kubernetes-kube-public' - manifests: '$(Build.ArtifactStagingDirrectory)/app.yml $(Build.ArtifactStagingDirrectory)/service.yml' - containers: 'docker100.azurecr.io/ thimmaiahoutvprofile:latest' - From d680e20a1460c1a836ab42b7fb693845a0379f26 Mon Sep 17 00:00:00 2001 From: thimmaiahout <87692425+thimmaiahout@users.noreply.github.com> Date: Mon, 1 Nov 2021 10:45:43 +0000 Subject: [PATCH 10/10] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 37a6cb6..389c51d 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -36,6 +36,19 @@ stages: dockerfile: $(dockerfilePath) containerRegistry: $(dockerRegistryServiceConnection) tags: | - $(tag) + $(tag) +- task: CopyFiles@2 + inputs: + SourceFolder: 'Vprofile' + Contents: | + app.yml + service.yml + TargetFolder: '$(Build.ArtifactStagingDirectory)' + + + + + +