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
25380ced
Commit
25380ced
authored
6 years ago
by
Luca Weiss
Committed by
Oliver Smith
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix detecting changed aports
parent
4e940e51
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#191893
passed
6 years ago
Stage: first
Stage: second
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+1
-1
1 addition, 1 deletion
.gitlab-ci.yml
.gitlab-ci/build_changed_aports.py
+17
-10
17 additions, 10 deletions
.gitlab-ci/build_changed_aports.py
with
18 additions
and
11 deletions
.gitlab-ci.yml
+
1
−
1
View file @
25380ced
...
...
@@ -58,7 +58,7 @@ aports-static-upstream:
-
pmbootstrap.cfg
expire_in
:
1 week
only
:
-
master
-
master
@postmarketOS/pmaports
# build changed aports
aports-build
:
...
...
This diff is collapsed.
Click to expand it.
.gitlab-ci/build_changed_aports.py
+
17
−
10
View file @
25380ced
...
...
@@ -32,14 +32,16 @@ def get_changed_files():
commit that was used for the diff.
:returns: list of changed files
"""
# Current branch
branch
=
run_git
([
"
rev-parse
"
,
"
--abbrev-ref
"
,
"
HEAD
"
])[:
-
1
]
print
(
"
branch:
"
+
branch
)
# Commit to diff against
commit
=
"
HEAD~1
"
if
branch
!=
"
master
"
:
commit
=
run_git
([
"
merge-base
"
,
"
master
"
,
"
HEAD
"
])[:
-
1
]
commit_head
=
run_git
([
"
rev-parse
"
,
"
HEAD
"
])[:
-
1
]
commit_upstream_master
=
run_git
([
"
rev-parse
"
,
"
upstream/master
"
])[:
-
1
]
print
(
"
commit HEAD:
"
+
commit_head
)
print
(
"
commit upstream/master:
"
+
commit_upstream_master
)
# Check if we are latest upstream/master
if
commit_head
==
commit_upstream_master
:
commit
=
"
HEAD~1
"
# then compare with previous commit
else
:
commit
=
run_git
([
"
merge-base
"
,
"
upstream/master
"
,
"
HEAD
"
])[:
-
1
]
# otherwise compare with latest common ancestor
print
(
"
comparing HEAD with:
"
+
commit
)
# Changed files
...
...
@@ -77,13 +79,18 @@ def get_changed_packages():
def
check_build
(
packages
):
# Initialize build environment with less logging
run_pmbootstrap
([
"
build_init
"
])
run_pmbootstrap
([
"
--details-to-stdout
"
,
"
build
"
,
"
--strict
"
]
+
run_pmbootstrap
([
"
--details-to-stdout
"
,
"
build
"
,
"
--strict
"
,
"
--force
"
]
+
list
(
packages
))
if
__name__
==
"
__main__
"
:
packages
=
get_changed_packages
()
# Add a remote pointing to postmarketOS/pmaports for later
run_git
([
"
remote
"
,
"
add
"
,
"
upstream
"
,
"
https://gitlab.com/postmarketOS/pmaports.git
"
])
run_git
([
"
fetch
"
,
"
upstream
"
])
# Build changed packages
packages
=
get_changed_packages
()
if
len
(
packages
)
==
0
:
print
(
"
no aports changed in this branch
"
)
else
:
...
...
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