Move more slave scripts over from project-config

These scripts are only used by legacy jobs that life in this repo, move
them over from project-config.

Change-Id: Idaf775d0e9ac46f8f7d17f34c85e0f7d62f9efa8
This commit is contained in:
Andreas Jaeger 2018-02-09 08:06:37 +01:00
parent 842f241618
commit 1bfcaa3d0f
5 changed files with 126 additions and 0 deletions

View File

@ -0,0 +1,48 @@
#!/bin/bash
#
# Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# 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.
#
# Upload java binaries to maven repositories
PROJECT=$1
VERSION=$2
META_DATA_FILE=$3
PLUGIN_FILE=$4
# Strip project name and extension leaving only the version.
VERSION=$(echo ${PLUGIN_FILE} | sed -n "s/${PROJECT}-\(.*\).hpi/\1/p")
# generate pom file with version info
POM_IN_ZIP=$(unzip -Z -1 ${PLUGIN_FILE}|grep pom.xml)
unzip -o -j ${PLUGIN_FILE} ${POM_IN_ZIP}
sed "s/\${{project-version}}/${VERSION}/g" <pom.xml >${META_DATA_FILE}
# deploy plugin artifacts from workspace to repo.jenkins-ci.org
JENKINSCI_REPO="http://repo.jenkins-ci.org/list/releases/org/jenkins-ci/plugins"
JENKINSCI_REPO_CREDS="/home/jenkins/.jenkinsci-curl"
curl -X PUT \
--config ${JENKINSCI_REPO_CREDS} \
--data-binary @${META_DATA_FILE} \
-i "${JENKINSCI_REPO}/${PROJECT}/${VERSION}/${META_DATA_FILE}" \
> /dev/null 2>&1
curl -X PUT \
--config ${JENKINSCI_REPO_CREDS} \
--data-binary @${PLUGIN_FILE} \
-i "${JENKINSCI_REPO}/${PROJECT}/${VERSION}/${PLUGIN_FILE}" \
> /dev/null 2>&1
exit $?

View File

@ -0,0 +1,12 @@
#!/bin/bash -xe
# Build a Laravel/PHP distribution using composer.
cat >bootstrap/environment.php <<EOF
<?php
\$env = \$app->detectEnvironment(function()
{
return 'dev';
});
EOF
curl -s https://getcomposer.org/installer | /usr/bin/php
php composer.phar install --prefer-dist --ignore-platform-reqs

View File

@ -0,0 +1,33 @@
#!/bin/bash -xe
# Copyright 2013 OpenStack Foundation
#
# 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.
command=$1
rm -f dist/*.tar.gz
venv=grunt
VDISPLAY=99
DIMENSIONS='1280x1024x24'
set +e
/usr/bin/Xvfb :${VDISPLAY} -screen 0 ${DIMENSIONS} 2>&1 > /dev/null &
DISPLAY=:${VDISPLAY} tox -e$venv $command
result=$?
pkill Xvfb 2>&1 > /dev/null
set -e
exit $result

View File

@ -0,0 +1,29 @@
#!/bin/bash -ex
#
# This is a script that helps us version build artifacts. It retrieves
# git info and generates version strings.
#
# get version info from scm
SCM_TAG=$(git describe --abbrev=0 --tags) || true
SCM_SHA=$(git rev-parse --short HEAD) || true
# assumes format is like this '0.0.4-2-g135721c'
COMMITS_SINCE_TAG=$(git describe | awk '{split($0,a,"-"); print a[2]}') || true
# just use git sha if there is no tag yet.
if [[ "${SCM_TAG}" == "" ]]; then
SCM_TAG=$SCM_SHA
fi
# General build version should be something like '0.0.4.3.d4ee90c'
# Release build version should be something like '0.0.5'
if [[ "${COMMITS_SINCE_TAG}" == "" ]]; then
PROJECT_VER=$SCM_TAG
else
PROJECT_VER="$SCM_TAG.$COMMITS_SINCE_TAG.$SCM_SHA";
fi
echo "SCM_SHA=$SCM_SHA" >version.properties
echo "PROJECT_VER=$PROJECT_VER" >>version.properties
echo "COMMITS_SINCE_TAG=$COMMITS_SINCE_TAG" >>version.properties

View File

@ -6,5 +6,9 @@
mode: 0755
with_items:
- install-distro-packages.sh
- jenkinsci-upload.sh
- php-laravel-build.sh
- run-jsbuild.sh
- version-properties.sh
- zuul-sudo-grep.sh
become: true