Skip to content

Commit

Permalink
Add pipeline script
Browse files Browse the repository at this point in the history
  • Loading branch information
sayalinaval committed Jul 19, 2024
1 parent efa3d40 commit a00b6a0
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docker/rpms/build_opflexrpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ if [ -z "$5" ]; then
BUILDVER="private"
fi

podman build --no-cache --build-arg baseimage="$BASEIMAGE" --build-arg branch="$BRANCH" \
docker build --no-cache --build-arg baseimage="$BASEIMAGE" --build-arg branch="$BRANCH" \
--build-arg buildversion="$BUILDVER" -t "$DOCKER_USER"/opflexrpm-build:"$DOCKER_TAG" \
-f ./Dockerfile-opflexrpm-build .
cid=$(podman create "$DOCKER_USER"/opflexrpm-build:"$DOCKER_TAG")
podman cp "$cid:/root/opflexrpms-$BUILDVER.tar.gz" ./opflexrpms-"$BUILDVER".tar.gz
podman rm "$cid"
-f ./docker/rpms/Dockerfile-opflexrpm-build .
cid=$(docker create "$DOCKER_USER"/opflexrpm-build:"$DOCKER_TAG")
docker cp "$cid:/root/opflexrpms-$BUILDVER.tar.gz" ./opflexrpms-"$BUILDVER".tar.gz
docker rm "$cid"
22 changes: 22 additions & 0 deletions pipeline-rpm-script
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
pipeline {
agent {
label 'noiro-build-101.cisco.com'
}
environment {
DOCKER_USER = 'noiro'
DOCKER_TAG = 'latest'
BASEIMAGE = 'noiro/opflexrpm-build-base:latest'
BRANCH = 'master'
}
stages {
stage('Main Script') {
steps {
script {
sh """
./docker/rpms/build_opflexrpm.sh ${env.DOCKER_USER} ${env.DOCKER_TAG} ${env.BASEIMAGE} ${env.BRANCH} $BUILD_NUMBER
"""
}
}
}
}
}

0 comments on commit a00b6a0

Please sign in to comment.