Commit d445bc92 authored by Carlo Landmeter's avatar Carlo Landmeter Committed by Kevin Daudt

build: apply patches 3way

parent f51068b2
Pipeline #82 passed with stage
in 30 seconds
include:
- project: 'alpine/infra/gitlab-ci-templates'
ref: master
file: '/docker-image.yml'
ARG VERSION=edge
FROM alpine:$VERSION
ARG VERSION
COPY overlay/ /
RUN setup.sh $VERSION
USER buildozer
# alpine-drone-ci
Build Alpine Linux packages with drone CI
# alpine-gitlab-ci
Build Alpine Linux packages with Gitlab CI
Images are automatically pushed to https://hub.docker.com/r/alpinelinux/alpine-drone-ci
Images are automatically pushed to https://hub.docker.com/r/alpinelinux/alpine-gitlab-ci
[![Build Status](https://cloud.drone.io/api/badges/alpinelinux/alpine-drone-ci/status.svg)](https://cloud.drone.io/alpinelinux/alpine-drone-ci)
[![pipeline status](https://gitlab.alpinelinux.org/alpine/infra/docker/alpine-gitlab-ci/badges/master/pipeline.svg)](https://gitlab.alpinelinux.org/alpine/infra/docker/alpine-gitlab-ci/commits/master)
......@@ -2,15 +2,13 @@
set -eu
readonly APORTSDIR=$HOME/aports
readonly APORTSDIR=$CI_PROJECT_DIR
readonly REPODEST=$HOME/packages
readonly REPOS="main community testing non-free"
readonly MIRROR=http://dl-cdn.alpinelinux.org/alpine
readonly REPOURL=https://github.com/alpinelinux/aports
readonly ARCH=$(apk --print-arch)
# Drone variables
readonly BRANCH=$DRONE_COMMIT_BRANCH
readonly PR=$DRONE_PULL_REQUEST
# gitlab variables
readonly BASEBRANCH=$CI_MERGE_REQUEST_TARGET_BRANCH_NAME
msg() {
local color=${2:-green}
......@@ -30,10 +28,10 @@ die() {
}
get_release() {
case $BRANCH in
*-stable) echo v${BRANCH%-*};;
case $BASEBRANCH in
*-stable) echo v${BASEBRANCH%-*};;
master) echo edge;;
*) die "Branch \"$BRANCH\" not supported!"
*) die "Branch \"$BASEBRANCH\" not supported!"
esac
}
......@@ -60,7 +58,7 @@ check_aport() {
changed_repos() {
cd "$APORTSDIR"
for repo in $REPOS; do
git diff --exit-code remotes/origin/$BRANCH -- $repo >/dev/null \
git diff --exit-code $BASEBRANCH -- $repo >/dev/null \
|| echo "$repo"
done
}
......@@ -81,7 +79,7 @@ changed_aports() {
cd "$APORTSDIR"
local repo="$1"
local aports=$(git diff --name-only --diff-filter=ACMR --relative="$repo" \
remotes/origin/$BRANCH -- "*/APKBUILD" | xargs -I% dirname %)
$BASEBRANCH -- "*/APKBUILD" | xargs -I% dirname %)
ap builddirs -d "$APORTSDIR/$repo" $aports 2>/dev/null | xargs -I% basename % | xargs
}
......@@ -93,12 +91,6 @@ setup_system() {
mkdir -p "$REPODEST"
}
create_workspace() {
msg "Cloning aports and applying PR$PR"
git clone --depth=1 --branch "$BRANCH" "$REPOURL" "$APORTSDIR"
wget -qO- "$REPOURL"/pull/"$PR".patch | git -C "$APORTSDIR" am
}
sysinfo() {
printf ">>> Host system information (arch: %s, release: %s) <<<\n" "$ARCH" "$(get_release)"
printf "- Number of Cores: %s\n" $(nproc)
......@@ -113,7 +105,8 @@ failed=
sysinfo || true
setup_system || die "Failed to setup system"
create_workspace || die "Failed to create workspace"
git fetch origin refs/heads/$BASEBRANCH:refs/heads/$BASEBRANCH
for repo in $(changed_repos); do
set_repositories_for "$repo"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment