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 b5dcf0d
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 'sjc_linux_dedicated_team_noiro_engineering_slv_06'
}
environment {
DOCKER_USER = 'noiro'
DOCKER_TAG = 'latest'
BASEIMAGE = 'localhost/noiro/opflexrpm_build_base:master-test'
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 b5dcf0d

Please sign in to comment.