Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PrivateStorageio
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PrivateStorage
PrivateStorageio
Commits
5d97a58b
Commit
5d97a58b
authored
2 years ago
by
Update Bot
Browse files
Options
Downloads
Patches
Plain Diff
A few changes for clarity
parent
413e41a3
No related branches found
No related tags found
2 merge requests
!319
update production
,
!305
Automate updating nixpkgs pin in develop branch once a week
Pipeline
#2374
passed
2 years ago
Stage: test
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ci-tools/update-nixpkgs
+18
-5
18 additions, 5 deletions
ci-tools/update-nixpkgs
with
18 additions
and
5 deletions
ci-tools/update-nixpkgs
+
18
−
5
View file @
5d97a58b
...
@@ -116,9 +116,15 @@ checkout_source_branch() {
...
@@ -116,9 +116,15 @@ checkout_source_branch() {
# tends to like to share across builds) clone it to a new temporary path.
# tends to like to share across builds) clone it to a new temporary path.
git clone . working-copy
git clone . working-copy
cd working-copy
cd working-copy
# Make sure we know the name of a remote that points at the right place.
# Then use it to make sure the base branch is up-to-date. It usually
# should be already but in case it isn't we don't want to start from a
# stale revision.
git remote add upstream gitlab@"$SERVER_HOST":"$PROJECT_PATH".git
git remote add upstream gitlab@"$SERVER_HOST":"$PROJECT_PATH".git
refresh_ssh_key "$SSHKEY"
refresh_ssh_key "$SSHKEY"
git fetch upstream "$DEFAULT_BRANCH"
git fetch upstream "$DEFAULT_BRANCH"
# Typically this tool runs infrequently enough that the branch doesn't
# Typically this tool runs infrequently enough that the branch doesn't
# already exist. However, as a convenience for developing on this tool
# already exist. However, as a convenience for developing on this tool
# itself, if it does already exist, wipe it and start fresh for greater
# itself, if it does already exist, wipe it and start fresh for greater
...
@@ -129,8 +135,8 @@ checkout_source_branch() {
...
@@ -129,8 +135,8 @@ checkout_source_branch() {
git checkout -B "${BRANCH}" upstream/"$DEFAULT_BRANCH"
git checkout -B "${BRANCH}" upstream/"$DEFAULT_BRANCH"
}
}
#
Do the "before nixpkgs change" build to use as the base of the diff w
e
#
Build all of the grids (the `morph` attribute of `default.nix`) and link th
e
#
compute later
.
#
result to the given parameter. This will give us some material to diff
.
build() {
build() {
# The name of the nix result symlink.
# The name of the nix result symlink.
local RESULT=$1
local RESULT=$1
...
@@ -197,9 +203,11 @@ create_merge_request() {
...
@@ -197,9 +203,11 @@ create_merge_request() {
shift
shift
local PROJECT_ID=$1
local PROJECT_ID=$1
shift
shift
local DEFAULT_BRANCH=$1
# The target branch of the MR.
local TARGET_BRANCH=$1
shift
shift
local BRANCH=$1
# THe source branch of the MR.
local SOURCE_BRANCH=$1
shift
shift
local DIFF=$1
local DIFF=$1
shift
shift
...
@@ -207,7 +215,12 @@ create_merge_request() {
...
@@ -207,7 +215,12 @@ create_merge_request() {
local BODY=$(python3 -c '
local BODY=$(python3 -c '
import sys, json, re
import sys, json, re
def rewrite_escapes(s):
def rewrite_escapes(s):
# `nix store diff-closures` output is fancy and includes color codes and
# such. That looks a bit less than nice in a markdown-formatted comment so
# strip all of it. If we wanted to be fancy we could rewrite it in a
# markdown friendly way (eg using html).
return re.sub(r"\x1b\[[^m]*m", "", s)
return re.sub(r"\x1b\[[^m]*m", "", s)
print(json.dumps({
print(json.dumps({
"id": sys.argv[1],
"id": sys.argv[1],
"target_branch": sys.argv[2],
"target_branch": sys.argv[2],
...
@@ -216,7 +229,7 @@ print(json.dumps({
...
@@ -216,7 +229,7 @@ print(json.dumps({
"title": "bump nixpkgs version",
"title": "bump nixpkgs version",
"description": f"```\n{rewrite_escapes(sys.argv[4])}\n```",
"description": f"```\n{rewrite_escapes(sys.argv[4])}\n```",
}))
}))
' "$PROJECT_ID" "$
DEFAUL
T_BRANCH" "$BRANCH" "$DIFF")
' "$PROJECT_ID" "$
TARGE
T_BRANCH" "$
SOURCE_
BRANCH" "$DIFF")
curl --verbose -X POST --data "${BODY}" --header "Content-Type: application/json" --header "PRIVATE-TOKEN: ${TOKEN}" "${SERVER_URL}/api/v4/projects/${PROJECT_ID}/merge_requests"
curl --verbose -X POST --data "${BODY}" --header "Content-Type: application/json" --header "PRIVATE-TOKEN: ${TOKEN}" "${SERVER_URL}/api/v4/projects/${PROJECT_ID}/merge_requests"
}
}
...
...
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