Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pmaports
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
postmarketOS
pmaports
Commits
d254a8dd
Verified
Commit
d254a8dd
authored
6 months ago
by
Clayton Craft
Browse files
Options
Downloads
Patches
Plain Diff
DO NOT MERGE: yaaaaay debugging CI again...
parent
f5ec9c7c
No related branches found
No related tags found
No related merge requests found
Pipeline
#208361
failed
6 months ago
Stage: lint
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.ci/pytest.sh
+1
-1
1 addition, 1 deletion
.ci/pytest.sh
install_pmbootstrap.sh
+140
-0
140 additions, 0 deletions
install_pmbootstrap.sh
with
141 additions
and
1 deletion
.ci/pytest.sh
+
1
−
1
View file @
d254a8dd
...
...
@@ -8,7 +8,7 @@
if
[
"
$(
id
-u
)
"
=
0
]
;
then
set
-x
wget
"https://gitlab.postmarketos.org/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
#
wget "https://gitlab.postmarketos.org/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
sh ./install_pmbootstrap.sh pytest
exec
su
"
${
TESTUSER
:-
pmos
}
"
-c
"sh -e
$0
"
fi
...
...
This diff is collapsed.
Click to expand it.
install_pmbootstrap.sh
0 → 100644
+
140
−
0
View file @
d254a8dd
#!/bin/sh -e
# Copyright 2020 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
# usage: install_pmbootstrap.sh [ADDITIONAL_PACKAGE, ...]
set
-x
:
"
${
PMBOOTSTRAP_TAG
:
=
"master"
}
"
:
"
${
PMBOOTSTRAP_URL
:
=
"https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git"
}
"
# Add the "origin-original" remote to an existing pmaports.git clone, so
# pmbootstrap can use its channels.cfg.
add_remote_origin_original
()
{
# Skip if existing (happens in single runner setup)
remote_url
=
"https://gitlab.postmarketos.org/postmarketOS/pmaports.git"
remote_url_existing
=
"
$(
git
-C
"
$pmaports
"
\
remote get-url origin-original 2>/dev/null
\
||
true
)
"
if
[
"
$remote_url
"
=
"
$remote_url_existing
"
]
;
then
echo
"Remote 'origin-original' is already configured"
git
-C
"
$pmaports
"
fetch
-q
origin-original
return
fi
# Mark pmaports dir as 'safe directory', so git doesn't complain about
# it being owned by another user.
git config
--global
--add
safe.directory
"
$pmaports
"
su pmos
-c
"git config --global --add safe.directory '
$pmaports
'"
# Add the remote, display the output only on error
if
!
git
-C
"
$pmaports
"
\
remote add
-f
origin-original
\
"https://gitlab.postmarketos.org/postmarketOS/pmaports.git"
\
>
/tmp/git_remote_add 2>&1
;
then
echo
"ERROR: failed to add original remote with git!"
echo
cat
/tmp/git_remote_add
exit
1
fi
# Make sure everyone can write to the repo later, since CI runs as several
# different users (root, TESTUSER/pmos, build)
chmod
-R
go+w
"
$pmaports
/.git"
}
# Set up depends
depends
=
"
coreutils
git
losetup
openssl
procps
python3
sudo
$*
"
printf
"Installing dependencies:"
for
i
in
$depends
;
do
printf
"%s"
"
$i
"
done
printf
"
\n
"
# shellcheck disable=SC2086
apk
-q
add
$depends
# Force IPv4 for gitlab.postmarketos.org until it supports IPv6 too, OSUOSL is
# working on it (infra#195)
echo
"140.211.167.182 gitlab.postmarketos.org"
>>
/etc/hosts
# Set up binfmt_misc
if
!
mount |
grep
-q
/proc/sys/fs/binfmt_misc
;
then
mount
-t
binfmt_misc none /proc/sys/fs/binfmt_misc
fi
# Create pmos user
if
id
"pmos"
>
/dev/null 2>&1
;
then
echo
"User 'pmos' exists already"
else
echo
"Creating pmos user"
adduser
-D
pmos
chown
-R
pmos:pmos
.
echo
'pmos ALL=(ALL) NOPASSWD: ALL'
>>
/etc/sudoers
fi
# pmaports: either checked out in current dir, or let pmbootstrap download it
pmaports
=
"
$(
cd
"
$(
dirname
"
$0
"
)
"
;
pwd
-P
)
"
pmaports_arg
=
""
if
[
-e
"
$pmaports
/pmaports.cfg"
]
;
then
CFG
=
"pmbootstrap_v3.cfg"
if
[
"
$PMBOOTSTRAP_TAG
"
=
"2.3.x"
]
;
then
CFG
=
"pmbootstrap.cfg"
fi
echo
"pmbootstrap config file:
$CFG
"
echo
"Found pmaports.cfg in current dir"
pmaports_arg
=
"--aports '
$pmaports
'"
add_remote_origin_original
# Use the channel of the current branch
mkdir
-p
~pmos/.config
(
echo
"[pmbootstrap]"
echo
"is_default_channel = False"
)
>
~pmos/.config/
"
$CFG
"
chown
-R
pmos:pmos ~pmos/.config
fi
# Download pmbootstrap (to /tmp/pmbootstrap)
echo
"Downloading pmbootstrap (
$PMBOOTSTRAP_TAG
):
$PMBOOTSTRAP_URL
"
cd
/tmp
rm
-rf
pmbootstrap
git clone
-q
"
$PMBOOTSTRAP_URL
"
pmbootstrap
git
-C
pmbootstrap checkout
-q
"
$PMBOOTSTRAP_TAG
"
# Install to $PATH and init
ln
-sf
/tmp/pmbootstrap/pmbootstrap.py /usr/local/bin/pmbootstrap
echo
"Initializing pmbootstrap"
if
!
su pmos
-c
"yes '' | pmbootstrap
\
$pmaports_arg
\
--details-to-stdout
\
init
\
>/tmp/pmb_init 2>&1"
;
then
cat
/tmp/pmb_init
echo
echo
"ERROR: pmbootstrap init failed!"
echo
echo
"Most likely, this gets fixed by rebasing on master (or whatever"
echo
"branch yours is based on). Please do this and try again."
echo
echo
"Let us know in the chat or issues if you have trouble with that"
echo
"and we will be happy to help. Sorry for the inconvenience."
exit
1
fi
echo
""
# Workaround for pmb#2412: currently the pmaports_arg gets ignored in pmb v3,
# so let pmbootstrap clone pmaports in the default dir during init, then change
# the pmaports path to the one from the current merge request.
if
[
"
$PMBOOTSTRAP_TAG
"
!=
"2.3.x"
]
&&
[
-n
"
$pmaports_arg
"
]
;
then
su - pmos
-c
"pmbootstrap config aports '
$pmaports
'"
fi
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment