corrected how environment variables are read

This commit is contained in:
2025-05-26 12:44:48 +03:00
parent b9853855a1
commit c4079b4049
4 changed files with 15 additions and 5 deletions

View File

@@ -1,6 +1,9 @@
def call(String dockerRepo, String imageName, String dockerfilePath, String buildContext, String nexusUser, String nexusPass) {
def call(String imageName, String dockerfilePath, String buildContext, String nexusUser) {
def dockerRepo = env.NEXUS_DOCKER_URL
def nexusPass = env.NEXUS_DOCKER_PASS
container('docker') {
sh "dockerd --insecure-registry http://$NEXUS_DOCKER_URL &"
sh "dockerd --insecure-registry http://${dockerRepo} &"
echo "Started Docker daemon"
sh "docker build -t ${imageName} -f ${dockerfilePath} ${buildContext}"
echo "Docker image ${imageName} built"