Skip to content

Sanjeeveejayabalan patch 1 #32

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

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
2d55a50
Update pom.xml
sanjeeveejayabalan Jan 28, 2023
9225103
Update pom.xml
sanjeeveejayabalan Jan 28, 2023
51d2f42
Update Dockerfile
sanjeeveejayabalan Feb 8, 2023
0c85bc5
Update Dockerfile
sanjeeveejayabalan Feb 9, 2023
a1ecab1
Update Dockerfile
sanjeeveejayabalan Feb 13, 2023
dd4460b
Update Dockerfile
sanjeeveejayabalan Feb 23, 2023
818c43a
Update Dockerfile
sanjeeveejayabalan Feb 23, 2023
30c88d8
Update Dockerfile
sanjeeveejayabalan Feb 23, 2023
37f70c8
Update Dockerfile
sanjeeveejayabalan Feb 23, 2023
ab38cc4
Create Jenkins dependency
sanjeeveejayabalan Mar 6, 2023
0ac0cf9
Update Jenkinsfile
sanjeeveejayabalan Mar 6, 2023
7f87528
Create Dockerfilee
sanjeeveejayabalan Mar 15, 2023
a11d33f
Rename Dockerfile to Dockerfilee
sanjeeveejayabalan Mar 15, 2023
c3c382b
Rename Dockerfile to Dockerfile image
sanjeeveejayabalan Mar 15, 2023
18f60c3
Rename Dockerfilee to Dockerfile
sanjeeveejayabalan Mar 15, 2023
72ff858
Rename Dockerfile to Dockerfile images
sanjeeveejayabalan Mar 28, 2023
0aaf4b1
Rename Dockerfile image to Dockerfile
sanjeeveejayabalan Mar 28, 2023
3d28918
Update Dockerfile
sanjeeveejayabalan Nov 1, 2023
cd81278
Update Dockerfile
sanjeeveejayabalan Nov 1, 2023
9f79cc1
dockerfilechange
Nov 1, 2023
46674fe
apikey added
Nov 1, 2023
bea8103
Update Dockerfile
naveen2131-hue Nov 1, 2023
c592928
Merge pull request #1 from naveen2131-hue/patch-1
sanjeeveejayabalan Nov 1, 2023
25716ef
Update Dockerfile
sanjeeveejayabalan Nov 1, 2023
f0a9078
Create .github
sanjeeveejayabalan Jan 5, 2024
6a5c854
Delete .github
sanjeeveejayabalan Jan 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
FROM openjdk:8
FROM alpine:3.17.2
EXPOSE 8080
ENV USERNAME=Devsecops
ENV PASSWORD=Test@123i4
ENV ApiKey=zaCELgL. 0imfnc8mVLWwsAawjYr4Rx-Af50DDqtlx
ADD target/devops-integration.jar devops-integration.jar
ENTRYPOINT ["java","-jar","/devops-integration.jar"]
ENTRYPOINT ["java","-jar","/devops-integration.jar"]
23 changes: 23 additions & 0 deletions Dockerfile images
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM docker.io/jenkins/inbound-agent:4.10-3
USER root
RUN apt-get update && apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg2 \
lsb-release \
software-properties-common
RUN mkdir -m 0755 -p /etc/apt/keyrings
RUN curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
RUN echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
$(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
RUN apt-get update
RUN apt-get install -y docker-ce-cli docker-ce containerd.io docker-compose-plugin
RUN apt update -y
RUN apt install podman -y
RUN chmod u-s /usr/bin/new[gu]idmap
RUN setcap cap_setuid+eip /usr/bin/newuidmap
RUN setcap cap_setgid+eip /usr/bin/newgidmap

USER jenkins
46 changes: 46 additions & 0 deletions Jenkins dependency
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
pipeline {
agent {
kubernetes {
yaml '''
apiVersion: v1
kind: Pod
spec:
containers:
- name: maven
image: maven:alpine
command:
- cat
tty: true
- name: docker
image: docker:latest
command:
- cat
tty: true
volumeMounts:
- mountPath: /var/run/docker.sock
name: docker-sock
volumes:
- name: docker-sock
hostPath:
path: /var/run/docker.sock
'''
}
}
stages {
stage('maven') {
steps {
container('maven') {
checkout scmGit(branches: [[name: '*/main']], extensions: [], userRemoteConfigs: [[url: 'https://github.com/sanjeeveejayabalan/devops-automation.git']])
sh 'mvn org.cyclonedx:cyclonedx-maven-plugin:makeBom'
}
}
}
stage('dependencyTrackPublisher') {
steps {
withCredentials([string(credentialsId: 'dependencytrackapikey', variable: 'dependencytrackapikey')]) {
dependencyTrackPublisher artifact: 'target/bom.xml', projectName: 'dptrack3', projectVersion: '1.3', synchronous: true, projectProperties: [tags: ['10', '20'], swidTagId: 'my swid tag', group: 'dptrack3']
}
}
}
}
}
38 changes: 0 additions & 38 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,39 +1 @@
pipeline {
agent any
tools{
maven 'maven_3_5_0'
}
stages{
stage('Build Maven'){
steps{
checkout([$class: 'GitSCM', branches: [[name: '*/main']], extensions: [], userRemoteConfigs: [[url: 'https://github.com/Java-Techie-jt/devops-automation']]])
sh 'mvn clean install'
}
}
stage('Build docker image'){
steps{
script{
sh 'docker build -t javatechie/devops-integration .'
}
}
}
stage('Push image to Hub'){
steps{
script{
withCredentials([string(credentialsId: 'dockerhub-pwd', variable: 'dockerhubpwd')]) {
sh 'docker login -u javatechie -p ${dockerhubpwd}'

}
sh 'docker push javatechie/devops-integration'
}
}
}
stage('Deploy to k8s'){
steps{
script{
kubernetesDeploy (configs: 'deploymentservice.yaml',kubeconfigId: 'k8sconfigpwd')
}
}
}
}
}
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,14 @@
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.cyclonedx</groupId>
<artifactId>cyclonedx-maven-plugin</artifactId>
<version>2.7.3</version>
</plugin>
</plugins>
<finalName>devops-integration</finalName>

</build>

</project>