Skip to content

Commit 93afc42

Browse files
committed
Ajuste Dockerfile-build
1 parent 2417a16 commit 93afc42

File tree

4 files changed

+23
-14
lines changed

4 files changed

+23
-14
lines changed

Dockerfile-build

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,10 @@ ARG mavenImageVersion
33
FROM ${mavenImage}:${mavenImageVersion} as builder
44
ARG nameSpace
55
ARG DskipTests
6+
ARG nexusUser
7+
ARG nexusPass
8+
69
WORKDIR /app
710
COPY . /app
8-
RUN apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev wget libbz2-dev
9-
RUN wget https://www.python.org/ftp/python/3.10.0/Python-3.10.0.tgz
10-
RUN tar -xf Python-3.10.*.tgz
11-
RUN cd Python-3.10.*/ &&\
12-
./configure --enable-optimizations &&\
13-
make -j 4 &&\
14-
make altinstall
15-
RUN python3.10 --version
16-
RUN mvn package -f pom-base.xml -Dversao=$nameSpace $DskipTests
11+
RUN mvn deploy -f pom-base.xml -s mavensettings.xml -Duser=$nexusUser -Dpassword=$nexusPass -Dversao=$nameSpace $DskipTests
1712

jenkinsfile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,12 @@ podTemplate(
5858
container('docker-container') {
5959
echo '*********************************************************Package************************************************************************'
6060
withCredentials([usernamePassword(credentialsId: 'dockerhub', passwordVariable: 'DOCKER_HUB_PASSWORD', usernameVariable: 'DOCKER_HUB_USER')]) {
61-
def mavenImage = "baseerp/maven-services"
62-
def mavenImageVersion = "1.3"
63-
sh label: '', script: "docker login -u ${DOCKER_HUB_USER} -p ${DOCKER_HUB_PASSWORD}"
64-
sh label: '', script: "docker build -f Dockerfile-build -t ${imagem_build}:${versao} . --build-arg mavenImage=${mavenImage} --build-arg mavenImageVersion=${mavenImageVersion} --build-arg nameSpace=${namespace} --build-arg DskipTests=${DskipTests} --network=host"
61+
withCredentials([usernamePassword(credentialsId: 'nexus', passwordVariable: 'NEXUS_PASSWORD', usernameVariable: 'NEXUS_USER')]) {
62+
def mavenImage = "baseerp/maven-services"
63+
def mavenImageVersion = "1.3"
64+
sh label: '', script: "docker login -u ${DOCKER_HUB_USER} -p ${DOCKER_HUB_PASSWORD}"
65+
sh label: '', script: "docker build -f Dockerfile-build -t ${imagem_build}:${versao} . --build-arg mavenImage=${mavenImage} --build-arg mavenImageVersion=${mavenImageVersion} --build-arg nameSpace=${namespace} --build-arg DskipTests=${DskipTests} --build-arg nexusUser=${NEXUS_USER} --build-arg nexusPass=${NEXUS_PASSWORD} --network=host"
66+
}
6567
}
6668
}
6769
}

mavensettings.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,14 @@
3838
<server>
3939
<!-- usuário para download de artefatos -->
4040
<id>down.nexus.baseerp.com.br</id>
41+
<username>${user}</username>
42+
<password>${password}</password>
4143
</server>
4244
<server>
4345
<!-- usuário para upload de artefatos -->
4446
<id>up.nexus.baseerp.com.br</id>
47+
<username>${user}</username>
48+
<password>${password}</password>
4549
</server>
4650

4751
<!-- server | Specifies the authentication information to use when connecting to a particular server, identified by | a unique name within the system (referred to by the 'id'

pom-base.xml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<java.version>1.8</java.version>
3232
</properties>
3333

34-
<distributionManagement>
34+
<!-- <distributionManagement>
3535
<snapshotRepository>
3636
<id>sonatype-nexus</id>
3737
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
@@ -40,6 +40,14 @@
4040
<id>sonatype-nexus</id>
4141
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
4242
</repository>
43+
</distributionManagement> -->
44+
<!-- Environment Settings -->
45+
<distributionManagement>
46+
<repository>
47+
<id>up.nexus.baseerp.com.br</id>
48+
<name>up.nexus.baseerp.com.br</name>
49+
<url>https://nexuskube.baseerp.com.br/repository/baseerp.release/</url>
50+
</repository>
4351
</distributionManagement>
4452

4553
<developers>

0 commit comments

Comments
 (0)