Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7de5a7edc3 | ||
|
|
80ab30469e | ||
| 4dfd098545 | |||
| 3929851deb | |||
| e6f722914c | |||
| d4ab170b3c | |||
| 487d8eb287 | |||
| c7aca7cd73 | |||
| bdcb2f3173 | |||
|
|
e81ec3aa0c | ||
| 64e382b46e | |||
| add7bbcf88 | |||
|
|
377bd2a915 | ||
|
|
7782f928c2 |
@@ -27,6 +27,11 @@ addons:
|
||||
- g++-mingw-w64-i686
|
||||
- g++-mingw-w64-x86-64
|
||||
- qemu-system-x86
|
||||
homebrew:
|
||||
packages:
|
||||
- re2c
|
||||
- bash
|
||||
update: true
|
||||
|
||||
install:
|
||||
- ./travis/prepare.sh
|
||||
@@ -126,7 +131,6 @@ jobs:
|
||||
- env: SET=test01 SNCSEQ=master
|
||||
os: osx
|
||||
compiler: clang
|
||||
addons: { homebrew: { packages: ["re2c"], update: true } }
|
||||
|
||||
# Base 3.15 builds
|
||||
# ================
|
||||
@@ -155,7 +159,6 @@ jobs:
|
||||
- env: BASE=R3.15.7 SET=test01 SNCSEQ=master
|
||||
os: osx
|
||||
compiler: clang
|
||||
addons: { homebrew: { packages: ["re2c"], update: true } }
|
||||
|
||||
# Base 3.14 builds
|
||||
# ================
|
||||
@@ -175,4 +178,3 @@ jobs:
|
||||
- env: BASE=R3.14.12.8 SET=test01 SNCSEQ=master
|
||||
os: osx
|
||||
compiler: clang
|
||||
addons: { homebrew: { packages: ["re2c"], update: true } }
|
||||
|
||||
65
LICENSE
Normal file
65
LICENSE
Normal file
@@ -0,0 +1,65 @@
|
||||
Copyright (c) 2019 EPICS. All rights reserved.
|
||||
|
||||
EPICS CI-Scripts are distributed subject to the following
|
||||
license conditions:
|
||||
|
||||
SOFTWARE LICENSE AGREEMENT
|
||||
Software: EPICS CI-Scripts
|
||||
|
||||
1. The "Software", below, refers to EPICS CI-Scripts (in
|
||||
either source code, or binary form and accompanying documentation).
|
||||
Each licensee is addressed as "you" or "Licensee."
|
||||
|
||||
2. The copyright holders shown above and their third-party licensors
|
||||
hereby grant Licensee a royalty-free nonexclusive license, subject to
|
||||
the limitations stated herein and U.S. Government license rights.
|
||||
|
||||
3. You may modify and make a copy or copies of the Software for use
|
||||
within your organization, if you meet the following conditions:
|
||||
a. Copies in source code must include the copyright notice and this
|
||||
Software License Agreement.
|
||||
b. Copies in binary form must include the copyright notice and this
|
||||
Software License Agreement in the documentation and/or other
|
||||
materials provided with the copy.
|
||||
|
||||
4. You may modify a copy or copies of the Software or any portion of it,
|
||||
thus forming a work based on the Software, and distribute copies of
|
||||
such work outside your organization, if you meet all of the following
|
||||
conditions:
|
||||
a. Copies in source code must include the copyright notice and this
|
||||
Software License Agreement;
|
||||
b. Copies in binary form must include the copyright notice and this
|
||||
Software License Agreement in the documentation and/or other
|
||||
materials provided with the copy;
|
||||
c. Modified copies and works based on the Software must carry
|
||||
prominent notices stating that you changed specified portions of
|
||||
the Software.
|
||||
|
||||
5. Portions of the Software resulted from work developed under a U.S.
|
||||
Government contract and are subject to the following license: the
|
||||
Government is granted for itself and others acting on its behalf a
|
||||
paid-up, nonexclusive, irrevocable worldwide license in this computer
|
||||
software to reproduce, prepare derivative works, and perform publicly
|
||||
and display publicly.
|
||||
|
||||
6. WARRANTY DISCLAIMER. THE SOFTWARE IS SUPPLIED "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND. THE COPYRIGHT HOLDERS, THEIR THIRD PARTY LICENSORS, THE
|
||||
UNITED STATES, THE UNITED STATES DEPARTMENT OF ENERGY, AND THEIR
|
||||
EMPLOYEES: (1) DISCLAIM ANY WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
|
||||
BUT NOT LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE, TITLE OR NON-INFRINGEMENT, (2) DO NOT ASSUME
|
||||
ANY LEGAL LIABILITY OR RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS,
|
||||
OR USEFULNESS OF THE SOFTWARE, (3) DO NOT REPRESENT THAT USE OF THE
|
||||
SOFTWARE WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS, (4) DO NOT WARRANT
|
||||
THAT THE SOFTWARE WILL FUNCTION UNINTERRUPTED, THAT IT IS ERROR-FREE
|
||||
OR THAT ANY ERRORS WILL BE CORRECTED.
|
||||
|
||||
7. LIMITATION OF LIABILITY. IN NO EVENT WILL THE COPYRIGHT HOLDERS, THEIR
|
||||
THIRD PARTY LICENSORS, THE UNITED STATES, THE UNITED STATES DEPARTMENT
|
||||
OF ENERGY, OR THEIR EMPLOYEES: BE LIABLE FOR ANY INDIRECT, INCIDENTAL,
|
||||
CONSEQUENTIAL, SPECIAL OR PUNITIVE DAMAGES OF ANY KIND OR NATURE,
|
||||
INCLUDING BUT NOT LIMITED TO LOSS OF PROFITS OR LOSS OF DATA, FOR ANY
|
||||
REASON WHATSOEVER, WHETHER SUCH LIABILITY IS ASSERTED ON THE BASIS OF
|
||||
CONTRACT, TORT (INCLUDING NEGLIGENCE OR STRICT LIABILITY), OR
|
||||
OTHERWISE, EVEN IF ANY OF SAID PARTIES HAS BEEN WARNED OF THE
|
||||
POSSIBILITY OF SUCH LOSS OR DAMAGES.
|
||||
25
README.md
25
README.md
@@ -1,3 +1,5 @@
|
||||
<a target="_blank" href="http://semver.org">![Version][badge.version]</a>
|
||||
|
||||
# Continuous Integration Scripts for EPICS Modules
|
||||
|
||||
The scripts inside this repository are intended to provide a common,
|
||||
@@ -119,7 +121,7 @@ empty. That way any settings can be overridden by settings in `.travis.yml`.
|
||||
|
||||
Empty lines or lines starting with `#` are ignored.
|
||||
|
||||
`MODULES="<list of names>"` should list the dependencies (software modules)
|
||||
`MODULES=<list of names>` should list the dependencies (software modules)
|
||||
by using their well-known slugs, separated by spaces.
|
||||
EPICS Base (slug: `base`) will always be a dependency and will be added and
|
||||
compiled first. The other dependencies are added and compiled in the order
|
||||
@@ -133,9 +135,7 @@ For any module mentioned as `foo` in the `MODULES` setting (and for `BASE`),
|
||||
the following settings can be configured:
|
||||
|
||||
`FOO=<version>` Set version of the module that should be used. Must either
|
||||
be a *tag* name (in that case the module is checked out into Travis' cache
|
||||
system) or a *branch* name (in that case the module is always checked out
|
||||
and recompiled as part of the job). [default: `master`]
|
||||
be a *tag* name or a *branch* name. [default: `master`]
|
||||
|
||||
`FOO_REPONAME=<name>` Set the name of the remote repository as `<name>.git`.
|
||||
[default is the slug in lower case: `foo`]
|
||||
@@ -143,7 +143,8 @@ and recompiled as part of the job). [default: `master`]
|
||||
`FOO_REPOOWNER=<name>` Set the name of the GitHub owner (or organization)
|
||||
that the module repository can be found under.
|
||||
|
||||
`FOO_REPOURL="<url>"` Set the complete URL of the remote repository.
|
||||
`FOO_REPOURL="<url>"` Set the complete URL of the remote repository. Useful
|
||||
for dependencies that are not hosted on GitHub.
|
||||
|
||||
The default URL for the repository is pointing to GitHub, under
|
||||
`$FOO_REPOOWNER` else `$REPOOWNER` else `epics-modules`,
|
||||
@@ -180,6 +181,8 @@ executed and switching the dependency builds to higher verbosity.
|
||||
|
||||
## Release Numbering of this Module
|
||||
|
||||
The module uses [Semantic Versioning](https://semver.org/).
|
||||
|
||||
Major release numbers refer to the API, which is more or less defined
|
||||
by the full configuration examples in the service specific
|
||||
subdirectories.
|
||||
@@ -187,8 +190,8 @@ If one of these files has to be changed for the existing configuration
|
||||
options or important new options are being added, a new major release
|
||||
is created.
|
||||
|
||||
Minor release numbers refer to bugfixes that should not require the
|
||||
configuration inside a user module to be changed.
|
||||
Minor release numbers refer to additions and enhancements that do not
|
||||
require the configuration inside an existing user module to be changed.
|
||||
|
||||
Again: using the git submodule mechanism to include these scripts means
|
||||
that user modules always work with a fixed, frozen version.
|
||||
@@ -196,3 +199,11 @@ I.e., developments in the ci-scripts repository will never break an\
|
||||
existing application.
|
||||
These release numbering considerations are just a hint to assess the
|
||||
risks when updating the submodule.
|
||||
|
||||
## License
|
||||
|
||||
This module is distributed subject to a Software License Agreement found
|
||||
in file LICENSE that is included with this distribution.
|
||||
|
||||
<!-- Links -->
|
||||
[badge.version]: https://badge.fury.io/gh/epics-base%2Fci-scripts.png
|
||||
|
||||
@@ -27,7 +27,7 @@ fn_exists() {
|
||||
|
||||
repo_exists() {
|
||||
DEP=$1
|
||||
dep_lc=$(echo $DEP | tr 'A-Z' 'a-z')
|
||||
dep_lc=${DEP,,}
|
||||
eval dirname=\${${DEP}_DIRNAME:=${dep_lc}}
|
||||
eval reponame=\${${DEP}_REPONAME:=${dep_lc}}
|
||||
eval repourl=\${${DEP}_REPOURL:="https://github.com/\${${DEP}_REPOOWNER:=${REPOOWNER:-epics-modules}}/${reponame}.git"}
|
||||
@@ -35,7 +35,7 @@ repo_exists() {
|
||||
git ls-remote --quiet --heads --exit-code $repourl > /dev/null 2>&1
|
||||
}
|
||||
|
||||
SETUP_DIRS=$(echo $SETUP_PATH | tr ":" "\n")
|
||||
SETUP_DIRS=${SETUP_PATH//:/ }
|
||||
|
||||
SCRIPTDIR=$(dirname $(readlinkf $0))/travis
|
||||
CURDIR="$PWD"
|
||||
|
||||
@@ -29,6 +29,13 @@ addons:
|
||||
- g++-mingw-w64-x86-64
|
||||
# for RTEMS cross builds
|
||||
- qemu-system-x86
|
||||
homebrew:
|
||||
packages:
|
||||
# for all EPICS builds
|
||||
- bash
|
||||
# for the sequencer
|
||||
- re2c
|
||||
update: true
|
||||
|
||||
install:
|
||||
- ./.ci/travis/prepare.sh
|
||||
@@ -108,4 +115,3 @@ jobs:
|
||||
- env: BASE=7.0
|
||||
os: osx
|
||||
compiler: clang
|
||||
addons: { homebrew: { packages: ["re2c"], update: true } }
|
||||
|
||||
@@ -1,14 +1,24 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# The following if clause can be removed for ci-scripts major version 3
|
||||
if [ "$TRAVIS_OS_NAME" == osx -a "$BASH_VERSINFO" -lt 4 ]
|
||||
then
|
||||
brew install bash
|
||||
if [ $(/usr/local/bin/bash -c 'echo $BASH_VERSINFO') -lt 4 ]
|
||||
then
|
||||
echo "Failed to install a recent bash" >&2
|
||||
exit 1
|
||||
fi
|
||||
exec /usr/local/bin/bash $0 "$@"
|
||||
fi
|
||||
|
||||
# Set VV in .travis.yml to make scripts verbose
|
||||
[ "$VV" ] && set -x
|
||||
|
||||
# Perl version of "readlink -f" (which MacOS does not provide)
|
||||
readlinkf() { perl -MCwd -e 'print Cwd::abs_path shift' "$1"; }
|
||||
|
||||
SETUP_DIRS=$(echo $SETUP_PATH | tr ":" "\n")
|
||||
|
||||
SCRIPTDIR=$(dirname $(readlinkf $0))
|
||||
CURDIR="$PWD"
|
||||
CACHEDIR="$HOME/.cache"
|
||||
@@ -16,6 +26,8 @@ CACHEDIR="$HOME/.cache"
|
||||
# source functions
|
||||
. $SCRIPTDIR/utils.sh
|
||||
|
||||
echo -e "${ANSI_YELLOW}Using bash version $BASH_VERSION${ANSI_RESET}"
|
||||
|
||||
# Load settings
|
||||
# -------------
|
||||
|
||||
@@ -36,7 +48,7 @@ fold_start check.out.dependencies "Checking/cloning dependencies"
|
||||
|
||||
for mod in BASE $MODULES
|
||||
do
|
||||
mod_uc=$(echo $mod | tr 'a-z' 'A-Z')
|
||||
mod_uc=${mod^^}
|
||||
eval add_dependency $mod_uc \${${mod_uc}:=master}
|
||||
done
|
||||
[ -e ./configure ] && cp ${CACHEDIR}/RELEASE.local ./configure/RELEASE.local
|
||||
@@ -151,7 +163,7 @@ EOF
|
||||
fi
|
||||
|
||||
else
|
||||
echo "${ANSI_GREEN}EPICS build system already set up (Base was loaded from cache)${ANSI_RESET}"
|
||||
echo -e "${ANSI_GREEN}EPICS build system already set up (Base was loaded from cache)${ANSI_RESET}"
|
||||
fi
|
||||
|
||||
# Download RTEMS cross compiler
|
||||
@@ -174,7 +186,7 @@ fold_start build.dependencies "Build missing/outdated dependencies"
|
||||
|
||||
[ "$VV" ] && silent="-s" || silent=
|
||||
|
||||
[ -z "$modules_to_compile" ] && echo "${ANSI_GREEN}All dependency modules are up-to-date (nothing to do)${ANSI_RESET}"
|
||||
[ -z "$modules_to_compile" ] && echo -e "${ANSI_GREEN}All dependency modules are up-to-date (nothing to do)${ANSI_RESET}"
|
||||
|
||||
for module in ${modules_to_compile}
|
||||
do
|
||||
@@ -186,13 +198,13 @@ done
|
||||
|
||||
fold_end build.dependencies
|
||||
|
||||
echo "${ANSI_BLUE}Dependency module information${ANSI_RESET}"
|
||||
echo -e "${ANSI_BLUE}Dependency module information${ANSI_RESET}"
|
||||
|
||||
echo "Module Tag Binaries Commit"
|
||||
echo "-----------------------------------------------------------------------------------"
|
||||
for mod in base $MODULES
|
||||
do
|
||||
mod_uc=$(echo $mod | tr 'a-z' 'A-Z')
|
||||
mod_uc=${mod^^}
|
||||
eval tag=\${${mod_uc}}
|
||||
eval dir=${CACHEDIR}/\${${mod_uc}_DIRNAME}-$tag
|
||||
echo "$modules_to_compile" | grep -q "$dir" && stat="rebuilt" || stat="from cache"
|
||||
@@ -200,5 +212,5 @@ do
|
||||
printf "%-10s %-12s %-11s %s\n" "$mod" "$tag" "$stat" "$commit"
|
||||
done
|
||||
|
||||
echo "${ANSI_BLUE}Contents of RELEASE.local${ANSI_RESET}"
|
||||
echo -e "${ANSI_BLUE}Contents of RELEASE.local${ANSI_RESET}"
|
||||
cat ${CACHEDIR}/RELEASE.local
|
||||
|
||||
@@ -22,28 +22,29 @@ export ANSI_CLEAR="\033[0K"
|
||||
# from https://github.com/travis-ci/travis-rubies/blob/build/build.sh
|
||||
|
||||
fold_start() {
|
||||
echo -en "travis_fold:start:$1\\r${ANSI_YELLOW}$2${ANSI_RESET}"
|
||||
echo -e "travis_fold:start:$1\\r${ANSI_YELLOW}$2${ANSI_RESET}"
|
||||
}
|
||||
|
||||
fold_end() {
|
||||
echo -en "travis_fold:end:$1\\r"
|
||||
}
|
||||
|
||||
die() {
|
||||
echo -e "${ANSI_RED}$1${ANSI_RESET}"
|
||||
[ "$UTILS_UNITTEST" ] || exit 1
|
||||
}
|
||||
|
||||
# source_set(settings)
|
||||
#
|
||||
# Source a settings file (extension .set) found in the SETUP_DIRS path
|
||||
# Source a settings file (extension .set) found in SETUP_PATH
|
||||
# May be called recursively (from within a settings file)
|
||||
declare -a SEEN_SETUPS
|
||||
source_set() {
|
||||
local set_file=${1//[$'\r']}
|
||||
local set_dir
|
||||
local found=0
|
||||
if [ -z "${SETUP_DIRS}" ]
|
||||
then
|
||||
echo "${ANSI_RED}Search path for setup files (SETUP_PATH) is empty${ANSI_RESET}"
|
||||
[ "$UTILS_UNITTEST" ] || exit 1
|
||||
fi
|
||||
for set_dir in ${SETUP_DIRS}
|
||||
[ "${SETUP_PATH}" ] || die "Search path for setup files (SETUP_PATH) is empty"
|
||||
for set_dir in ${SETUP_PATH//:/ }
|
||||
do
|
||||
if [ -e $set_dir/$set_file.set ]
|
||||
then
|
||||
@@ -75,11 +76,7 @@ source_set() {
|
||||
break
|
||||
fi
|
||||
done
|
||||
if [ $found -eq 0 ]
|
||||
then
|
||||
echo "${ANSI_RED}Setup file $set_file.set does not exist in SETUP_DIRS search path ($SETUP_DIRS)${ANSI_RESET}"
|
||||
[ "$UTILS_UNITTEST" ] || exit 1
|
||||
fi
|
||||
[ $found -ne 0 ] || die "Setup file $set_file.set does not exist in SETUP_PATH search path ($SETUP_PATH)"
|
||||
}
|
||||
|
||||
# update_release_local(varname, place)
|
||||
@@ -135,21 +132,18 @@ add_dependency() {
|
||||
curdir="$PWD"
|
||||
DEP=$1
|
||||
TAG=$2
|
||||
dep_lc=$(echo $DEP | tr 'A-Z' 'a-z')
|
||||
dep_lc=${DEP,,}
|
||||
eval dirname=\${${DEP}_DIRNAME:=${dep_lc}}
|
||||
eval reponame=\${${DEP}_REPONAME:=${dep_lc}}
|
||||
eval repourl=\${${DEP}_REPOURL:="https://github.com/\${${DEP}_REPOOWNER:=${REPOOWNER:-epics-modules}}/${reponame}.git"}
|
||||
eval varname=\${${DEP}_VARNAME:=${DEP}}
|
||||
eval recursive=\${${DEP}_RECURSIVE:=1}
|
||||
recursive=$(echo $recursive | tr 'A-Z' 'a-z')
|
||||
recursive=${recursive,,}
|
||||
[ "$recursive" != "0" -a "$recursive" != "no" ] && recurse="--recursive"
|
||||
|
||||
# determine if $DEP points to a valid release or branch
|
||||
if ! git ls-remote --quiet --exit-code --refs $repourl "$TAG" > /dev/null 2>&1
|
||||
then
|
||||
echo "${ANSI_RED}$TAG is neither a tag nor a branch name for $DEP ($repourl)${ANSI_RESET}"
|
||||
[ "$UTILS_UNITTEST" ] || exit 1
|
||||
fi
|
||||
git ls-remote --quiet --exit-code --refs $repourl "$TAG" > /dev/null 2>&1 ||
|
||||
die "$TAG is neither a tag nor a branch name for $DEP ($repourl)"
|
||||
|
||||
if [ -e $CACHEDIR/$dirname-$TAG ]
|
||||
then
|
||||
@@ -191,8 +185,7 @@ add_dependency() {
|
||||
echo "Running hook $hook in $CACHEDIR/$dirname-$TAG"
|
||||
( cd $CACHEDIR/$dirname-$TAG; "$curdir/$hook" )
|
||||
else
|
||||
echo "${ANSI_RED}Hook script $hook is not executable or does not exist.${ANSI_RESET}"
|
||||
exit 1
|
||||
die "Hook script $hook is not executable or does not exist."
|
||||
fi
|
||||
fi
|
||||
HEAD=$(cd "$CACHEDIR/$dirname-$TAG" && git log -n1 --pretty=format:%H)
|
||||
|
||||
Reference in New Issue
Block a user