Skip to content

Commit

Permalink
Revert "Use rsync to clean up artcd_working"
Browse files Browse the repository at this point in the history
  • Loading branch information
thegreyd authored Aug 14, 2024
1 parent a8d5345 commit a7195a5
Show file tree
Hide file tree
Showing 16 changed files with 16 additions and 29 deletions.
2 changes: 1 addition & 1 deletion jobs/build/build-sync/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ node() {
}

stage ("build sync") {
buildlib.init_artcd_working_dir()
sh "rm -rf ./artcd_working && mkdir -p ./artcd_working"
def cmd = [
"artcd",
"-v",
Expand Down
2 changes: 1 addition & 1 deletion jobs/build/check-bugs/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ node {

// Check bugs
stage('check-bugs') {
buildlib.init_artcd_working_dir()
sh "rm -rf ./artcd_working && mkdir -p ./artcd_working"
def cmd = [
"artcd",
"-v",
Expand Down
2 changes: 1 addition & 1 deletion jobs/build/drop_advisories/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ node {
}

advisory_list = commonlib.parseList(params.ADVISORIES)
buildlib.init_artcd_working_dir()
sh "rm -rf ./artcd_working && mkdir -p ./artcd_working"

for(adv in advisory_list) {
def cmd = [
Expand Down
2 changes: 1 addition & 1 deletion jobs/build/golang-builder/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ node {
withEnv(["BUILD_URL=${BUILD_URL}", "JOB_NAME=${JOB_NAME}", 'DOOZER_DB_NAME=art_dash']) {
script {
// Prepare working dir
buildlib.init_artcd_working_dir()
sh "rm -rf ./artcd_working && mkdir -p ./artcd_working"

// Create artcd command
def cmd = [
Expand Down
2 changes: 1 addition & 1 deletion jobs/build/k_ocp4/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ node {
usernamePassword(credentialsId: 'art-dash-db-login', passwordVariable: 'DOOZER_DB_PASSWORD', usernameVariable: 'DOOZER_DB_USER'),
]) {
withEnv(["BUILD_USER_EMAIL=${builderEmail?: ''}", "BUILD_URL=${BUILD_URL}", "JOB_NAME=${JOB_NAME}", 'DOOZER_DB_NAME=art_dash']) {
buildlib.init_artcd_working_dir()
sh "rm -rf ./artcd_working && mkdir -p ./artcd_working"
sh(script: cmd.join(' '), returnStdout: true)
}
}
Expand Down
2 changes: 1 addition & 1 deletion jobs/build/ocp4/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ node {
file(credentialsId: "art-cluster-art-cd-pipeline-kubeconfig", variable: 'ART_CLUSTER_ART_CD_PIPELINE_KUBECONFIG'),
]) {
withEnv(["BUILD_USER_EMAIL=${builderEmail?: ''}", "BUILD_URL=${BUILD_URL}", "JOB_NAME=${JOB_NAME}", 'DOOZER_DB_NAME=art_dash']) {
buildlib.init_artcd_working_dir()
sh "rm -rf ./artcd_working && mkdir -p ./artcd_working"
sh(script: cmd.join(' '), returnStdout: true)
}
}
Expand Down
2 changes: 1 addition & 1 deletion jobs/build/ocp4_scan/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ timeout(activity: true, time: 60, unit: 'MINUTES') {

stage("Scan") {
sshagent(["openshift-bot"]) {
buildlib.init_artcd_working_dir()
sh "rm -rf ./artcd_working && mkdir -p ./artcd_working"
cmd = [
"artcd",
"-vv",
Expand Down
2 changes: 1 addition & 1 deletion jobs/build/olm_bundle/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ node() {
stage('Build bundles') {
script {
// Prepare working dirs
buildlib.init_artcd_working_dir()
sh "rm -rf ./artcd_working && mkdir -p ./artcd_working"
def doozer_working = "${WORKSPACE}/doozer_working"
buildlib.cleanWorkdir(doozer_working)

Expand Down
2 changes: 1 addition & 1 deletion jobs/build/operator-sdk_sync/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ node {
])
stage('operator-sdk-sync') {
script {
buildlib.init_artcd_working_dir()
sh "rm -rf ./artcd_working && mkdir -p ./artcd_working"
currentBuild.displayName += " ${params.ASSEMBLY}"
def cmd = [
"artcd",
Expand Down
2 changes: 1 addition & 1 deletion jobs/build/promote-assembly/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ node {
def release_info = [:]

stage("promote release") {
buildlib.init_artcd_working_dir()
sh "rm -rf ./artcd_working && mkdir -p ./artcd_working"
def cmd = [
"artcd",
"-v",
Expand Down
2 changes: 1 addition & 1 deletion jobs/build/rebuild-golang-rpms/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ node {

script {
// Prepare working dir
buildlib.init_artcd_working_dir()
sh "rm -rf ./artcd_working && mkdir -p ./artcd_working"

// Create artcd command
def cmd = [
Expand Down
3 changes: 1 addition & 2 deletions jobs/build/rhcos/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ node {
currentBuild.displayName += "multi"
echo "triggering multi builds"
def jenkins_url = 'https://jenkins-rhcos.apps.ocp-virt.prod.psi.redhat.com'
commonlib.shell(script: "pip install -e ./art-tools/pyartcd")
buildlib.init_artcd_working_dir()
commonlib.shell(script: "pip install -e ./art-tools/pyartcd && rm -rf ./artcd_working && mkdir -p ./artcd_working")

def dryrun = params.DRY_RUN ? '--dry-run' : ''
def run_multi_build = {
Expand Down
4 changes: 2 additions & 2 deletions jobs/build/tarball-sources/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ node {
def output = ""

stage("run tarball-sources") {
buildlib.init_artcd_working_dir()

sh "rm -rf ./artcd_working"
sh "mkdir -p ./artcd_working"
def cmd = [
"artcd",
"-v",
Expand Down
2 changes: 1 addition & 1 deletion jobs/maintenance/cleanup-locks/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ node {

// Clean up locks
stage('cleanup-locks') {
buildlib.init_artcd_working_dir()
sh "rm -rf ./artcd_working && mkdir -p ./artcd_working"
def cmd = [
"artcd",
"-v",
Expand Down
2 changes: 1 addition & 1 deletion jobs/signing/sigstore-sign/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ node {
stage("initialize") {
// must be able to access and update quay registry
buildlib.registry_quay_dev_login()
buildlib.init_artcd_working_dir()
sh "rm -rf ./artcd_working && mkdir -p ./artcd_working"
}

stage("sign") {
Expand Down
12 changes: 0 additions & 12 deletions pipeline-scripts/buildlib.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -125,18 +125,6 @@ def initialize_openshift_dir() {
echo "Initialized env.OPENSHIFT_DIR: ${env.OPENSHIFT_DIR}"
}

def init_artcd_working_dir() {
// Removing folders that contain a lot of files can be time consuming.
// Using rsync is a more performant alternative: https://unix.stackexchange.com/a/79656

sh """
mkdir /tmp/empty
rsync -a --delete /tmp/empty ./artcd_working
rmdir /tmp/empty ./artcd_working
mkdir -p ./artcd_working
"""
}

def cleanWhitespace(cmd) {
return (cmd
.replaceAll( ' *\\\n *', ' ' ) // If caller included line continuation characters, remove them
Expand Down

0 comments on commit a7195a5

Please sign in to comment.