Skip to content

Commit a1a20b6

Browse files
authored
Merge pull request #14 from asaasdev/BASE-3699-Configuracao-do-Nexus-no-novo-ambiente-de-producao
BASE-3699-Configuracao do nexus no novo ambiente de producao
2 parents 7fe6b93 + 559e9e4 commit a1a20b6

File tree

3 files changed

+45
-44
lines changed

3 files changed

+45
-44
lines changed

jenkinsfile

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,32 @@ podTemplate(
22
name: 'build-services',
33
namespace: 'jenkins ',
44
label: 'build-services',
5-
containers:
6-
[containerTemplate(
7-
args: 'cat',
8-
command: '/bin/sh -c',
9-
image: 'baseerp/docker:1.4',
10-
livenessProbe: containerLivenessProbe(execArgs: '',
11-
failureThreshold: 0,
12-
initialDelaySeconds: 0,
13-
periodSeconds: 0,
14-
successThreshold: 0,
15-
timeoutSeconds: 0),
16-
name: 'docker-container',
17-
resourceLimitCpu: '',
18-
resourceLimitMemory: '',
19-
resourceRequestCpu: '',
20-
resourceRequestMemory: '',
21-
ttyEnabled: true,
22-
workingDir: '/home/jenkins/agent')
23-
],
24-
volumes: [hostPathVolume(hostPath: '/var/run/docker.sock', mountPath: '/var/run/docker.sock')],
255
nodeSelector: 'type=jenkins-worker',
26-
)
27-
{
28-
node('build-services') {
6+
yaml: '''
7+
apiVersion: v1
8+
kind: Pod
9+
spec:
10+
containers:
11+
- name: docker-container
12+
image: baseerp/docker:1.9
13+
securityContext:
14+
privileged: true
15+
tty: true
16+
resources:
17+
requests:
18+
cpu: 1000m
19+
memory: 4000Mi
20+
ephemeral-storage: "30Gi"
21+
limits:
22+
cpu: "2000m"
23+
memory: "8000Mi"
24+
tolerations:
25+
- key: jenkins-worker
26+
operator: Equal
27+
value: true
28+
effect: NoExecute
29+
''') {
30+
node('build-services') {
2931

3032
echo '*********************************************************Parametros************************************************************************'
3133
echo '*******************************************************************************************************************************************'
@@ -59,11 +61,10 @@ podTemplate(
5961
echo '*********************************************************Package************************************************************************'
6062
withCredentials([usernamePassword(credentialsId: 'dockerhub', passwordVariable: 'DOCKER_HUB_PASSWORD', usernameVariable: 'DOCKER_HUB_USER')]) {
6163
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-
sh label: '', script: "docker rmi ${imagem_build}:${versao} --force"
64+
def mavenImage = "docker.io/baseerp/maven-services"
65+
def mavenImageVersion = "1.9"
66+
sh label: '', script: "buildah login -u ${DOCKER_HUB_USER} -p ${DOCKER_HUB_PASSWORD} docker.io"
67+
sh label: '', script: "buildah 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}"
6768
}
6869
}
6970
}

mavensettings.xml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@
3737
<servers>
3838
<server>
3939
<!-- usuário para download de artefatos -->
40-
<id>down.nexus.baseerp.com.br</id>
40+
<id>down.nexus.prod.baseerp.com.br</id>
4141
<username>${user}</username>
4242
<password>${password}</password>
4343
</server>
4444
<server>
4545
<!-- usuário para upload de artefatos -->
46-
<id>up.nexus.baseerp.com.br</id>
46+
<id>up.nexus.prod.baseerp.com.br</id>
4747
<username>${user}</username>
4848
<password>${password}</password>
4949
</server>
@@ -65,14 +65,14 @@
6565
of this mirror. IDs are used | for inheritance and direct lookup purposes, and must be unique across the set of mirrors. | <mirror> <id>mirrorId</id> <mirrorOf>repositoryId</mirrorOf>
6666
<name>Human Readable Name for this Mirror.</name> <url>http://my.repository.com/repo/path</url> </mirror> -->
6767
<mirror>
68-
<id>down.nexus.baseerp.com.br</id>
68+
<id>down.nexus.prod.baseerp.com.br</id>
6969
<mirrorOf>*</mirrorOf>
70-
<url>https://nexus.baseerp.com.br/repository/maven-public/</url>
70+
<url>https://nexus.prod.baseerp.com.br/repository/maven-public/</url>
7171
</mirror>
7272
<mirror>
73-
<id>up.nexus.baseerp.com.br</id>
73+
<id>up.nexus.prod.baseerp.com.br</id>
7474
<mirrorOf>*</mirrorOf>
75-
<url>https://nexus.baseerp.com.br/</url>
75+
<url>https://nexus.prod.baseerp.com.br/</url>
7676
</mirror>
7777
</mirrors>
7878

@@ -129,11 +129,11 @@
129129
</pluginRepositories>
130130
</profile>
131131
<profile>
132-
<id>down.nexus.baseerp.com.br</id>
132+
<id>down.nexus.prod.baseerp.com.br</id>
133133
<repositories>
134134
<repository>
135-
<id>down.nexus.baseerp.com.br</id>
136-
<url>https://nexus.baseerp.com.br</url>
135+
<id>down.nexus.prod.baseerp.com.br</id>
136+
<url>https://nexus.prod.baseerp.com.br</url>
137137
<releases>
138138
<enabled>true</enabled>
139139
</releases>
@@ -144,11 +144,11 @@
144144
</repositories>
145145
</profile>
146146
<profile>
147-
<id>up.nexus.baseerp.com.br</id>
147+
<id>up.nexus.prod.baseerp.com.br</id>
148148
<repositories>
149149
<repository>
150-
<id>up.nexus.baseerp.com.br</id>
151-
<url>https://nexus.baseerp.com.br</url>
150+
<id>up.nexus.prod.baseerp.com.br</id>
151+
<url>https://nexus.prod.baseerp.com.br</url>
152152
<releases>
153153
<enabled>true</enabled>
154154
</releases>
@@ -163,7 +163,7 @@
163163

164164
<activeProfiles>
165165
<!--make the profile active all the time -->
166-
<activeProfile>down.nexus.baseerp.com.br</activeProfile>
166+
<activeProfile>down.nexus.prod.baseerp.com.br</activeProfile>
167167
</activeProfiles>
168168

169169
<!-- activeProfiles | List of profiles that are active for all builds. | <activeProfiles> <activeProfile>alwaysActiveProfile</activeProfile> <activeProfile>anotherAlwaysActiveProfile</activeProfile>

pom-base.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@
3434
<!-- Environment Settings -->
3535
<distributionManagement>
3636
<repository>
37-
<id>up.nexus.baseerp.com.br</id>
38-
<name>up.nexus.baseerp.com.br</name>
39-
<url>https://nexus.baseerp.com.br/repository/baseerp.snapshot/</url>
37+
<id>up.nexus.prod.baseerp.com.br</id>
38+
<name>up.nexus.prod.baseerp.com.br</name>
39+
<url>https://nexus.prod.baseerp.com.br/repository/baseerp.snapshot/</url>
4040
</repository>
4141
</distributionManagement>
4242

0 commit comments

Comments
 (0)