CI: Update core packages before full system upgrade.

This commit is contained in:
Qian Hong
2016-02-18 12:12:33 +08:00
parent 2f7aee1bb6
commit f97cc670e4
2 changed files with 8 additions and 7 deletions

View File

@@ -1,2 +1,4 @@
build_script:
# TODO: implement update-core --noconfirm and replace the below command line
- C:\msys64\usr\bin\pacman --sync --refresh --refresh --needed --noconfirm msys2-runtime msys2-runtime-devel bash pacman pacman-mirrors
- C:\msys64\usr\bin\bash --login -c "$(cygpath ${APPVEYOR_BUILD_FOLDER})/ci-build.sh"

View File

@@ -15,13 +15,7 @@ status() { echo -e "\n${cyan}[MSYS2 CI]${normal} ${@}\n"; }
success() { echo -e "\n${green}[MSYS2 CI] SUCCESS:${normal} ${@}.\n"; exit 0; }
failure() { echo -e "\n${red}[MSYS2 CI] FAILURE:${normal} ${@}.\n"; exit 1; }
gitconf() { test -n "$(git config ${1})" && return 0; git config --global "${1}" "${2}"; }
execute() { status "${package:+$package: }${1}"; ${@:2} || failure "${package}: ${1} failed"; }
# Prepare
# TODO: implement update-core --noconfirm and move update process to outside this script
execute 'Upgrading the system' pacman --sync --refresh --refresh --sysupgrade --noconfirm --noprogressbar
gitconf user.name 'MSYS2 Continuous Integration' || failure 'Could not configure Git for makepkg'
gitconf user.email 'ci@msys2.org' || failure 'Could not configure Git for makepkg'
execute() { status "${package:+$package: }${1}"; ${@:2} || failure "${package:+$package: }${1} failed"; }
# Detect
cd "$(dirname "$0")"
@@ -31,6 +25,11 @@ for file in "${files[@]}"; do [[ "${file}" = */PKGBUILD ]] && packages+=("${file
test -n "${files}" || failure 'Could not detect changed files'
test -z "${packages}" && success 'No changes in package recipes'
# Prepare
execute 'Upgrading the system' pacman --sync --refresh --refresh --sysupgrade --noconfirm --noprogressbar
gitconf user.name 'MSYS2 Continuous Integration' || failure 'Could not configure Git for makepkg'
gitconf user.email 'ci@msys2.org' || failure 'Could not configure Git for makepkg'
# Build and install
status 'Building changed packages:'
for package in "${packages[@]}"; do printf "\t${package}\n"; done