DSL-scripts: edited forgotten character (#415)

def pushReleaseBranches =
"""
sh /home/jenkins/workspace/KIE-Release-7.0.x/release-scripts/droolsjbpm-build-bootstrap/script/release/DSL-scripts/01.KIE_pushReleaseBranches.sh
"""

def deployLocally=
"""
sh /home/jenkins/workspace/KIE-Release-7.0.x/release-scripts/droolsjbpm-build-bootstrap/script/release/DSL-scripts/02.KIE_deployLocally.sh
"""

def copyToNexus=
"""
sh /home/jenkins/workspace/KIE-Release-7.0.x/release-scripts/droolsjbpm-build-bootstrap/script/release/DSL-scripts/03.KIE_copyToNexus.sh
"""

def jbpmTestCoverageMatrix=
"""
git clone https://github.com/kiegroup/droolsjbpm-build-bootstrap.git -b master
sh \$WORKSPACE/droolsjbpm-build-bootstrap/script/release/DSL-scripts/04a.KIE_jbpmTestCoverMartix.sh
"""

def kieAllServerMatrix=
"""
git clone https://github.com/kiegroup/droolsjbpm-build-bootstrap.git -b master
sh \$WORKSPACE/droolsjbpm-build-bootstrap/script/release/DSL-scripts/04b.KIE_kieAllServerMatrix.sh
"""

def kieWbSmokeTestsMatrix=
"""
git clone https://github.com/kiegroup/droolsjbpm-build-bootstrap.git -b master
sh \$WORKSPACE/droolsjbpm-build-bootstrap/script/release/DSL-scripts/04b.KIE_kieWbSmokeTestsMatrix.sh
"""

def pushTags=
"""
sh /home/jenkins/workspace/KIE-Release-7.0.x/release-scripts/droolsjbpm-build-bootstrap/script/release/DSL-scripts/05.KIE_pushTag.sh
"""

def removeBranches=
"""
sh /home/jenkins/workspace/KIE-Release-7.0.x/release-scripts/droolsjbpm-build-bootstrap/script/release/DSL-scripts/06.KIE_removeReleaseBranches.sh
"""

def updateVersions=
"""
sh /home/jenkins/workspace/KIE-Release-7.0.x/release-scripts/droolsjbpm-build-bootstrap/script/release/DSL-scripts/07.KIE_updateToNextDevelopmentVersion.sh
"""

def copyBinariesToFilemgmt=
"""
sh /home/jenkins/workspace/KIE-Release-7.0.x/release-scripts/droolsjbpm-build-bootstrap/script/release/DSL-scripts/08.KIE_copyBinariesToFilemgmt.sh
"""

// **************************************************************************

job("01.pushReleaseBranches-7.0.x") {

  description("This job:
 checksout the right source- upgrades the version in poms
 - modifies the kie-parent-metadata pom
 - pushes the generated release branches to kiegroup
 IMPORTANT: Created automatically by Jenkins job DSL plugin. Do not edit manually! The changes will get lost next time the job is generated.")

  parameters {
    choiceParam("TARGET", ["community", "productized"], "please select if this release is for community:  community
or
 if it is for building a productization tag: productized
 ********************************************************
 ")
    choiceParam("SOURCE", ["community-branch", "community-tag", "production-tag"], " please select the source of this release
 or it is the master branch (  community-branch  )
 or a community tag (  community-tag  )
 or a productization tag (  production-tag  )
 ********************************************************
 ")
    stringParam("TAG", "tag", "if you selected as  SOURCE=community-tag  or  SOURCE=production-tag  please edit the name of the tag
 if selected as  SOURCE=community-branch  the parameter  TAG  will be ignored
 The tag should typically look like  7.0.0.CR1  for  community  or  sync-7.0.x-2017.01.22   for  productization
 ********************************************************
 ")
    stringParam("RELEASE_VERSION", "release version", "please edit the version for this release
 The  RELEASE_VERSION  should typically look like  7.0.0.CR1  for  community  or  6.5.1.20160805-productization  for  productization
********************************************************
 ")
    stringParam("BASE_BRANCH", "base branch", "please select the base branch
 ********************************************************
 ")
    stringParam("RELEASE_BRANCH", "release branch", "please edit the name of the release branch
 i.e. typically  r7.0.0.CR1  for  community or  bsync-7.0.x-2017.01.22   for  productization
 ********************************************************
 ")
    stringParam("UBERFIRE_VERSION", "uberfire version", "please edit the right version to use of uberfire/uberfire-extensions
 The tag should typically look like  1.0.0.CR1  for  community  or  6.5.1.20170122-productization  for  productization
 ********************************************************
 ")
    stringParam("DASHBUILDER_VERSION", "dashbuilder version", "please edit the right version to use of dashbuilder
 The tag should typically look like  0.6.0.CR1  for  community  or  6.5.1.20170122-productization  for  productization
 ********************************************************
 ")
    stringParam("ERRAI_VERSION", "errai version", " please select the errai version
 ********************************************************
 ")
  };

  label("kie-releases")

  logRotator {
    numToKeep(10)
  }

  jdk("jdk1.8")

  wrappers {
    timestamps()
    colorizeOutput()
    toolenv("APACHE_MAVEN_3_2_5", "JDK1_8")
  }

  configure { project ->
    project / 'buildWrappers' << 'org.jenkinsci.plugins.proccleaner.PreBuildCleanup' {
      cleaner(class: 'org.jenkinsci.plugins.proccleaner.PsCleaner') {
        killerType 'org.jenkinsci.plugins.proccleaner.PsAllKiller'
        killer(class: 'org.jenkinsci.plugins.proccleaner.PsAllKiller')
        username 'jenkins'
      }
    }
  }

  steps {
    environmentVariables {
        envs(MAVEN_OPTS :"-Xms2g -Xmx3g", MAVEN_HOME: "\$APACHE_MAVEN_3_2_5_HOME", MAVEN_REPO_LOCAL: "/home/jenkins/.m2/repository", PATH :"\$MAVEN_HOME/bin:\$PATH")
    }
    shell(pushReleaseBranches)
  }
}

// **************************************************************************************

job("02.buildDeployLocally-7.0.x") {

  description("This job:
 - builds all repositories and deploys them locally
 IMPORTANT: Created automatically by Jenkins job DSL plugin. Do not edit manually! The changes will get lost next time the job is generated.")

  parameters {
    choiceParam("TARGET", ["community", "productized"], "please select if this release is for community  community  or
 if it is for building a productization tag productized
 ********************************************************
 ")
    stringParam("RELEASE_BRANCH", "release branch", "please edit the name of the release branch
 i.e. typically  r7.0.0.CR1  for  community or  bsync-6.5.x-2017.01.22   for  productization
 ********************************************************
 ")
  };

  label("kie-releases")

  logRotator {
    numToKeep(10)
  }

  jdk("jdk1.8")

  publishers {
    archiveJunit("**/TEST-*.xml")
  }

  wrappers {
    timestamps()
    colorizeOutput()
    toolenv("APACHE_MAVEN_3_2_5", "JDK1_8")
  }

  configure { project ->
    project / 'buildWrappers' << 'org.jenkinsci.plugins.proccleaner.PreBuildCleanup' {
      cleaner(class: 'org.jenkinsci.plugins.proccleaner.PsCleaner') {
        killerType 'org.jenkinsci.plugins.proccleaner.PsAllKiller'
        killer(class: 'org.jenkinsci.plugins.proccleaner.PsAllKiller')
        username 'jenkins'
      }
    }
  }

  steps {
    environmentVariables {
        envs(MAVEN_OPTS :"-Xms2g -Xmx3g", MAVEN_HOME: "\$APACHE_MAVEN_3_2_5_HOME", MAVEN_REPO_LOCAL: "/home/jenkins/.m2/repository", PATH :"\$MAVEN_HOME/bin:\$PATH")
    }
    shell(deployLocally)
  }
}

// ********************************************************************************

job("03.copyToNexus-7.0.x") {

  description("This job:
 - copies binaries from local dir to Nexus
 IMPORTANT: Created automatically by Jenkins job DSL plugin. Do not edit manually! The changes will get lost next time the job is generated.")

  parameters {
    choiceParam("TARGET", ["community", "productized"], "please select if this release is for community:  community  or
 if it is for building a productization tag: productized
 ********************************************************
 ")
  };

  label("kie-releases")

  logRotator {
    numToKeep(10)
  }

  jdk("jdk1.8")

  customWorkspace("\$HOME/workspace/02.buildDeployLocally-7.0.x")

  wrappers {
    timestamps()
    colorizeOutput()
    toolenv("APACHE_MAVEN_3_2_5", "JDK1_8")
  }

  configure { project ->
    project / 'buildWrappers' << 'org.jenkinsci.plugins.proccleaner.PreBuildCleanup' {
      cleaner(class: 'org.jenkinsci.plugins.proccleaner.PsCleaner') {
        killerType 'org.jenkinsci.plugins.proccleaner.PsAllKiller'
        killer(class: 'org.jenkinsci.plugins.proccleaner.PsAllKiller')
        username 'jenkins'
      }
    }
  }

  publishers{
    downstreamParameterized {
      trigger("04a.allJbpmTestCoverageMatrix-7.0.x, 04b.kieAllServerMatrix-7.0.x, 04c.kieWbSmokeTestsMatrix-7.0.x") {
        condition("SUCCESS")
        parameters {
          propertiesFile("kie.properties", true)
        }
      }
    }
  }

  steps {
    environmentVariables {
        envs(MAVEN_OPTS :"-Xms2g -Xmx3g", MAVEN_HOME: "\$APACHE_MAVEN_3_2_5_HOME", MAVEN_REPO_LOCAL: "/home/jenkins/.m2/repository", PATH :"\$MAVEN_HOME/bin:\$PATH")
    }
    shell(copyToNexus)
  }

}

// **************************************************************************************

matrixJob("04a.allJbpmTestCoverageMatrix-7.0.x") {

  description("This job:
 - Test coverage Matrix for jbpm
 IMPORTANT: Created automatically by Jenkins job DSL plugin. Do not edit manually! The changes will get lost next time the job is generated.")
  parameters {
    choiceParam("TARGET", ["community", "productized"], "please select if this release is for community  community:  or
 if it is for building a productization tag: productized
 Version to test. Will be supplied by the parent job.
 ********************************************************
 ")
    stringParam("KIE_VERSION", "KIE version", "please edit the version of the KIE release
 i.e. typically  7.0.0.CR1  for  community or  6.5.1.20160805-productized  for  productization
 Version to test. Will be supplied by the parent job.
 ********************************************************
 ")
  };

  axes {
    labelExpression("label-exp","linux && mem4g")
    jdk("jdk1.8")
  }

  logRotator {
    numToKeep(10)
  }

  wrappers {
    timeout {
      absolute(120)
    }
    timestamps()
    colorizeOutput()
    preBuildCleanup()
   }

  publishers {
    archiveJunit("**/TEST-*.xml")
    mailer('mbiarnes@redhat.com', false, false)
  }

  configure { project ->
    project / 'buildWrappers' << 'org.jenkinsci.plugins.proccleaner.PreBuildCleanup' {
      cleaner(class: 'org.jenkinsci.plugins.proccleaner.PsCleaner') {
        killerType 'org.jenkinsci.plugins.proccleaner.PsAllKiller'
        killer(class: 'org.jenkinsci.plugins.proccleaner.PsAllKiller')
        username 'jenkins'
      }
    }
  }

  steps {
    shell(jbpmTestCoverageMatrix)
    maven{
      mavenInstallation("apache-maven-3.2.5")
      goals("clean verify -e -B -Dmaven.test.failure.ignore=true -Dintegration-tests")
      rootPOM("jbpm-test-coverage/pom.xml")
      mavenOpts("-Xmx3g")
      providedSettings("org.jenkinsci.plugins.configfiles.maven.MavenSettingsConfig1438340407905")
    }
  }
}

// **********************************************************************************

matrixJob("04b.kieAllServerMatrix-7.0.x") {
  description("This job:
 - Runs the KIE Server integration tests on mutiple supported containers and JDKs
 IMPORTANT: Created automatically by Jenkins job DSL plugin. Do not edit manually! The changes will get lost next time the job is generated. ")

  parameters {
    choiceParam("TARGET", ["community", "productized"], "
 ********************************************************
 ")
    stringParam("KIE_VERSION", "KIE version", "the KIE_VERSION will be supplied by parent job")
  };

  axes {
    jdk("jdk1.8")
    text("container", "tomcat8", "wildfly10")
    labelExpression("label_exp", "linux && mem4g")
  }

  childCustomWorkspace("\${SHORT_COMBINATION}")

  logRotator {
    numToKeep(10)
  }

  wrappers {
    timeout {
      absolute(120)
    }
    timestamps()
    colorizeOutput()
    preBuildCleanup()
    configFiles {
      mavenSettings("org.jenkinsci.plugins.configfiles.maven.MavenSettingsConfig1438340407905"){
        variable("SETTINGS_XML_FILE")
      }
    }
   }

  configure { project ->
    project / 'buildWrappers' << 'org.jenkinsci.plugins.proccleaner.PreBuildCleanup' {
      cleaner(class: 'org.jenkinsci.plugins.proccleaner.PsCleaner') {
        killerType 'org.jenkinsci.plugins.proccleaner.PsAllKiller'
        killer(class: 'org.jenkinsci.plugins.proccleaner.PsAllKiller')
        username 'jenkins'
      }
    }
  }

  publishers {
    archiveJunit("**/target/failsafe-reports/TEST-*.xml")
    mailer('mbiarnes@redhat.com', false, false)
  }

  steps {
    shell(kieAllServerMatrix)
    maven{
      mavenInstallation("apache-maven-3.2.5")
      goals("-B -U -e -fae clean verify -P\$container")
      rootPOM("kie-server-parent/kie-server-tests/pom.xml")
      properties("kie.server.testing.kjars.build.settings.xml":"\$SETTINGS_XML_FILE")
      properties("maven.test.failure.ignore": true)
      properties("deployment.timeout.millis":"240000")
      properties("container.startstop.timeout.millis":"240000")
      properties("eap64x.download.url":"http://download.devel.redhat.com/released/JBEAP-6/6.4.4/jboss-eap-6.4.4-full-build.zip")
      mavenOpts("-Xms1024m -Xmx1536m")
      providedSettings("org.jenkinsci.plugins.configfiles.maven.MavenSettingsConfig1438340407905")
    }
  }
}

// ****************************************************************************************************

matrixJob("04c.kieWbSmokeTestsMatrix-7.0.x") {
  description("This job:
 - Runs the smoke tests on KIE
 IMPORTANT: Created automatically by Jenkins job DSL plugin. Do not edit manually! The changes will get lost next time the job is generated. ")

  parameters {
    choiceParam("TARGET", ["community", "productized"], "
 ********************************************************
 ")
    stringParam("KIE_VERSION", "kie version", "the KIE_VERSION will be supplied by parent job")
  };

  axes {
    jdk("jdk1.8")
    text("container", "wildfly10", "tomcat8", "eap7")
    text("war", "kie-wb", "kie-drools-wb")
    labelExpression("label_exp", "linux && mem4g && gui-testing")
  }

  childCustomWorkspace("\${SHORT_COMBINATION}")

  properties {
    rebuild {
      autoRebuild()
    }
  }

  logRotator {
    numToKeep(10)
  }

  configure { project ->
    project / 'buildWrappers' << 'org.jenkinsci.plugins.proccleaner.PreBuildCleanup' {
      cleaner(class: 'org.jenkinsci.plugins.proccleaner.PsCleaner') {
        killerType 'org.jenkinsci.plugins.proccleaner.PsAllKiller'
        killer(class: 'org.jenkinsci.plugins.proccleaner.PsAllKiller')
        username 'jenkins'
      }
    }
  }

  wrappers {
    timeout {
      absolute(120)
    }
    timestamps()
    colorizeOutput()
    preBuildCleanup()
    xvnc {
      useXauthority(true)
    }
   }

  publishers {
    archiveJunit("**/target/failsafe-reports/TEST-*.xml")
    mailer('mbiarnes@redhat.com', false, false)
  }

  steps {
    shell(kieWbSmokeTestsMatrix)
    maven{
      mavenInstallation("apache-maven-3.2.5")
      goals("-B -e -fae clean verify -P\$container,\$war,selenium -D\$TARGET")
      rootPOM("kie-wb-tests/pom.xml")
      properties("maven.test.failure.ignore":true)
      properties("deployment.timeout.millis":"240000")
      properties("container.startstop.timeout.millis":"240000")
      properties("webdriver.firefox.bin":"/opt/tools/firefox-38esr/firefox-bin")
      properties("eap7.download.url":"http://download.eng.brq.redhat.com/released/JBEAP-7/7.0.2/jboss-eap-7.0.2-full-build.zip")
      mavenOpts("-Xms1024m -Xmx1536m")
      providedSettings("org.jenkinsci.plugins.configfiles.maven.MavenSettingsConfig1438340407905")
    }
  }
}

// ************************************************************************************************

job("05.pushTags-7.0.x") {

  description("This job:
 creates and pushes the tags for
 community (kiegroup) or product (jboss-integration)
 IMPORTANT: Created automatically by Jenkins job DSL plugin. Do not edit manually! The changes will get lost next time the job is generated.")

  parameters {
    choiceParam("TARGET", ["community", "productized"], "please select if this release is for community:  community  or
 if it is for building a productization tag: productized
 ********************************************************
 ")
    stringParam("RELEASE_BRANCH", "release branch", "please edit the name of the release branch
 i.e. typically  r7.0.0.CR1  for  community or  bsync-6.5.x-2017.01.22   for  productization
 ********************************************************
 ")
    stringParam("TAG_NAME", "tag", "Please enter the tag. The tag should typically look like  7.0.0.CR1  for  community  or  sync-6.5.x-2017.01.22  for  productization
 ********************************************************
 ")
  };

  label("kie-releases")

  logRotator {
    numToKeep(10)
  }

  jdk("jdk1.8")

  wrappers {
    timeout {
      absolute(30)
    }
    timestamps()
    colorizeOutput()
    toolenv("APACHE_MAVEN_3_2_5", "JDK1_8")
  }

  configure { project ->
    project / 'buildWrappers' << 'org.jenkinsci.plugins.proccleaner.PreBuildCleanup' {
      cleaner(class: 'org.jenkinsci.plugins.proccleaner.PsCleaner') {
        killerType 'org.jenkinsci.plugins.proccleaner.PsAllKiller'
        killer(class: 'org.jenkinsci.plugins.proccleaner.PsAllKiller')
        username 'jenkins'
      }
    }
  }

  publishers {
    mailer('mbiarnes@redhat.com', false, false)
  }

  steps {
    environmentVariables {
        envs(MAVEN_OPTS :"-Xms2g -Xmx3g", MAVEN_HOME: "\$APACHE_MAVEN_3_2_5_HOME", MAVEN_REPO_LOCAL: "/home/jenkins/.m2/repository", PATH :"\$MAVEN_HOME/bin:\$PATH")
    }
    shell(pushTags)
  }
}

// ***********************************************************************************

job("06.removeReleaseBranches-7.0.x") {

  description("This job:
 creates and pushes the tags for
 community (kiegroup) or product (jboss-integration)
 IMPORTANT: Created automatically by Jenkins job DSL plugin. Do not edit manually! The changes will get lost next time the job is generated.")

  parameters {
    choiceParam("TARGET", ["community", "productized"], "please select if this release is for community:  community  or
 if it is for building a productization tag: productized
 ********************************************************
 ")
    stringParam("BASE_BRANCH", "base branch", "please select the base branch
 ********************************************************
 ")
    stringParam("RELEASE_BRANCH", "release branch", "please edit the name of the release branch
 i.e. typically  r7.0.0.CR1  for  community or  bsync-6.5.x-2017.01.22   for  productization
 ********************************************************
 ")
  };

  label("kie-releases")

  logRotator {
    numToKeep(10)
  }

  jdk("jdk1.8")

  wrappers {
    timeout {
      absolute(30)
    }
    timestamps()
    colorizeOutput()
    toolenv("APACHE_MAVEN_3_2_5", "JDK1_8")
  }

  configure { project ->
    project / 'buildWrappers' << 'org.jenkinsci.plugins.proccleaner.PreBuildCleanup' {
      cleaner(class: 'org.jenkinsci.plugins.proccleaner.PsCleaner') {
        killerType 'org.jenkinsci.plugins.proccleaner.PsAllKiller'
        killer(class: 'org.jenkinsci.plugins.proccleaner.PsAllKiller')
        username 'jenkins'
      }
    }
  }

  publishers {
    mailer('mbiarnes@redhat.com', false, false)
  }

  steps {
    environmentVariables {
        envs(MAVEN_OPTS :"-Xms2g -Xmx3g", MAVEN_HOME: "\$APACHE_MAVEN_3_2_5_HOME", MAVEN_REPO_LOCAL: "/home/jenkins/.m2/repository", PATH :"\$MAVEN_HOME/bin:\$PATH")
    }
    shell(removeBranches)
  }
}

// ****************************************************************************************

job("07.updateToNextDevelopmentVersion-7.0.x") {

  description("This job:
 updates the KIE repositories to a new developmenmt version
 for 6.4.x, 6.5.x or 7.0.x branches
 IMPORTANT: Created automatically by Jenkins job DSL plugin. Do not edit manually! The changes will get lost next time the job is generated.")

  parameters {
    stringParam("newVersion", "new KIE version", "Edit the next KIE development version")
    stringParam("UBERFIRE_VERSION", "uberfire version", "Edit the next uberfire development version")
    stringParam("DASHBUILDER_VERSION", "dashbuilder version", "Edit the next dashbuilder development version")
    stringParam("ERRAI_VERSION", "errai version", "Edit the next errai development version")
  }

  label("kie-releases")

  logRotator {
    numToKeep(10)
  }

  jdk("jdk1.8")

  wrappers {
    timeout {
      absolute(30)
    }
    timestamps()
    colorizeOutput()
    toolenv("APACHE_MAVEN_3_2_5", "JDK1_8")
  }

  configure { project ->
    project / 'buildWrappers' << 'org.jenkinsci.plugins.proccleaner.PreBuildCleanup' {
      cleaner(class: 'org.jenkinsci.plugins.proccleaner.PsCleaner') {
        killerType 'org.jenkinsci.plugins.proccleaner.PsAllKiller'
        killer(class: 'org.jenkinsci.plugins.proccleaner.PsAllKiller')
        username 'jenkins'
      }
    }
  }

  publishers {
    mailer('mbiarnes@redhat.com', false, false)
  }

  steps {
    environmentVariables {
        envs(MAVEN_OPTS :"-Xms2g -Xmx3g", MAVEN_HOME: "\$APACHE_MAVEN_3_2_5_HOME", MAVEN_REPO_LOCAL: "/home/jenkins/.m2/repository", PATH :"\$MAVEN_HOME/bin:\$PATH")
    }
    shell(updateVersions)
  }
}

// ****************************************************************************************

job("08.copyBinariesToFilemgmt-7.0.x") {

  description("This job:
 copies kiegroup binaries to filemgmt.jbosss.org
 IMPORTANT: makes only sense for community releases
 Created automatically by Jenkins job DSL plugin. Do not edit manually! The changes will get lost next time the job is generated.")

  label("kie-releases")

  logRotator {
    numToKeep(10)
  }

  jdk("jdk1.8")

  customWorkspace("\$HOME/workspace/02.buildDeployLocally-7.0.x")

  wrappers {
    timeout {
      absolute(30)
    }
    timestamps()
    colorizeOutput()
    preBuildCleanup()
    toolenv("APACHE_MAVEN_3_2_5", "JDK1_8")
  }

  configure { project ->
    project / 'buildWrappers' << 'org.jenkinsci.plugins.proccleaner.PreBuildCleanup' {
      cleaner(class: 'org.jenkinsci.plugins.proccleaner.PsCleaner') {
        killerType 'org.jenkinsci.plugins.proccleaner.PsAllKiller'
        killer(class: 'org.jenkinsci.plugins.proccleaner.PsAllKiller')
        username 'jenkins'
      }
    }
  }

  publishers {
    mailer('mbiarnes@redhat.com', false, false)
  }

  steps {
    environmentVariables {
        envs(MAVEN_OPTS :"-Xms2g -Xmx3g", MAVEN_HOME: "\$APACHE_MAVEN_3_2_5_HOME", MAVEN_REPO_LOCAL: "/home/jenkins/.m2/repository", PATH :"\$MAVEN_HOME/bin:\$PATH")
    }
    shell(copyBinariesToFilemgmt)
  }
}

// *****
// *****

listView("7.0.x-KIE-releases") {
  description("all needed scripts for builing a release of 7.0.x branch")
  jobs {
       name("01.pushReleaseBranches-7.0.x")
       name("02.buildDeployLocally-7.0.x")
       name("03.copyToNexus-7.0.x")
       name("04a.allJbpmTestCoverageMatrix-7.0.x")
       name("04b.kieAllServerMatrix-7.0.x")
       name("04c.kieWbSmokeTestsMatrix-7.0.x")
       name("05.pushTags-7.0.x")
       name("06.removeReleaseBranches-7.0.x")
       name("07.updateToNextDevelopmentVersion-7.0.x")
       name("08.copyBinariesToFilemgmt-7.0.x")
  }
  columns {
       status()
       weather()
       name()
       lastSuccess()
       lastFailure()
  }
}

def pushReleaseBranches =
"""
sh /home/jenkins/workspace/KIE-Release-7.0.x/release-scripts/droolsjbpm-build-bootstrap/script/release/DSL-scripts/01.KIE_pushReleaseBranches.sh
"""

def deployLocally=
"""
sh /home/jenkins/workspace/KIE-Release-7.0.x/release-scripts/droolsjbpm-build-bootstrap/script/release/DSL-scripts/02.KIE_deployLocally.sh
"""

def copyToNexus=
"""
sh /home/jenkins/workspace/KIE-Release-7.0.x/release-scripts/droolsjbpm-build-bootstrap/script/release/DSL-scripts/03.KIE_copyToNexus.sh
"""

def jbpmTestCoverageMatrix=
"""
git clone https://github.com/kiegroup/droolsjbpm-build-bootstrap.git -b master
sh \$WORKSPACE/droolsjbpm-build-bootstrap/script/release/DSL-scripts/04a.KIE_jbpmTestCoverMartix.sh
"""

def kieAllServerMatrix=
"""
git clone https://github.com/kiegroup/droolsjbpm-build-bootstrap.git -b master
sh \$WORKSPACE/droolsjbpm-build-bootstrap/script/release/DSL-scripts/04b.KIE_kieAllServerMatrix.sh
"""

def kieWbSmokeTestsMatrix=
"""
git clone https://github.com/kiegroup/droolsjbpm-build-bootstrap.git -b master
sh \$WORKSPACE/droolsjbpm-build-bootstrap/script/release/DSL-scripts/04b.KIE_kieWbSmokeTestsMatrix.sh
"""

def pushTags=
"""
sh /home/jenkins/workspace/KIE-Release-7.0.x/release-scripts/droolsjbpm-build-bootstrap/script/release/DSL-scripts/05.KIE_pushTag.sh
"""

def removeBranches=
"""
sh /home/jenkins/workspace/KIE-Release-7.0.x/release-scripts/droolsjbpm-build-bootstrap/script/release/DSL-scripts/06.KIE_removeReleaseBranches.sh
"""

def updateVersions=
"""
sh /home/jenkins/workspace/KIE-Release-7.0.x/release-scripts/droolsjbpm-build-bootstrap/script/release/DSL-scripts/07.KIE_updateToNextDevelopmentVersion.sh
"""

def copyBinariesToFilemgmt=
"""
sh /home/jenkins/workspace/KIE-Release-7.0.x/release-scripts/droolsjbpm-build-bootstrap/script/release/DSL-scripts/08.KIE_copyBinariesToFilemgmt.sh
"""

// **************************************************************************

job("01.pushReleaseBranches-7.0.x") {

  description("This job:
 checksout the right source- upgrades the version in poms
 - modifies the kie-parent-metadata pom
 - pushes the generated release branches to kiegroup
 IMPORTANT: Created automatically by Jenkins job DSL plugin. Do not edit manually! The changes will get lost next time the job is generated.")

  parameters {
    choiceParam("TARGET", ["community", "productized"], "please select if this release is for community:  community
or
 if it is for building a productization tag: productized
 ********************************************************
 ")
    choiceParam("SOURCE", ["community-branch", "community-tag", "production-tag"], " please select the source of this release
 or it is the master branch (  community-branch  )
 or a community tag (  community-tag  )
 or a productization tag (  production-tag  )
 ********************************************************
 ")
    stringParam("TAG", "tag", "if you selected as  SOURCE=community-tag  or  SOURCE=production-tag  please edit the name of the tag
 if selected as  SOURCE=community-branch  the parameter  TAG  will be ignored
 The tag should typically look like  7.0.0.CR1  for  community  or  sync-7.0.x-2017.01.22   for  productization
 ********************************************************
 ")
    stringParam("RELEASE_VERSION", "release version", "please edit the version for this release
 The  RELEASE_VERSION  should typically look like  7.0.0.CR1  for  community  or  6.5.1.20160805-productization  for  productization
********************************************************
 ")
    stringParam("BASE_BRANCH", "base branch", "please select the base branch
 ********************************************************
 ")
    stringParam("RELEASE_BRANCH", "release branch", "please edit the name of the release branch
 i.e. typically  r7.0.0.CR1  for  community or  bsync-7.0.x-2017.01.22   for  productization
 ********************************************************
 ")
    stringParam("UBERFIRE_VERSION", "uberfire version", "please edit the right version to use of uberfire/uberfire-extensions
 The tag should typically look like  1.0.0.CR1  for  community  or  6.5.1.20170122-productization  for  productization
 ********************************************************
 ")
    stringParam("DASHBUILDER_VERSION", "dashbuilder version", "please edit the right version to use of dashbuilder
 The tag should typically look like  0.6.0.CR1  for  community  or  6.5.1.20170122-productization  for  productization
 ********************************************************
 ")
    stringParam("ERRAI_VERSION", "errai version", " please select the errai version
 ********************************************************
 ")
  };

  label("kie-releases")

  logRotator {
    numToKeep(10)
  }

  jdk("jdk1.8")

  wrappers {
    timestamps()
    colorizeOutput()
    toolenv("APACHE_MAVEN_3_2_5", "JDK1_8")
  }

  configure { project ->
    project / 'buildWrappers' << 'org.jenkinsci.plugins.proccleaner.PreBuildCleanup' {
      cleaner(class: 'org.jenkinsci.plugins.proccleaner.PsCleaner') {
        killerType 'org.jenkinsci.plugins.proccleaner.PsAllKiller'
        killer(class: 'org.jenkinsci.plugins.proccleaner.PsAllKiller')
        username 'jenkins'
      }
    }
  }

  steps {
    environmentVariables {
        envs(MAVEN_OPTS :"-Xms2g -Xmx3g", MAVEN_HOME: "\$APACHE_MAVEN_3_2_5_HOME", MAVEN_REPO_LOCAL: "/home/jenkins/.m2/repository", PATH :"\$MAVEN_HOME/bin:\$PATH")
    }
    shell(pushReleaseBranches)
  }
}

// **************************************************************************************

job("02.buildDeployLocally-7.0.x") {

  description("This job:
 - builds all repositories and deploys them locally
 IMPORTANT: Created automatically by Jenkins job DSL plugin. Do not edit manually! The changes will get lost next time the job is generated.")

  parameters {
    choiceParam("TARGET", ["community", "productized"], "please select if this release is for community  community  or
 if it is for building a productization tag productized
 ********************************************************
 ")
    stringParam("RELEASE_BRANCH", "release branch", "please edit the name of the release branch
 i.e. typically  r7.0.0.CR1  for  community or  bsync-6.5.x-2017.01.22   for  productization
 ********************************************************
 ")
  };

  label("kie-releases")

  logRotator {
    numToKeep(10)
  }

  jdk("jdk1.8")

  publishers {
    archiveJunit("**/TEST-*.xml")
  }

  wrappers {
    timestamps()
    colorizeOutput()
    toolenv("APACHE_MAVEN_3_2_5", "JDK1_8")
  }

  configure { project ->
    project / 'buildWrappers' << 'org.jenkinsci.plugins.proccleaner.PreBuildCleanup' {
      cleaner(class: 'org.jenkinsci.plugins.proccleaner.PsCleaner') {
        killerType 'org.jenkinsci.plugins.proccleaner.PsAllKiller'
        killer(class: 'org.jenkinsci.plugins.proccleaner.PsAllKiller')
        username 'jenkins'
      }
    }
  }

  steps {
    environmentVariables {
        envs(MAVEN_OPTS :"-Xms2g -Xmx3g", MAVEN_HOME: "\$APACHE_MAVEN_3_2_5_HOME", MAVEN_REPO_LOCAL: "/home/jenkins/.m2/repository", PATH :"\$MAVEN_HOME/bin:\$PATH")
    }
    shell(deployLocally)
  }
}

// ********************************************************************************

job("03.copyToNexus-7.0.x") {

  description("This job:
 - copies binaries from local dir to Nexus
 IMPORTANT: Created automatically by Jenkins job DSL plugin. Do not edit manually! The changes will get lost next time the job is generated.")

  parameters {
    choiceParam("TARGET", ["community", "productized"], "please select if this release is for community:  community  or
 if it is for building a productization tag: productized
 ********************************************************
 ")
  };

  label("kie-releases")

  logRotator {
    numToKeep(10)
  }

  jdk("jdk1.8")

  customWorkspace("\$HOME/workspace/02.buildDeployLocally-7.0.x")

  wrappers {
    timestamps()
    colorizeOutput()
    toolenv("APACHE_MAVEN_3_2_5", "JDK1_8")
  }

  configure { project ->
    project / 'buildWrappers' << 'org.jenkinsci.plugins.proccleaner.PreBuildCleanup' {
      cleaner(class: 'org.jenkinsci.plugins.proccleaner.PsCleaner') {
        killerType 'org.jenkinsci.plugins.proccleaner.PsAllKiller'
        killer(class: 'org.jenkinsci.plugins.proccleaner.PsAllKiller')
        username 'jenkins'
      }
    }
  }

  publishers{
    downstreamParameterized {
      trigger("04a.allJbpmTestCoverageMatrix-7.0.x, 04b.kieAllServerMatrix-7.0.x, 04c.kieWbSmokeTestsMatrix-7.0.x") {
        condition("SUCCESS")
        parameters {
          propertiesFile("kie.properties", true)
        }
      }
    }
  }

  steps {
    environmentVariables {
        envs(MAVEN_OPTS :"-Xms2g -Xmx3g", MAVEN_HOME: "\$APACHE_MAVEN_3_2_5_HOME", MAVEN_REPO_LOCAL: "/home/jenkins/.m2/repository", PATH :"\$MAVEN_HOME/bin:\$PATH")
    }
    shell(copyToNexus)
  }

}

// **************************************************************************************

matrixJob("04a.allJbpmTestCoverageMatrix-7.0.x") {

  description("This job:
 - Test coverage Matrix for jbpm
 IMPORTANT: Created automatically by Jenkins job DSL plugin. Do not edit manually! The changes will get lost next time the job is generated.")
  parameters {
    choiceParam("TARGET", ["community", "productized"], "please select if this release is for community  community:  or
 if it is for building a productization tag: productized
 Version to test. Will be supplied by the parent job.
 ********************************************************
 ")
    stringParam("KIE_VERSION", "KIE version", "please edit the version of the KIE release
 i.e. typically  7.0.0.CR1  for  community or  6.5.1.20160805-productized  for  productization
 Version to test. Will be supplied by the parent job.
 ********************************************************
 ")
  };

  axes {
    labelExpression("label-exp","linux && mem4g")
    jdk("jdk1.8")
  }

  logRotator {
    numToKeep(10)
  }

  wrappers {
    timeout {
      absolute(120)
    ean
    timestamps()
    colorizeOutput()
    preBuildCleanup()
   }

  publishers {
    archiveJunit("**/TEST-*.xml")
    mailer('mbiarnes@redhat.com', false, false)
  }

  configure { project ->
    project / 'buildWrappers' << 'org.jenkinsci.plugins.proccleaner.PreBuildCleanup' {
      cleaner(class: 'org.jenkinsci.plugins.proccleaner.PsCleaner') {
        killerType 'org.jenkinsci.plugins.proccleaner.PsAllKiller'
        killer(class: 'org.jenkinsci.plugins.proccleaner.PsAllKiller')
        username 'jenkins'
      }
    }
  }

  steps {
    shell(jbpmTestCoverageMatrix)
    maven{
      mavenInstallation("apache-maven-3.2.5")
      goals("clean verify -e -B -Dmaven.test.failure.ignore=true -Dintegration-tests")
      rootPOM("jbpm-test-coverage/pom.xml")
      mavenOpts("-Xmx3g")
      providedSettings("org.jenkinsci.plugins.configfiles.maven.MavenSettingsConfig1438340407905")
    }
  }
}

// **********************************************************************************

matrixJob("04b.kieAllServerMatrix-7.0.x") {
  description("This job:
 - Runs the KIE Server integration tests on mutiple supported containers and JDKs
 IMPORTANT: Created automatically by Jenkins job DSL plugin. Do not edit manually! The changes will get lost next time the job is generated. ")

  parameters {
    choiceParam("TARGET", ["community", "productized"], "
 ********************************************************
 ")
    stringParam("KIE_VERSION", "KIE version", "the KIE_VERSION will be supplied by parent job")
  };

  axes {
    jdk("jdk1.8")
    text("container", "tomcat8", "wildfly10")
    labelExpression("label_exp", "linux && mem4g")
  }

  childCustomWorkspace("\${SHORT_COMBINATION}")

  logRotator {
    numToKeep(10)
  }

  wrappers {
    timeout {
      absolute(120)
    }
    timestamps()
    colorizeOutput()
    preBuildCleanup()
    configFiles {
      mavenSettings("org.jenkinsci.plugins.configfiles.maven.MavenSettingsConfig1438340407905"){
        variable("SETTINGS_XML_FILE")
      }
    }
   }

  configure { project ->
    project / 'buildWrappers' << 'org.jenkinsci.plugins.proccleaner.PreBuildCleanup' {
      cleaner(class: 'org.jenkinsci.plugins.proccleaner.PsCleaner') {
        killerType 'org.jenkinsci.plugins.proccleaner.PsAllKiller'
        killer(class: 'org.jenkinsci.plugins.proccleaner.PsAllKiller')
        username 'jenkins'
      }
    }
  }

  publishers {
    archiveJunit("**/target/failsafe-reports/TEST-*.xml")
    mailer('mbiarnes@redhat.com', false, false)
  }

  steps {
    shell(kieAllServerMatrix)
    maven{
      mavenInstallation("apache-maven-3.2.5")
      goals("-B -U -e -fae clean verify -P\$container")
      rootPOM("kie-server-parent/kie-server-tests/pom.xml")
      properties("kie.server.testing.kjars.build.settings.xml":"\$SETTINGS_XML_FILE")
      properties("maven.test.failure.ignore": true)
      properties("deployment.timeout.millis":"240000")
      properties("container.startstop.timeout.millis":"240000")
      properties("eap64x.download.url":"http://download.devel.redhat.com/released/JBEAP-6/6.4.4/jboss-eap-6.4.4-full-build.zip")
      mavenOpts("-Xms1024m -Xmx1536m")
      providedSettings("org.jenkinsci.plugins.configfiles.maven.MavenSettingsConfig1438340407905")
    }
  }
}

// ****************************************************************************************************

matrixJob("04c.kieWbSmokeTestsMatrix-7.0.x") {
  description("This job:
 - Runs the smoke tests on KIE
 IMPORTANT: Created automatically by Jenkins job DSL plugin. Do not edit manually! The changes will get lost next time the job is generated. ")

  parameters {
    choiceParam("TARGET", ["community", "productized"], "
 ********************************************************
 ")
    stringParam("KIE_VERSION", "kie version", "the KIE_VERSION will be supplied by parent job")
  };

  axes {
    jdk("jdk1.8")
    text("container", "wildfly10", "tomcat8", "eap7")
    text("war", "kie-wb", "kie-drools-wb")
    labelExpression("label_exp", "linux && mem4g && gui-testing")
  }

  childCustomWorkspace("\${SHORT_COMBINATION}")

  properties {
    rebuild {
      autoRebuild()
    }
  }

  logRotator {
    numToKeep(10)
  }

  configure { project ->
    project / 'buildWrappers' << 'org.jenkinsci.plugins.proccleaner.PreBuildCleanup' {
      cleaner(class: 'org.jenkinsci.plugins.proccleaner.PsCleaner') {
        killerType 'org.jenkinsci.plugins.proccleaner.PsAllKiller'
        killer(class: 'org.jenkinsci.plugins.proccleaner.PsAllKiller')
        username 'jenkins'
      }
    }
  }

  wrappers {
    timeout {
      absolute(120)
    }
    timestamps()
    colorizeOutput()
    preBuildCleanup()
    xvnc {
      useXauthority(true)
    }
   }

  publishers {
    archiveJunit("**/target/failsafe-reports/TEST-*.xml")
    mailer('mbiarnes@redhat.com', false, false)
  }

  steps {
    shell(kieWbSmokeTestsMatrix)
    maven{
      mavenInstallation("apache-maven-3.2.5")
      goals("-B -e -fae clean verify -P\$container,\$war,selenium -D\$TARGET")
      rootPOM("kie-wb-tests/pom.xml")
      properties("maven.test.failure.ignore":true)
      properties("deployment.timeout.millis":"240000")
      properties("container.startstop.timeout.millis":"240000")
      properties("webdriver.firefox.bin":"/opt/tools/firefox-38esr/firefox-bin")
      properties("eap7.download.url":"http://download.eng.brq.redhat.com/released/JBEAP-7/7.0.2/jboss-eap-7.0.2-full-build.zip")
      mavenOpts("-Xms1024m -Xmx1536m")
      providedSettings("org.jenkinsci.plugins.configfiles.maven.MavenSettingsConfig1438340407905")
    }
  }
}

// ************************************************************************************************

job("05.pushTags-7.0.x") {

  description("This job:
 creates and pushes the tags for
 community (kiegroup) or product (jboss-integration)
 IMPORTANT: Created automatically by Jenkins job DSL plugin. Do not edit manually! The changes will get lost next time the job is generated.")

  parameters {
    choiceParam("TARGET", ["community", "productized"], "please select if this release is for community:  community  or
 if it is for building a productization tag: productized
 ********************************************************
 ")
    stringParam("RELEASE_BRANCH", "release branch", "please edit the name of the release branch
 i.e. typically  r7.0.0.CR1  for  community or  bsync-6.5.x-2017.01.22   for  productization
 ********************************************************
 ")
    stringParam("TAG_NAME", "tag", "Please enter the tag. The tag should typically look like  7.0.0.CR1  for  community  or  sync-6.5.x-2017.01.22  for  productization
 ********************************************************
 ")
  };

  label("kie-releases")

  logRotator {
    numToKeep(10)
  }

  jdk("jdk1.8")

  wrappers {
    timeout {
      absolute(30)
    }
    timestamps()
    colorizeOutput()
    toolenv("APACHE_MAVEN_3_2_5", "JDK1_8")
  }

  configure { project ->
    project / 'buildWrappers' << 'org.jenkinsci.plugins.proccleaner.PreBuildCleanup' {
      cleaner(class: 'org.jenkinsci.plugins.proccleaner.PsCleaner') {
        killerType 'org.jenkinsci.plugins.proccleaner.PsAllKiller'
        killer(class: 'org.jenkinsci.plugins.proccleaner.PsAllKiller')
        username 'jenkins'
      }
    }
  }

  publishers {
    mailer('mbiarnes@redhat.com', false, false)
  }

  steps {
    environmentVariables {
        envs(MAVEN_OPTS :"-Xms2g -Xmx3g", MAVEN_HOME: "\$APACHE_MAVEN_3_2_5_HOME", MAVEN_REPO_LOCAL: "/home/jenkins/.m2/repository", PATH :"\$MAVEN_HOME/bin:\$PATH")
    }
    shell(pushTags)
  }
}

// ***********************************************************************************

job("06.removeReleaseBranches-7.0.x") {

  description("This job:
 creates and pushes the tags for
 community (kiegroup) or product (jboss-integration)
 IMPORTANT: Created automatically by Jenkins job DSL plugin. Do not edit manually! The changes will get lost next time the job is generated.")

  parameters {
    choiceParam("TARGET", ["community", "productized"], "please select if this release is for community:  community  or
 if it is for building a productization tag: productized
 ********************************************************
 ")
    stringParam("BASE_BRANCH", "base branch", "please select the base branch
 ********************************************************
 ")
    stringParam("RELEASE_BRANCH", "release branch", "please edit the name of the release branch
 i.e. typically  r7.0.0.CR1  for  community or  bsync-6.5.x-2017.01.22   for  productization
 ********************************************************
 ")
  };

  label("kie-releases")

  logRotator {
    numToKeep(10)
  }

  jdk("jdk1.8")

  wrappers {
    timeout {
      absolute(30)
    }
    timestamps()
    colorizeOutput()
    toolenv("APACHE_MAVEN_3_2_5", "JDK1_8")
  }

  configure { project ->
    project / 'buildWrappers' << 'org.jenkinsci.plugins.proccleaner.PreBuildCleanup' {
      cleaner(class: 'org.jenkinsci.plugins.proccleaner.PsCleaner') {
        killerType 'org.jenkinsci.plugins.proccleaner.PsAllKiller'
        killer(class: 'org.jenkinsci.plugins.proccleaner.PsAllKiller')
        username 'jenkins'
      }
    }
  }

  publishers {
    mailer('mbiarnes@redhat.com', false, false)
  }

  steps {
    environmentVariables {
        envs(MAVEN_OPTS :"-Xms2g -Xmx3g", MAVEN_HOME: "\$APACHE_MAVEN_3_2_5_HOME", MAVEN_REPO_LOCAL: "/home/jenkins/.m2/repository", PATH :"\$MAVEN_HOME/bin:\$PATH")
    }
    shell(removeBranches)
  }
}

// ****************************************************************************************

job("07.updateToNextDevelopmentVersion-7.0.x") {

  description("This job:
 updates the KIE repositories to a new developmenmt version
 for 6.4.x, 6.5.x or 7.0.x branches
 IMPORTANT: Created automatically by Jenkins job DSL plugin. Do not edit manually! The changes will get lost next time the job is generated.")

  parameters {
    stringParam("newVersion", "new KIE version", "Edit the next KIE development version")
    stringParam("UBERFIRE_VERSION", "uberfire version", "Edit the next uberfire development version")
    stringParam("DASHBUILDER_VERSION", "dashbuilder version", "Edit the next dashbuilder development version")
    stringParam("ERRAI_VERSION", "errai version", "Edit the next errai development version")
  }

  label("kie-releases")

  logRotator {
    numToKeep(10)
  }

  jdk("jdk1.8")

  wrappers {
    timeout {
      absolute(30)
    }
    timestamps()
    colorizeOutput()
    toolenv("APACHE_MAVEN_3_2_5", "JDK1_8")
  }

  configure { project ->
    project / 'buildWrappers' << 'org.jenkinsci.plugins.proccleaner.PreBuildCleanup' {
      cleaner(class: 'org.jenkinsci.plugins.proccleaner.PsCleaner') {
        killerType 'org.jenkinsci.plugins.proccleaner.PsAllKiller'
        killer(class: 'org.jenkinsci.plugins.proccleaner.PsAllKiller')
        username 'jenkins'
      }
    }
  }

  publishers {
    mailer('mbiarnes@redhat.com', false, false)
  }

  steps {
    environmentVariables {
        envs(MAVEN_OPTS :"-Xms2g -Xmx3g", MAVEN_HOME: "\$APACHE_MAVEN_3_2_5_HOME", MAVEN_REPO_LOCAL: "/home/jenkins/.m2/repository", PATH :"\$MAVEN_HOME/bin:\$PATH")
    }
    shell(updateVersions)
  }
}

// ****************************************************************************************

job("08.copyBinariesToFilemgmt-7.0.x") {

  description("This job:
 copies kiegroup binaries to filemgmt.jbosss.org
 IMPORTANT: makes only sense for community releases
 Created automatically by Jenkins job DSL plugin. Do not edit manually! The changes will get lost next time the job is generated.")

  label("kie-releases")

  logRotator {
    numToKeep(10)
  }

  jdk("jdk1.8")

  customWorkspace("\$HOME/workspace/02.buildDeployLocally-7.0.x")

  wrappers {
    timeout {
      absolute(30)
    }
    timestamps()
    colorizeOutput()
    preBuildCleanup()
    toolenv("APACHE_MAVEN_3_2_5", "JDK1_8")
  }

  configure { project ->
    project / 'buildWrappers' << 'org.jenkinsci.plugins.proccleaner.PreBuildCleanup' {
      cleaner(class: 'org.jenkinsci.plugins.proccleaner.PsCleaner') {
        killerType 'org.jenkinsci.plugins.proccleaner.PsAllKiller'
        killer(class: 'org.jenkinsci.plugins.proccleaner.PsAllKiller')
        username 'jenkins'
      }
    }
  }

  publishers {
    mailer('mbiarnes@redhat.com', false, false)
  }

  steps {
    environmentVariables {
        envs(MAVEN_OPTS :"-Xms2g -Xmx3g", MAVEN_HOME: "\$APACHE_MAVEN_3_2_5_HOME", MAVEN_REPO_LOCAL: "/home/jenkins/.m2/repository", PATH :"\$MAVEN_HOME/bin:\$PATH")
    }
    shell(copyBinariesToFilemgmt)
  }
}

// *****
// *****

listView("7.0.x-KIE-releases") {
  description("all needed scripts for builing a release of 7.0.x branch")
  jobs {
       name("01.pushReleaseBranches-7.0.x")
       name("02.buildDeployLocally-7.0.x")
       name("03.copyToNexus-7.0.x")
       name("04a.allJbpmTestCoverageMatrix-7.0.x")
       name("04b.kieAllServerMatrix-7.0.x")
       name("04c.kieWbSmokeTestsMatrix-7.0.x")
       name("05.pushTags-7.0.x")
       name("06.removeReleaseBranches-7.0.x")
       name("07.updateToNextDevelopmentVersion-7.0.x")
       name("08.copyBinariesToFilemgmt-7.0.x")
  }
  columns {
       status()
       weather()
       name()
       lastSuccess()
       lastFailure()
  }
}


Initial upload

Initial upload

#!/bin/bash

#Enter in the URL of the JSS we are are pulling and pushing the data to.
echo "Please enter your JSS URL"
echo "On-Prem Example: https://myjss.com:8443"
echo "Jamf Cloud Example: https://myjss.jamfcloud.com"
read jssURL
echo ""

#Trim the trailing slash off if necessary
if [ $(echo "${jssURL: -1}") == "/" ]; then
	jssURL=$(echo $jssURL | sed 's/.$//')
fi

#Login Credentials
echo "Please enter an Adminstrator's username for the JSS:"
read jssUser
echo ""

echo "Please enter the password for $jssUser's account:"
read -s jssPass
echo ""

echo "Please enter the name of the Smart Group to convert to a Static Group"
read smartGroupName
echo ""

#Generate a name for the static group
staticName="$smartGroupName - Static"

#Tell the user what we are making
echo "Creating Static Group: $staticName ..."
echo ""

#Throw %20 in place of spaces so we can GET properly
formattedName=$(echo "$smartGroupName" | sed s/' '/%20/g)

#GET all computer IDs in the specified smart group
allComputerIDs=$(curl -H "Accept: text/xml" -ksu $jssUser:$jssPass "$jssURL/JSSResource/computergroups/name/$formattedName" | xpath //computer_group/computers/computer/id 2> /dev/null | sed s/'<id>'//g | sed s/'<\/id>'/','/g | sed 's/.$//')

#Read the computer IDs into an array
IFS=',' read -r -a computerIDs <<< "$allComputerIDs"

#Get the length of the array so we can loop through it
idlength=${#computerIDs[@]}

#build the xml to POST
apiPOST="<computer_group><name>$staticName</name><is_smart>false</is_smart><computers>"

#add computers to group
for ((i=0; i<$idlength;i++));
do
	deviceid=$(echo "${computerIDs[$i]}" | sed 's/,//g' | tr -d '\r\n')
	apiPOST+="<computer><id>$deviceid</id></computer>"

done

#Close up the data
apiPOST+="</computers></computer_group>"

#POST the group
curl -H "Content-Type: text/xml" -d "$apiPOST" -ksu "$jssUser":"$jssPass" "$jssURL/JSSResource/computergroups/id/0" -X POST

echo ""
echo "Done."

error: pathspec 'JamfAPI/smartToStaticConverter.sh' did not match any file(s) known to git


Added line that removes installer after install is complete.

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/penguinmenac3/better-ubuntu.git/'


Agrego script que uso para setear teclado

lo uso cuando enchufo un teclado y necesito mapear las teclas con mi
configuracion particular

setxkbmap -rules evdev -model evdev -layout us -variant altgr-intl
[[ -f ~/.Xresources ]] && xrdb -merge ~/.Xresources
if [ -s ~/.Xmodmap ]; then
    xmodmap ~/.Xmodmap
fi
xcape

error: pathspec 'bin/setupkb.sh' did not match any file(s) known to git


Added an ssh port change for OSX (up to yosemite)

#!/bin/bash
#############################################
# AUTHOR: JONATHAN SCHWENN @JONSCHWENN      #
# MAC MINI VAULT - MAC MINI COLOCATION      #
# MACMINIVAULT.COM - @MACMINIVAULT          #
# VERSION 1.01 RELEASE DATE NOV 05 2013     #
# DESC:  CHANGES THE PORT SSH LISTENS ON    #
#############################################
#REQUIREMENTS:
#  OS X 10.8, 10.9, 10.10
#############################################
#CHECK FOR OS X 10.8-10.10
if [[  $(sw_vers -productVersion | grep -E '10.[8-9]|10.10')  ]]
then
echo "THIS SCRIPT WILL CHANGE YOUR SSH PORT AND RESTART SSH."
echo "THE DEFAULT PORT FOR SSH IS 22, WE RECOMMEND A CUSTOM"
echo "PORT OVER 1000.  THIS SCRIPT CAN ALSO RETURN SSH BACK"
echo "TO 22, JUST ENTER "22" FOR THE PORT NUMBER."
echo "........."
echo "PLEASE ENTER A PORT NUMBER:"
while read port; do
	if [[ $port =~ ^[0-9]{2,5}$ ]]; then
		if [[ $port = 22 ]]; then
			sudo /usr/libexec/PlistBuddy -c "Set Sockets:Listeners:SockServiceName ssh" /System/Library/LaunchDaemons/ssh.plist
echo "SYSTEM WILL NOW LISTEN ON DEFAULT PORT 22 FOR SSH"
		break 2
		else
			sudo /usr/libexec/PlistBuddy -c "Set Sockets:Listeners:SockServiceName $port" /System/Library/LaunchDaemons/ssh.plist
echo "SYSTEM WILL NOW LISTEN ON PORT $port FOR SSH"
		break 2
		fi
	else
echo "INVALID PORT: MUST BE NUMERIC! (2 to 5 digits)"
	fi
done
#TURN OFF AND TURN BACK ON REMOTE LOGIN
echo "yes" | sudo systemsetup -setremotelogin off > /dev/null 2>&1
sleep 5
sudo systemsetup -setremotelogin on > /dev/null 2>&1
else
echo "ERROR: YOU ARE NOT RUNNING OS X 10.8, 10.9, or 10.10. THIS SCRIPT DOES NOT WORK ON 10.11: https://github.com/MacMiniVault/Mac-Scripts/blob/master/sshport/sshport-README.md"
exit 1
fi

error: pathspec 'bin/sshport.sh' did not match any file(s) known to git


support setting custom tags

support setting custom tags

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/saphocom/auth0.js.git/'


Added run-app.sh

Added run-app.sh

#!/bin/bash

set -e

SCRIPT=`realpath $0`
SCRIPTPATH=`dirname $SCRIPT`
ROOTPATH=`dirname $SCRIPTPATH`
APKPATH=$ROOTPATH/client/build/outputs/apk/client-debug.apk

pushd $ROOTPATH > /dev/null
./gradlew --daemon :client:assembleDebug $@
popd > /dev/null

# Assumes ANDROID_HOME is set to your Android SDK directory
BUILDTOOLS_DIR=`ls $ANDROID_HOME/build-tools/ | sort -V | tail -1`

$ANDROID_HOME/platform-tools/adb install -r $APKPATH

error: pathspec 'scripts/run-app.sh' did not match any file(s) known to git


Correct script error.

Correct script error.

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/libmetrocoin/libmetrocoin-protocol.git/'


add specific AF tests.

add specific AF tests.

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/MarginC/kame.git/'


Create arrowKeysCatchr3.sh

Create arrowKeysCatchr3.sh

#!/bin/bash
# arrow-detect.sh: Detects the arrow keys, and a few more.
# Thank you, Sandro Magi, for showing me how.

# --------------------------------------------
# Character codes generated by the keypresses.
arrowup='\[A'
arrowdown='\[B'
arrowrt='\[C'
arrowleft='\[D'
insert='\[2'
delete='\[3'
# --------------------------------------------

SUCCESS=0
OTHER=65

# tefEdit: add loop start
while true
do

#echo -n "Press a key...  "

# May need to also press ENTER if a key not listed above pressed.
read -n3 key                      # Read 3 characters.

# tefEdit Nb: adiing "> /dev/null 2>&1" after grep seems to have no effect ..
# tefEdit -> maybe it'd be possible by using `` & capturing the output inst

echo -en "\r$key" | grep "$arrowup"  #Check if character code detected.
if [ "$?" -eq $SUCCESS ]
then
  echo -en "\rUp-arrow key pressed."
  #exit $SUCCESS
else
  echo -en "\r"
fi

echo -en "\r$key" | grep "$arrowdown"
if [ "$?" -eq $SUCCESS ]
then
  echo -en "\rDown-arrow key pressed."
  #exit $SUCCESS
else
  echo -en "\r"
fi

echo -en "\r$key" | grep "$arrowrt"
if [ "$?" -eq $SUCCESS ]
then
  echo -en "\rRight-arrow key pressed."
  #exit $SUCCESS
else
  echo -en "\r"
fi

echo -en "\r$key" | grep "$arrowleft"
if [ "$?" -eq $SUCCESS ]
then
  echo -en "\rLeft-arrow key pressed."
  #exit $SUCCESS
else
  echo -en "\r"
fi

echo -n "$key" | grep "$insert"
if [ "$?" -eq $SUCCESS ]
then
  echo "\"Insert\" key pressed."
  #exit $SUCCESS
fi

echo -n "$key" | grep "$delete"
if [ "$?" -eq $SUCCESS ]
then
  echo "\"Delete\" key pressed."
  #exit $SUCCESS
fi

#echo " Some other key pressed."

#exit $OTHER

# tefEdit: add loo end
done

#  Exercises:
#  ---------
#  1) Simplify this script by rewriting the multiple "if" tests
#+    as a 'case' construct.
#  2) Add detection of the "Home," "End," "PgUp," and "PgDn" keys.

error: pathspec 'catchArrowKeysTests/arrowKeysCatchr3.sh' did not match any file(s) known to git


Corrected a bug whereby the virtualenv would not be displayed in my prompt

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/fgimian/macbuild.git/'


A script to unbind certain shifted keys to make sure you use the correct shift

#!/bin/sh

# A script to rebind all shifted keys to force you to use the correct shift
# button for minimum risk of rsi.

# reset keyboard
setxkbmap gb

# Set right shift to be a temporary caps lock (ony on while held)
xmodmap -e "keysym Shift_R = Mode_switch"

# Buttons not really on either side, leave these alone so either works.
# 6 asciicircum
# y Y
# b B

# Bind lhs of keyboard to only have its case affected by by this "temporary
# caps lock modifier".

# letters
xmodmap -e "keysym q = q q Q Q"
xmodmap -e "keysym w = w w W W"
xmodmap -e "keysym e = e e E E"
xmodmap -e "keysym r = r r R R"
xmodmap -e "keysym t = t t T T"
xmodmap -e "keysym a = a a A A"
xmodmap -e "keysym s = s s S S"
xmodmap -e "keysym d = d d D D"
xmodmap -e "keysym f = f f F F"
xmodmap -e "keysym g = g g G G"
xmodmap -e "keysym z = z z Z Z"
xmodmap -e "keysym x = x x X X"
xmodmap -e "keysym c = c c C C"
xmodmap -e "keysym v = v v V V"

# symbols
xmodmap -e "keysym backslash = backslash backslash bar bar"
xmodmap -e "keysym grave = grave grave notsign notsign"
xmodmap -e "keysym 1 = 1 1 exclam"
xmodmap -e "keysym 2 = 2 2 quotedbl"
xmodmap -e "keysym 3 = 3 3 sterling"
xmodmap -e "keysym 4 = 4 4 dollar"
xmodmap -e "keysym 5 = 5 5 percent"

# Bind rhs of keyboard to only have its case affected by normal shift (not
# caps lock).

xmodmap -e "keysym u = u U u U"
xmodmap -e "keysym i = i I i I"
xmodmap -e "keysym o = o O o O"
xmodmap -e "keysym p = p P p P"
xmodmap -e "keysym h = h H h H"
xmodmap -e "keysym j = j J j J"
xmodmap -e "keysym k = k K k K"
xmodmap -e "keysym l = l L l L"
xmodmap -e "keysym n = n N n N"
xmodmap -e "keysym m = m M m M"

# symbols
xmodmap -e "keysym 7 = 7 ampersand 7 ampersand"
xmodmap -e "keysym 8 = 8 asterisk 8 asterisk"
xmodmap -e "keysym 9 = 9 parenleft 9 parenleft"
xmodmap -e "keysym 0 = 0 parenright 0 parenright"
xmodmap -e "keysym minus = minus underscore minus underscore"
xmodmap -e "keysym equal = equal plus equal plus"
xmodmap -e "keysym bracketleft = bracketleft braceleft bracketleft braceleft"
xmodmap -e "keysym bracketright = bracketright braceright bracketright braceright"
xmodmap -e "keysym semicolon = semicolon colon semicolon colon"
xmodmap -e "keysym apostraphe = apostraphe at apostraphe at"
xmodmap -e "keysym numbersign = numbersign asciitilde numbersign asciitilde"
xmodmap -e "keysym comma = comma less comma less"
xmodmap -e "keysym period = period greater period greater"
xmodmap -e "keysym slash = slash question slash question"

error: pathspec 'keyboard_force_correct_hands.sh' did not match any file(s) known to git


Add build script. I doubt there was anybody who needed it, but well...

Add build script. I doubt there was anybodysomebody who needed it, but well...

error: pathspec 'mod2gbt/build_linux.sh' did not match any file(s) known to git


Added script to launch the client on linux as well

#DYLD_LIBRARY_PATH=$PWD/../:$DYLD_LIBRARY_PATH  LD_LIBRARY_PATH=$PWD/../:$LD_LIBRARY_PATH  ./cppoh_d --oh.plugins=weight-exp,weight-sqr,tcpsst,sqlite,weight-const,ogregraphics,colladamodels,csvfactory,simplecamera,scripting-js,brainvw
cd ../../build
cd ../build
for symfile in ../../externals/sirikata/dependencies/lib/OGRE/*; do ln -s $symfile; done
cd sirikata
./cppoh_d --oh.plugin-search=$PWD/..:$PWD --oh.plugins=weight-exp,oh-sqlite,oh-file,weight-sqr,tcpsst,weight-const,ogregraphics,colladamodels,nvtt,common-filters,csvfactory,restoreObjFactory,oh-file,oh-sqlite,scripting-js,simplecamera,brainvw --objecthost='--scriptManagers=vw:{},simplecamera:{},js:{--import-paths=../../../externals/sirikata/liboh/plugins/js/scripts} --simOptions=ogregraphics:{--search_path=../../../externals/sirikata/libproxyobject/plugins/}' --object-factory-opts=--db=../scene.db
# --default-script-opts=--init-script=../../../externals/sirikata/liboh/plugins/js/scripts/std/default.em

##pre VW script ## ./cppoh_d --oh.plugin-search=$PWD/.. --oh.plugins=weight-exp,weight-sqr,tcpsst,sqlite,weight-const,ogregraphics,colladamodels,csvfactory,simplecamera,scripting-js,brainvw --objecthost=--scriptManagers=simplecamera:{},js:{}

error: pathspec 'brain/build/runbraincppoh.sh' did not match any file(s) known to git


Add build setup script.

Add build setup script.

#!/bin/sh
oasis setup -setup-update dynamic

error: pathspec 'build-setup.sh' did not match any file(s) known to git


Add script to check schemas for migration

#!/bin/bash
echo -n "farms: "
./manage.py schemamigration farms --auto
echo -n "contact_info: "
./manage.py schemamigration contact_info --auto

error: pathspec 'irrigator_pro/schemamigrate.sh' did not match any file(s) known to git


working stub to test the app is running - can be used by Docker or locally

#! /bin/bash

# Get environment variables if running script in LOCAL (not INTEGRATION or PRODUCTION)
source ./budget_proj/bin/env.sh

# Run all configured unit tests inside the Docker container
docker-compose -f budget_proj/docker-compose.yml run budget-service python manage.py test

error: pathspec 'budget_proj/bin/test-proj.sh' did not match any file(s) known to git


Add curl function curl_stats

Add curl function curl_stats

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/ernestas-poskus/dot13.git/'


Added deploy script.

Added deploy script.

#!/bin/sh

# Creates an archive for uploading to Amazon Device Farm
# Usage: deploy.sh [zip_file]

set -e

SCRIPT=`readlink -f "$0"`

DIR=`dirname $SCRIPT`

DEST="${1:-$DIR/test_bundle.zip}"

. "$DIR/bin/activate"

rm -f "$DEST"

pip wheel --wheel-dir "$DIR/wheelhouse" -r "$DIR/requirements.txt"

zip -r "$DEST" $DIR/tests/test_*.py "$DIR/wheelhouse/" "$DIR/requirements.txt"

error: pathspec 'webofneeds/won-owner-webapp/src/main/webapp/test/appium/deploy.sh' did not match any file(s) known to git


add script to prepare tar.gz of git superproject

#!/bin/bash -e

##########################################################
#
# Generates a compressed tarball (tar.gz) of an entire
# git super-project, including submodules.
#
# - Can checkout any commit-ish (commit/tag/branch)
# - Removes .git-specific files
#
# Sample Result:
#  irods-master.tar.gz
#
##########################################################

# setup
PROJECTNAME=irods
REPOURL=https://github.com/irods/irods.git
COMMITISH=master

# prepare the working space
ORIGINALPWD=$( pwd )
SCRIPTNAME=$( basename "$0" )
TMPDIR=$( mktemp -d "/tmp/$SCRIPTNAME.XXXXXX" )
SOURCEDIR=$TMPDIR/$PROJECTNAME
ARCHIVEFILE=$PROJECTNAME-$COMMITISH.tar.gz
mkdir -p $SOURCEDIR
git clone --recursive $REPOURL $SOURCEDIR
cd $SOURCEDIR
git checkout $COMMITISH
git clean -xffd

# build and gather archive
cd $SOURCEDIR/..
tar czf $ARCHIVEFILE --exclude .git --exclude .gitignore --exclude .gitmodules --exclude .gitattributes $PROJECTNAME
mv $ARCHIVEFILE $ORIGINALPWD

# return, clean up, and show results
cd $ORIGINALPWD
rm -rf $TMPDIR
ls -al $ARCHIVEFILE

# done
exit 0

error: pathspec 'generate_targz_with_submodules.sh' did not match any file(s) known to git


add script for submission to slurm

add script for submission to slurm

#!/bin/bash

#SBATCH --partition=shortterm
#SBATCH --ntasks=4
#SBATCH --nodes=1
#SBATCH --ntasks-per-core=1

echo "----------------"
env|sort
echo "----------------"
uname -a
hostname
echo

mkdir -p $SLURM_SUBMIT_DIR/ncpu_${SLURM_NPROCS}-${SLURM_JOB_ID}
cd $SLURM_SUBMIT_DIR/ncpu_${SLURM_NPROCS}-${SLURM_JOB_ID}

module load Programs/gromacs/2019.3/with_OpenMPI_4.0.1-with_GCC_4.8.5
mpirun -np ${SLURM_NTASKS} gmx_mpi mdrun -s $SLURM_SUBMIT_DIR/md.tpr -ntomp 1

error: pathspec 'job-scripts/submit-slurm-gromacs.sh' did not match any file(s) known to git


Add install.sh

Add install.sh

set -e
pushd ~

if [ "${TRAVIS_OS_NAME}" == "osx" ]; then
    rvm get head || true
fi

function llvm_linux_target() {
    if [ "$1" == "5.0" ]; then
        echo "linux-x86_64-ubuntu14.04"
    else
        echo "x86_64-linux-gnu-ubuntu-14.04"
    fi
}

function llvm_download() {
    export LLVM=clang+llvm-${LLVM_VERSION}.0-$1
    export LLVM_DIRECTORY="$HOME/.llvm/${LLVM}"

    if [ -d "${LLVM_DIRECTORY}" ]; then
        echo "Using cached LLVM download for ${LLVM}..."
    else
        wget http://llvm.org/releases/${LLVM_VERSION}.0/${LLVM}.tar.xz --debug --verbose
        mkdir -p "${LLVM_DIRECTORY}"
        tar xf ${LLVM}.tar.xz -C "${LLVM_DIRECTORY}" --strip-components=1
    fi

    export LLVM_CONFIG_PATH="${LLVM_DIRECTORY}/bin/llvm-config"
}

if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
    llvm_download `llvm_linux_target ${LLVM_VERSION}`
    export LD_LIBRARY_PATH="${LLVM_DIRECTORY}/lib":$LD_LIBRARY_PATH
else
    llvm_download x86_64-apple-darwin
    cp "${LLVM_DIRECTORY}/lib/libclang.dylib" /usr/local/lib/libclang.dylib
    export DYLD_LIBRARY_PATH="${LLVM_DIRECTORY}/lib":$DYLD_LIBRARY_PATH
fi

popd
set +e

error: pathspec 'ci/install.sh' did not match any file(s) known to git


Print artifact version

Print artifact version

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/stoyicker/dinger.git/'


*install: A more general condition

*install: A more general condition

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/psprint/zplugin.git/'


[HAF-338] start docker host when it is in saved state

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/fobsolutions/cify-device-farm.git/'


Update install.sh

Update install.sh

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/dawikur/mnl.git/'


add opsdash

add opsdash

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/rogierlommers/dotfiles.git/'


fixed building script

fixed building script

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/justenwalker/mesos-deb-packaging.git/'


Added trivial launch.sh for convenience.  (No params; using default.)

!/bin/sh
phantomjs --cookies-file=phantom.js.cookies phantom.js

error: pathspec 'launch.sh' did not match any file(s) known to git


Initial launch

Initial launch

#! /bin/bash

echo “LaunchSetup”

aws ec2 run-instances --image-id ami-$1 --count $2 --instance-type $3 --key-name $6 --security-group-ids  $4 --subnet-id $5 --associate-public-ip-address --user-data file://ApplicationSetup-itmo-544-444-fall2015/install-env.sh --debug


this is for launch commit

this is for launch commit

#!/bin/bash

aws ec2 run-instances --image-id $1 --count $2 --instance-type $3 --key-name $6 --security-group-ids $4 --subnet-id $5 --associate-public-ip-address --user-data file://itmo544-env/install-env.sh --debug


hooks/post-install/99-pkglint: detect sonames with pkgnames containing '+' chars (gtk+).

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/Bubble-be/void-packages.git/'


Create hackyBashPrompt_beforRework.sh

Create hackyBashPrompt_beforRework.sh

#!/bin/bash

# testing how practical/feasable/usable/useful 'd be highlights in the bash PS1 prompt ;p
# current WIP usage: ./hackyBashPrompt.sh "\e[01;32m\xE2\x9A\xA1 \e[m"
# to get debug, in another term: while :; do cat < debugFifo; done;

# file(s) parsed to find matches:
# stores one name per line + its mapped color OR stores just 'types' ( function/alias/program/fifo/file/.. ) & their "highlight" color
# in either case, we 'll need fcns that check if some <stuff> exist, & if so, highlight it in the right color

# 1st very basic helper: splits the hiddenBuffer by spaces & try to find something that exist for each chunk obtained
parseHiddenBuffer(){
  IFS=' ' read -a hidBufArr <<< "${1}"
  echo "-- chunks start --" > ./debugFifo
  for chunk in "${hidBufArr[@]}"; do
    # little dummy dumb test
    if [ "${chunk}" == "grenouille" ]; then
      parsedChunk="\e[01;32m${chunk}\e[m";
      # replace every occurences of the chunk by the above - we could also have done things cleaner by using some $parsedBuff var & using that than ( we'll see .. )
      # TODO: replace the current way of doing things by adding either original chunk or parsed chunk to the output instead of replacing all -> dumb ex: grenouilleS != grenouille ;D
      #visibleBuffer="${visibleBuffer//grenouille/TEFOU}"
      visibleBuffer="${visibleBuffer//$chunk/$parsedChunk}"
      # log stuff to the debugFifo to allow us to keep a clean output on the hackyPrompt ;)
      #echo -e "${parsedChunk}" > ./debugFifo
      # R: don't know the reason why, but the above issues a glitch that return the us to the prompt in the first terminal ( ?! )
      #echo -e "${chunk}" > ./debugFifo
    #else
      # log stuff to the debugFifo to allow us to keep a clean output on the hackyPrompt ;)
      #echo -e "${chunk}" > ./debugFifo
    fi
    # log stuff to the debugFifo to allow us to keep a clean output on the hackyPrompt ;)
    #echo -e "${chunk}" > ./debugFifo
  done
  echo -e "-- chunks end --\n\n" > ./debugFifo
  # TODO: for each chunk that has a matching <stuff_type>, replace it by <colorStartForSuchType>itself<colorEnd> before adding it to the visibleBuffer string, else just add it to it the string
}

#myHackyPrompt(){
  # as I have a little glitch sometimes, we disable the visual cursor ;p
  setterm -cursor off
  # a good-looking cursor could be done if reworking the way visible buffer is refreshed, aka having a fcn that refresh each <blink freq> & display output, while another 'd modify buffer on key press
  # before having the above & a nice blinking cursor, we can at least provide a fake cursor, so as to know where we're at (  nb: currently, we're only at the end, since no backspace nor directions are handled )
  fakeCursor="\e[107mT\e[m"
  eraseLine="\033[1000D\033[K"
  #cursorAtEOL="\033[${#visibleBuffer}C"
  visiBuffLen="${#visibleBuffer}"
  #cursorAtEOL="\033[${visiBuffLen}C"
  # the above may need a fcn to work properly - the following hardcoded one works flawlessly - maybe the above one needs to be in the while loop ?
  cursorAtEOL="\033[4C"
  hiddenBuffer="";
  visibleBuffer="";
  # for a little more style, we could pass a letter / icon as parameter to have it displayed instead of the '$ ' ( currently 'F ') default one
  fakePrompt="\e[01;32mF \e[m";
  fakePromptCharsLen=2
  # if passed a prompt item ( a replacement for the '$ ' or anything being the only/last line of the $PS1 prompt ), use that instead of the default
  # ex usage: ./hackyBashPrompt.sh "\e[01;32m\xE2\x9A\xA1 \e[m"
  if [ ! "${1}" == "" ]; then fakePrompt="${1}"; fi;
  echo -en "\033[1A${eraseLine}${fakePrompt}${fakeCursor}";
  while IFS= read -s -n1 char; do
    #echo -en "\033[1A"
    hiddenBuffer="${hiddenBuffer}${char}";
    visibleBuffer="${hiddenBuffer}";
    parseHiddenBuffer "${hiddenBuffer}"
    #echo -e "${eraseLine}${fakePrompt}\e[01;32m${visibleBuffer}\e[m \033[1A";
    #echo -e "${eraseLine}${fakePrompt}\e[01;32m${visibleBuffer}\e[m${fakeCursor}\033[1A";
    # R: the above is the last one auto-coloring in green the output
    echo -e "${eraseLine}${fakePrompt}${visibleBuffer}${fakeCursor}\033[1A";
    #echo -en "${cursorAtEOL}";
    tput cuf $(( ${#visibleBuffer} + 2 ))
    #tput cuf $(( ${#visibleBuffer} + ${fakePromptCharsLen} ))
    #echo -e "${eraseLine}${fakePrompt}\e[01;32m${visibleBuffer}\e[m";
  done

  # restore the cursor
  setterm -cursor off
#}

error: pathspec 'hackyBashPrompt_beforRework.sh' did not match any file(s) known to git


update_check.sh: escape pkgname in default regexp.


rename multi dir file

rename multi dir file

for i in `find . -type f -name "*+*.mp3"`
do
    text = `echo $i | sed -e 's/+//g'`
    echo "$i $text" >> $$.log
    if [ -e $text ]; then
        echo "$text exists"
        break
    else
        mv $i $text
        if [ $? -ne 0 ]; then
            echo "$i $text failed"
            break
        fi
    fi

done

error: pathspec 'shellcmd/rename.sh' did not match any file(s) known to git


Add script to run Hugo as a docker container

# !/bin/bash
#
# File: hugoServer
#
# Purpose: Run the Hugo container as a local server
#

docker stop hugo-server
docker rm   hugo-server
docker run -p 1313:1313 -v $(pwd):/site -e VIRTUAL_HOST="${1}" --name hugo-server devopsdays/docker-hugo-server:v0.16

error: pathspec 'hugoserver.sh' did not match any file(s) known to git


store all beacons, not just certain uuids

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/brownlegion/list-beacons.git/'


random table prefix

random table prefix

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/serl/docker-wordpress.git/'


fixes

fixes

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/Leryan/olbordel.git/'


zplugin: Set :prezto:module:{mod-name} zstyles for Prezto snippets

Issue #91. Used some code from there, thanks to @laggardkernel. The
is-loaded zstyle is checked only within pmodload() function, however it
is set in -zplg-load-snippet() function, so this spans on all Prezto
module loads, both from pmodload() and directly via `zplg snippet
PZT::...' or `zplg snippet https://github.com/sorin-ionescu/prezto/...'.


add autoscaling.sh

add autoscaling.sh

#!/bin/bash

aws autoscaling create-launch-configuration --launch-configuration-name ctian-lc --image-id ami-d05e75b8 --key-name itmo544-ctian  --security-groups sg-6aa5a90d --instance-type t2.micro --user-data file://../Environment-Setup/install-webserver.sh --iam-instance-profile phpdeveloperRole

aws autoscaling create-auto-scaling-group --auto-scaling-group-name ctian-asg- --launch-configuration-name ctian-lc --load-balancer-names itmo544ctian-lb  --health-check-type ELB --min-size 1 --max-size 3 --desired-capacity 2 --default-cooldown 600 --health-check-grace-period 120 --vpc-zone-identifier subnet-20d5860b

error: pathspec 'autoscaling.sh' did not match any file(s) known to git


Brand new script!

Brand new script!

maybe replacing the old ones

#! /bin/bash
#List of commands to be executed, in order:
declare -a SYNC=("emaint sync --allrepos"
                 "emerge --regen -q"
                 "eix-update")
declare -a UPDATE=("emerge -uqv @system"
                   "emerge -uqv @world"
                   "emerge -uvqD @system"
                   "emerge -uvqD @world")
declare -a REBUILD=("emerge -uNUqv --with-bdeps=y @world"
                    "emerge -q @preserved-rebuild"
                    "emerge -aq --depclean"
                    "revdep-rebuild")
declare -a CHECK=("eclean-dist -d"
                  "eclean-pkg"
                  "eix-test-obsolete")

BASENAME="autoupgrade"
TAG="$BASENAME.sh"
STATUS_FILE="$BASENAME.status"
LOG_FILE="$BASENAME.log"

LOG_MESSAGE=""

MIN_TIME=43200 #min time interval between syncs in seconds

writeLog(){ #Small log-writing utility
    local LOG_MESSAGE=$1
    local STAGE=$2
    echo "$LOG_MESSAGE: $STAGE" >> autoupgrade.log
}

statusUpdate(){
    TYPE=$1
    grep -v "$TYPE" "$STATUS_FILE" > "$STATUS_FILE.tmp"
    mv -f "$STATUS_FILE.tmp" "$STATUS_FILE"
    echo "$(date +%s) $TYPE" >> "$STATUS_FILE"
}

retry(){ #Reruns failed commands while changing their parameters
    LOG_MESSAGE="retry"
    local CMD=$1
    local ITERATION=$2

    local PROGRAM=${CMD%% *}
    local HEAD=${CMD% *}
    local TAIL=${CMD##* }
    local OPTION=""

    if [ $PROGRAM == "emerge" ]; then
        OPTION="--backtrack 100"
    else
        return;
    fi
    writeLog $LOG_MESSAGE "$HEAD $OPTION $TAIL"

    if [ $ITERATION -le 10 ]; then
        echo "$HEAD $OPTION $TAIL"
        $HEAD $OPTION $TAIL && LOG_MESSAGE="success" ||
        retry "$CMD" 11
    else
        LOG_MESSAGE="fail"
    fi
    writeLog $LOG_MESSAGE "$HEAD $OPTION $TAIL"
}

run(){
    RETRY=$1 #Arrays are passed by name
    NAME=$2[@] #Arrays galore!
    COMMANDS=("${!NAME}")
    local EXIT_CODE

    for i in "${COMMANDS[@]}"; do
        echo "$i"
        (sh -c "$i"; EXIT_CODE="$?") && LOG_MESSAGE="success" || LOG_MESSAGE="fail"

        if [ "$LOG_MESSAGE" == "fail" ] && [ "$RETRY" != "--no-retry" ]; then
            retry "$i" 1
        fi
        writeLog "$LOG_MESSAGE $i $EXIT_CODE"
    done
}

logger -t $TAG "Automatic update started"
echo "$(date +%s) started"

if [ -f "$LOG_FILE.old" ]; then
    rm "$LOG_FILE.old"
fi

if [ -f "$LOG_FILE" ]; then
    mv "$LOG_FILE" "$LOG_FILE.old"
fi
touch autoupgrade.log

if [ ! -f  "$STATUS_FILE" ]; then
    touch "$STATUS_FILE"
    echo "0 sync" > "$STATUS_FILE"
fi

SYNC_NEEDED='false'

SYNC_STRING=$(grep "sync" < "$STATUS_FILE")
LASTSYNC=${SYNC_STRING% *}
CURRENT_TIME="$(date +%s)"
if [ $((CURRENT_TIME-LASTSYNC)) -ge $MIN_TIME ]; then
    SYNC_NEEDED='true'
fi

if [ $SYNC_NEEDED = 'true' ]; then
    run --no-retry SYNC
    statusUpdate "sync"
fi
run --retry UPDATE
statusUpdate "update"
run --retry REBUILD
statusUpdate "rebuild"
run --no-retry CHECK
statusUpdate "check"

logger -t $TAG "Automatic update finished"
exit 0

error: pathspec 'autoupgrade.sh' did not match any file(s) known to git


typo in comment

typo in comment

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/MarginC/kame.git/'


add dotfiles install script for ... remoting?

#!/usr/bin/env bash

cd
git clone https://github.com/leizhnxp/dotfiles.git
sh ~/dotfile/install.sh

error: pathspec 'kfc.cfg.sh/install.dotfiles.sh' did not match any file(s) known to git


bash-script.sh: comment modification

bash-script.sh: comment modification

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/cjng96/devCmdTool.git/'


Create bash_prompt.sh

Create bash_prompt.sh

A neat looking bash prompt which dynamically trims the PWD and warns if you have background jobs.

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/onelittlehope/bash-prompt.git/'


detect if artifacts directory does not exist (#6508)

* detect if artifacts directory does not exist

* add check for empty dir

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/VirusTotal/content.git/'


Add a script to cleanup leaked kubeflow-ci ingress resources (#1199)

* Add a script to cleanup kubeflowci resources

* address comments

#!/bin/bash
# This script cleans up ingress related compute engine resources like backend-services,
# forwarding rules, health-checks, etc. from kubeflow-ci project which
# do not belong to the kubeflow-testing cluster

set -xe

PROJECT="kubeflow-ci"

# This id comes from ingress objects in kubeflow-testing cluster
# They use a common suffix for GCP resources
KUBEFLOW_TESTING_ID=c3cb19bff97cde34

function cleanup() {
  gcloud compute ${1} list --project=${PROJECT} \
  | grep -v ${KUBEFLOW_TESTING_ID} \
  | awk '{print $1}' \
  | tail -n +2 \
  | xargs gcloud compute ${1} delete ${2} --quiet --project=${PROJECT}
}

cleanup forwarding-rules --global

cleanup target-http-proxies

cleanup target-https-proxies

cleanup url-maps

cleanup health-checks

cleanup backend-services --global

error: pathspec 'scripts/cleanup_kubeflow_ci.sh' did not match any file(s) known to git


Add create-docker-certs

Add create-docker-certs

#! /usr/bin/bash

export HOST=itsftp-test.usc.edu

#  on the Docker daemon’s host machine, generate CA private and public keys
openssl genrsa -aes256 -out ca-key.pem 4096
openssl req -new -x509 -days 365 -key ca-key.pem -sha256 -out ca.pem

# create a server key and certificate signing request (CSR).
# Make sure that “Common Name” matches the hostname you use to connect to Docker
openssl genrsa -out server-key.pem 4096
openssl req -subj "/CN=$HOST" -sha256 -new -key server-key.pem -out server.csr

echo subjectAltName = DNS:$HOST,IP:10.10.10.20,IP:127.0.0.1 >> extfile.cnf
echo extendedKeyUsage = serverAuth >> extfile.cnf

openssl x509 -req -days 365 -sha256 -in server.csr -CA ca.pem -CAkey ca-key.pem -CAcreateserial -out server-cert.pem -extfile extfile.cnf

# For client authentication, create a client key and certificate signing request:

openssl genrsa -out key.pem 4096
openssl req -subj '/CN=client' -new -key key.pem -out client.csr

echo extendedKeyUsage = clientAuth >> extfile.cnf
openssl x509 -req -days 365 -sha256 -in client.csr -CA ca.pem -CAkey ca-key.pem -CAcreateserial -out cert.pem -extfile extfile.cnf

rm -v client.csr server.csr
chmod -v 0400 ca-key.pem key.pem server-key.pem
chmod -v 0444 ca.pem server-cert.pem cert.pem

cp cert.pem key.pem ca.pem client-certs/
cp server-key.pem server-cert.pem ca.pem server-certs/
rm -v cert.pem key.pem ca.pem server-key.pem server-cert.pem

error: pathspec 'scripts/create-docker-certs.sh' did not match any file(s) known to git


libvips: enable WebP/JPEG support in libtiff (#7775)

#!/bin/bash -eu
# Copyright 2019 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
################################################################################

export PKG_CONFIG="pkg-config --static"
export PKG_CONFIG_PATH="$WORK/lib/pkgconfig"
export CPPFLAGS="-I$WORK/include"
export LDFLAGS="-L$WORK/lib"

# libz
pushd $SRC/zlib
./configure --static --prefix=$WORK
make -j$(nproc) all
make install
popd

# libexif
pushd $SRC/libexif
autoreconf -fi
./configure \
  --enable-static \
  --disable-shared \
  --disable-nls \
  --disable-docs \
  --disable-dependency-tracking \
  --prefix=$WORK
make -j$(nproc)
make install
popd

# lcms
pushd $SRC/lcms
./autogen.sh
./configure \
  --enable-static \
  --disable-shared \
  --disable-dependency-tracking \
  --prefix=$WORK
make -j$(nproc)
make install
popd

# aom
pushd $SRC/aom
mkdir -p build/linux
cd build/linux
cmake -G "Unix Makefiles" \
  -DCMAKE_C_COMPILER=$CC -DCMAKE_CXX_COMPILER=$CXX \
  -DCMAKE_C_FLAGS="$CFLAGS" -DCMAKE_CXX_FLAGS="$CXXFLAGS" \
  -DCMAKE_INSTALL_PREFIX=$WORK -DCMAKE_INSTALL_LIBDIR=lib \
  -DENABLE_SHARED=FALSE -DCONFIG_PIC=1 \
  -DENABLE_EXAMPLES=0 -DENABLE_DOCS=0 -DENABLE_TESTS=0 \
  -DENABLE_TOOLS=0 \
  -DCONFIG_SIZE_LIMIT=1 \
  -DDECODE_HEIGHT_LIMIT=12288 -DDECODE_WIDTH_LIMIT=12288 \
  -DDO_RANGE_CHECK_CLAMP=1 \
  -DAOM_MAX_ALLOCABLE_MEMORY=536870912 \
  -DAOM_TARGET_CPU=generic \
  ../../
make clean
make -j$(nproc)
make install
popd

# libheif
pushd $SRC/libheif
# Ensure libvips finds heif_image_handle_get_raw_color_profile
sed -i '/^Libs.private:/s/-lstdc++/-lc++/' libheif.pc.in
autoreconf -fi
./configure \
  --disable-shared \
  --enable-static \
  --disable-examples \
  --disable-go \
  --prefix=$WORK
make clean
make -j$(nproc)
make install
popd

# libjpeg-turbo
pushd $SRC/libjpeg-turbo
cmake . -DCMAKE_INSTALL_PREFIX=$WORK -DENABLE_STATIC=TRUE -DENABLE_SHARED=FALSE -DWITH_TURBOJPEG=FALSE
make -j$(nproc)
make install
popd

# libpng
pushd $SRC/libpng
sed -ie "s/option WARNING /& disabled/" scripts/pnglibconf.dfa
autoreconf -fi
./configure \
  --prefix=$WORK \
  --disable-shared \
  --disable-dependency-tracking
make -j$(nproc)
make install
popd

# libspng
pushd $SRC/libspng
meson setup build --prefix=$WORK --libdir=lib --default-library=static \
  -Dstatic_zlib=true
ninja -C build
ninja -C build install
popd

# libwebp
pushd $SRC/libwebp
autoreconf -fi
./configure \
  --enable-libwebpdemux \
  --enable-libwebpmux \
  --disable-shared \
  --disable-jpeg \
  --disable-tiff \
  --disable-gif \
  --disable-wic \
  --disable-threading \
  --disable-dependency-tracking \
  --prefix=$WORK
make -j$(nproc)
make install
popd

# libtiff ... a bug in libtiff master as of 20 Nov 2019 means we have to
# explicitly disable lzma
pushd $SRC/libtiff
autoreconf -fi
./configure \
  --disable-lzma \
  --disable-shared \
  --disable-dependency-tracking \
  --prefix=$WORK
make -j$(nproc)
make install
popd

# jpeg-xl (libjxl)
pushd $SRC/libjxl
# Ensure libvips finds JxlEncoderInitBasicInfo
sed -i '/^Libs.private:/ s/$/ -lc++/' lib/jxl/libjxl.pc.in
# FIXME: Remove the `-DHWY_DISABLED_TARGETS=HWY_SSSE3` workaround, see:
# https://github.com/libjxl/libjxl/issues/858
cmake -G "Unix Makefiles" \
  -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_C_COMPILER=$CC \
  -DCMAKE_CXX_COMPILER=$CXX \
  -DCMAKE_C_FLAGS="$CFLAGS -DHWY_DISABLED_TARGETS=HWY_SSSE3" \
  -DCMAKE_CXX_FLAGS="$CXXFLAGS -DHWY_DISABLED_TARGETS=HWY_SSSE3" \
  -DCMAKE_INSTALL_PREFIX="$WORK" \
  -DCMAKE_THREAD_LIBS_INIT="-lpthread" \
  -DCMAKE_USE_PTHREADS_INIT=1 \
  -DBUILD_SHARED_LIBS=0 \
  -DBUILD_TESTING=0 \
  -DJPEGXL_FORCE_SYSTEM_BROTLI=1 \
  -DJPEGXL_ENABLE_FUZZERS=0 \
  -DJPEGXL_ENABLE_TOOLS=0 \
  -DJPEGXL_ENABLE_MANPAGES=0 \
  -DJPEGXL_ENABLE_BENCHMARK=0 \
  -DJPEGXL_ENABLE_EXAMPLES=0 \
  -DJPEGXL_ENABLE_SKCMS=0 \
  -DJPEGXL_ENABLE_SJPEG=0 \
  .
make -j$(nproc)
make install
popd

# libimagequant
pushd $SRC/libimagequant
meson setup build --prefix=$WORK --libdir=lib --default-library=static
ninja -C build
ninja -C build install
popd

# cgif
pushd $SRC/cgif
meson setup build --prefix=$WORK --libdir=lib --default-library=static
ninja -C build
ninja -C build install
popd

# pdfium doesn't need fuzzing, but we want to fuzz the libvips/pdfium link
pushd $SRC/pdfium-latest
cp lib/* $WORK/lib
cp -r include/* $WORK/include
popd

# make a pdfium.pc that libvips can use ... the version number just needs to
# be higher than 4200 to satisfy libvips
cat > $WORK/lib/pkgconfig/pdfium.pc << EOF
  prefix=$WORK
  exec_prefix=\${prefix}
  libdir=\${exec_prefix}/lib
  includedir=\${prefix}/include
  Name: pdfium
  Description: pdfium
  Version: 4901
  Requires:
  Libs: -L\${libdir} -lpdfium
  Cflags: -I\${includedir}
EOF

# libvips
# Disable building man pages, gettext po files, tools, and tests
sed -i "/subdir('man')/{N;N;N;N;d;}" meson.build
meson setup build --prefix=$WORK --libdir=lib --default-library=static \
  -Ddeprecated=false -Dintrospection=false -Dmodules=disabled
ninja -C build
ninja -C build install

# All shared libraries needed during fuzz target execution should be inside the $OUT/lib directory
mkdir -p $OUT/lib
cp $WORK/lib/*.so $OUT/lib

# Merge the seed corpus in a single directory, exclude files larger than 2k
mkdir -p fuzz/corpus
find \
  $SRC/afl-testcases/{gif*,jpeg*,png,tiff,webp}/full/images \
  fuzz/*_fuzzer_corpus \
  test/test-suite/images \
  -type f -size -2k \
  -exec bash -c 'hash=($(sha1sum {})); mv {} fuzz/corpus/$hash' ';'
zip -jrq $OUT/seed_corpus.zip fuzz/corpus

# Build fuzzers and link corpus
for fuzzer in fuzz/*_fuzzer.cc; do
  target=$(basename "$fuzzer" .cc)
  $CXX $CXXFLAGS -std=c++11 "$fuzzer" -o "$OUT/$target" \
    $CPPFLAGS \
    -I/usr/include/glib-2.0 \
    -I/usr/lib/x86_64-linux-gnu/glib-2.0/include \
    $LDFLAGS \
    -lvips -lexif -llcms2 -ljpeg -lpng -lspng -lz \
    -ltiff -lwebpmux -lwebpdemux -lwebp -lheif -laom \
    -ljxl -ljxl_threads -lhwy -limagequant -lcgif -lpdfium \
    $LIB_FUZZING_ENGINE \
    -Wl,-Bstatic \
    -lfftw3 -lexpat -lbrotlienc -lbrotlidec -lbrotlicommon \
    -lgio-2.0 -lgmodule-2.0 -lgobject-2.0 -lffi -lglib-2.0 \
    -lresolv -lmount -lblkid -lselinux -lsepol -lpcre \
    -Wl,-Bdynamic -pthread \
    -Wl,-rpath,'$ORIGIN/lib'
  ln -sf "seed_corpus.zip" "$OUT/${target}_seed_corpus.zip"
done

# Copy options and dictionary files to $OUT
find fuzz -name '*_fuzzer.dict' -exec cp -v '{}' $OUT ';'
find fuzz -name '*_fuzzer.options' -exec cp -v '{}' $OUT ';'

#!/bin/bash -eu
# Copyright 2019 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
################################################################################

export PKG_CONFIG="pkg-config --static"
export PKG_CONFIG_PATH="$WORK/lib/pkgconfig"

# libz
pushd $SRC/zlib
./configure --static --prefix=$WORK
make -j$(nproc) all
make install
popd

# libexif
pushd $SRC/libexif
autoreconf -fi
./configure \
  --enable-static \
  --disable-shared \
  --disable-nls \
  --disable-docs \
  --disable-dependency-tracking \
  --prefix=$WORK
make -j$(nproc)
make install
popd

# lcms
pushd $SRC/lcms
./autogen.sh
./configure \
  --enable-static \
  --disable-shared \
  --disable-dependency-tracking \
  --prefix=$WORK
make -j$(nproc)
make install
popd

# aom
pushd $SRC/aom
mkdir -p build/linux
cd build/linux
cmake -G "Unix Makefiles" \
  -DCMAKE_C_COMPILER=$CC -DCMAKE_CXX_COMPILER=$CXX \
  -DCMAKE_C_FLAGS="$CFLAGS" -DCMAKE_CXX_FLAGS="$CXXFLAGS" \
  -DCMAKE_INSTALL_PREFIX=$WORK -DCMAKE_INSTALL_LIBDIR=lib \
  -DENABLE_SHARED=FALSE -DCONFIG_PIC=1 \
  -DENABLE_EXAMPLES=0 -DENABLE_DOCS=0 -DENABLE_TESTS=0 \
  -DCONFIG_SIZE_LIMIT=1 \
  -DDECODE_HEIGHT_LIMIT=12288 -DDECODE_WIDTH_LIMIT=12288 \
  -DDO_RANGE_CHECK_CLAMP=1 \
  -DAOM_MAX_ALLOCABLE_MEMORY=536870912 \
  -DAOM_TARGET_CPU=generic \
  ../../
make clean
make -j$(nproc)
make install
popd

# libheif
pushd $SRC/libheif
# Ensure libvips finds heif_image_handle_get_raw_color_profile
sed -i '/^Libs.private:/s/-lstdc++/-lc++/' libheif.pc.in
autoreconf -fi
./configure \
  --disable-shared \
  --enable-static \
  --disable-examples \
  --disable-go \
  --prefix=$WORK \
  CPPFLAGS=-I$WORK/include
make clean
make -j$(nproc)
make install
popd

# libjpeg-turbo
pushd $SRC/libjpeg-turbo
cmake . -DCMAKE_INSTALL_PREFIX=$WORK -DENABLE_STATIC=TRUE -DENABLE_SHARED=FALSE -DWITH_TURBOJPEG=FALSE
make -j$(nproc)
make install
popd

# libpng
pushd $SRC/libpng
sed -ie "s/option WARNING /& disabled/" scripts/pnglibconf.dfa
autoreconf -fi
./configure \
  --prefix=$WORK \
  --disable-shared \
  --disable-dependency-tracking
make -j$(nproc)
make install
popd

# libspng
pushd $SRC/libspng
meson setup build --prefix=$WORK --libdir=lib --default-library=static \
  -Dstatic_zlib=true
ninja -C build
ninja -C build install
popd

# libwebp
pushd $SRC/libwebp
autoreconf -fi
./configure \
  --enable-libwebpdemux \
  --enable-libwebpmux \
  --disable-shared \
  --disable-jpeg \
  --disable-tiff \
  --disable-gif \
  --disable-wic \
  --disable-threading \
  --disable-dependency-tracking \
  --prefix=$WORK
make -j$(nproc)
make install
popd

# libtiff ... a bug in libtiff master as of 20 Nov 2019 means we have to
# explicitly disable lzma
pushd $SRC/libtiff
autoreconf -fi
./configure \
  --disable-lzma \
  --disable-shared \
  --disable-dependency-tracking \
  --prefix=$WORK
make -j$(nproc)
make install
popd

# jpeg-xl (libjxl)
pushd $SRC/libjxl
# Ensure libvips finds JxlEncoderInitBasicInfo
sed -i '/^Libs.private:/ s/$/ -lc++/' lib/jxl/libjxl.pc.in
# FIXME: Remove the `-DHWY_DISABLED_TARGETS=HWY_SSSE3` workaround, see:
# https://github.com/libjxl/libjxl/issues/858
cmake -G "Unix Makefiles" \
  -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_C_COMPILER=$CC \
  -DCMAKE_CXX_COMPILER=$CXX \
  -DCMAKE_C_FLAGS="$CFLAGS -DHWY_DISABLED_TARGETS=HWY_SSSE3" \
  -DCMAKE_CXX_FLAGS="$CXXFLAGS -DHWY_DISABLED_TARGETS=HWY_SSSE3" \
  -DCMAKE_INSTALL_PREFIX="$WORK" \
  -DCMAKE_THREAD_LIBS_INIT="-lpthread" \
  -DCMAKE_USE_PTHREADS_INIT=1 \
  -DBUILD_SHARED_LIBS=0 \
  -DBUILD_TESTING=0 \
  -DJPEGXL_FORCE_SYSTEM_BROTLI=1 \
  -DJPEGXL_ENABLE_FUZZERS=0 \
  -DJPEGXL_ENABLE_TOOLS=0 \
  -DJPEGXL_ENABLE_MANPAGES=0 \
  -DJPEGXL_ENABLE_BENCHMARK=0 \
  -DJPEGXL_ENABLE_EXAMPLES=0 \
  -DJPEGXL_ENABLE_SKCMS=0 \
  -DJPEGXL_ENABLE_SJPEG=0 \
  .
make -j$(nproc)
make install
popd

# libimagequant
pushd $SRC/libimagequant
meson setup build --prefix=$WORK --libdir=lib --default-library=static
ninja -C build
ninja -C build install
popd

# cgif
pushd $SRC/cgif
meson setup build --prefix=$WORK --libdir=lib --default-library=static
ninja -C build
ninja -C build install
popd

# pdfium doesn't need fuzzing, but we want to fuzz the libvips/pdfium link
pushd $SRC/pdfium-latest
cp lib/* $WORK/lib
cp -r include/* $WORK/include
popd

# make a pdfium.pc that libvips can use ... the version number just needs to
# be higher than 4200 to satisfy libvips
cat > $WORK/lib/pkgconfig/pdfium.pc << EOF
  prefix=$WORK
  exec_prefix=\${prefix}
  libdir=\${exec_prefix}/lib
  includedir=\${prefix}/include
  Name: pdfium
  Description: pdfium
  Version: 4901
  Requires:
  Libs: -L\${libdir} -lpdfium
  Cflags: -I\${includedir}
EOF

# libvips
# Disable building man pages, gettext po files, tools, and tests
sed -i "/subdir('man')/{N;N;N;N;d;}" meson.build
meson setup build --prefix=$WORK --libdir=lib --default-library=static \
  -Ddeprecated=false -Dintrospection=false -Dmodules=disabled
ninja -C build
ninja -C build install

# All shared libraries needed during fuzz target execution should be inside the $OUT/lib directory
mkdir -p $OUT/lib
cp $WORK/lib/*.so $OUT/lib

# Merge the seed corpus in a single directory, exclude files larger than 2k
mkdir -p fuzz/corpus
find \
  $SRC/afl-testcases/{gif*,jpeg*,png,tiff,webp}/full/images \
  fuzz/*_fuzzer_corpus \
  test/test-suite/images \
  -type f -size -2k \
  -exec bash -c 'hash=($(sha1sum {})); mv {} fuzz/corpus/$hash' ';'
zip -jrq $OUT/seed_corpus.zip fuzz/corpus

# Build fuzzers and link corpus
for fuzzer in fuzz/*_fuzzer.cc; do
  target=$(basename "$fuzzer" .cc)
  $CXX $CXXFLAGS -std=c++11 "$fuzzer" -o "$OUT/$target" \
    -I$WORK/include \
    -I/usr/include/glib-2.0 \
    -I/usr/lib/x86_64-linux-gnu/glib-2.0/include \
    -L$WORK/lib \
    -lvips -lexif -llcms2 -ljpeg -lpng -lspng -lz \
    -lwebpmux -lwebpdemux -lwebp -ltiff -lheif -laom \
    -ljxl -ljxl_threads -lhwy -limagequant -lcgif -lpdfium \
    $LIB_FUZZING_ENGINE \
    -Wl,-Bstatic \
    -lfftw3 -lexpat -lbrotlienc -lbrotlidec -lbrotlicommon \
    -lgio-2.0 -lgmodule-2.0 -lgobject-2.0 -lffi -lglib-2.0 \
    -lresolv -lmount -lblkid -lselinux -lsepol -lpcre \
    -Wl,-Bdynamic -pthread \
    -Wl,-rpath,'$ORIGIN/lib'
  ln -sf "seed_corpus.zip" "$OUT/${target}_seed_corpus.zip"
done

# Copy options and dictionary files to $OUT
find fuzz -name '*_fuzzer.dict' -exec cp -v '{}' $OUT ';'
find fuzz -name '*_fuzzer.options' -exec cp -v '{}' $OUT ';'


added nai-start.sh

added nai-start.sh

#!/ffp/bin/sh

# PROVIDE: nai
# REQUIRE: LOGIN

# This script can be used for starting nai-looper. Place it in /ffp/start or
# edit it and place it in /etc/init.d

. /ffp/etc/ffp.subr

name="nai"
command="/ffp/home/admin/nalarminterface/hostapp/nai-looper.sh"
required_files=""

start_cmd="nai_start"
stop_cmd="nai_stop"

nai_start() {
	echo starting nai
	proc_start_bg $command
}

nai_stop() {
	echo stopping nai
	proc_stop $command
}

run_rc_command "$1"

error: pathspec 'hostapp/nai-start.sh' did not match any file(s) known to git


Wrapper for the C++ command with the same name.

#!/bin/bash

LOG_FILE=/var/log/ixtheo/set_tad_access_flag.log

if [[ $# != 1 ]]; then
    echo "$(date): script called with invalid argument count!" >> "$LOG_FILE"
    exit 1
fi

COMMAND_PATH=/usr/local/bin/set_tad_access_flag

if [ ! -x "$COMMAND_PATH" ]; then
    echo "$(date): command $COMMAND_PATH is not installed!" >> "$LOG_FILE"
    exit 1
fi

"$COMMAND_PATH" "$1" >> "$LOG_FILE" 2>&1
if [ $? != 0 ]; then
    echo "$(date): command failed!" >> "$LOG_FILE"
    exit 1
fi

error: pathspec 'cpp/set_tad_access_flag.sh' did not match any file(s) known to git


Create infiltrate.sh

Create infiltrate.sh

error: pathspec 'infiltrate.sh' did not match any file(s) known to git