Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Bob
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
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
OSS
Bob
Commits
26c63f85
Verified
Commit
26c63f85
authored
1 year ago
by
Volker Schukai
Browse files
Options
Downloads
Patches
Plain Diff
fix: test scripts
parent
f6b81496
No related branches found
No related tags found
No related merge requests found
Pipeline
#26134
failed
1 year ago
Stage: build
Stage: deploy
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
flake.nix
+2
-10
2 additions, 10 deletions
flake.nix
project.nix
+1
-0
1 addition, 0 deletions
project.nix
system/scripts/update-hashes.nix
+2
-3
2 additions, 3 deletions
system/scripts/update-hashes.nix
system/scripts/update-version.nix
+15
-5
15 additions, 5 deletions
system/scripts/update-version.nix
with
20 additions
and
18 deletions
flake.nix
+
2
−
10
View file @
26c63f85
...
...
@@ -55,14 +55,6 @@
bob
=
let
projectDefinition
=
import
./project.nix
;
projectHash
=
if
(
self
'
?
shortRev
)
then
self
'
.
shortRev
else
"dirty"
;
lastModifiedDate
=
self
'
.
lastModifiedDate
or
self
'
.
lastModified
or
"19700101"
;
sourcePath
=
./source
;
in
# https://nixos.wiki/wiki/Go
...
...
@@ -79,10 +71,10 @@
ldflags
=
[
"-s -w"
"-X '
${
projectDefinition
.
modulePath
}
/release.version=
${
projectDefinition
.
version
}
'"
"-X '
${
projectDefinition
.
modulePath
}
/release.commit=
${
projectHash
}
'"
"-X '
${
projectDefinition
.
modulePath
}
/release.commit=
${
project
Definition
.
commit
Hash
}
'"
"-X '
${
projectDefinition
.
modulePath
}
/release.name=
${
projectDefinition
.
name
}
'"
"-X '
${
projectDefinition
.
modulePath
}
/release.mnemonic=
${
projectDefinition
.
mnemonic
}
'"
"-X '
${
projectDefinition
.
modulePath
}
/release.buildDate=
${
lastModifiedD
ate
}
'"
"-X '
${
projectDefinition
.
modulePath
}
/release.buildDate=
${
builtins
.
d
ate
}
'"
];
#vendorHash = null;
...
...
This diff is collapsed.
Click to expand it.
project.nix
+
1
−
0
View file @
26c63f85
...
...
@@ -7,4 +7,5 @@
modulePath
=
"gitlab.schukai.com/oss/bob"
;
version
=
"0.4.11"
;
## do not change this line; it will be updated automatically
vendorHash
=
null
;
## do not change this line; it will be updated automatically
commitHash
=
"f6b8149"
;
## do not change this line; it will be updated automatically
}
This diff is collapsed.
Click to expand it.
system/scripts/update-hashes.nix
+
2
−
3
View file @
26c63f85
...
...
@@ -11,9 +11,10 @@ in ''
#!
${
pkgs
.
bash
}
/bin/bash
${
common
}
defaultHash="
${
pkgs
.
lib
.
fakeHash
}
"
echo_step "Reset vendorHash to default value: $defaultHash"
${
pkgs
.
gnused
}
/bin/sed -i "s|vendorHash\s*=\s*null|vendorHash = \"$defaultHash\"|g"
${
workingDirectory
}
/project.nix
${
pkgs
.
gnused
}
/bin/sed -i "s|vendorHash\s*=\s*\"[^\"]\"|vendorHash = \"$defaultHash\"|g"
${
workingDirectory
}
/project.nix
...
...
@@ -31,8 +32,6 @@ in ''
fi
echo_ok "No dependencies found and vendorHash is set to null."
${
pkgs
.
git
}
/bin/git add $filepath/project.nix
${
pkgs
.
git
}
/bin/git commit -m "chore: Update vendorHash to null"
${
workingDirectory
}
/project.nix
exit 0
fi
...
...
This diff is collapsed.
Click to expand it.
system/scripts/update-version.nix
+
15
−
5
View file @
26c63f85
...
...
@@ -17,10 +17,21 @@ ${common}
cmd=
${
versionsTool
}
/bin/version
echo_step "Getting current commit hash"
HASH=$(
${
pkgs
.
git
}
/bin/git -C
${
workingDirectory
}
/ rev-parse --short HEAD)
echo_ok "Current commit hash is
''$
{HASH}"
echo_step "Replacing hash in project.nix"
if !
${
pkgs
.
gnused
}
/bin/sed -i "s|commitHash\s*=\s*\"[^\"]*\"|commitHash = \"
''$
{HASH}\"|g"
${
workingDirectory
}
/project.nix ; then
echo_fail "Hash not replaced"
exit 1
fi
echo_ok "Hash updated"
echo_step "Checking if there is a new version"
if ! $cmd auto --git --exit-code-if-no-bump ; then
echo_
step
"No version
b
ump"
echo_
fail
"No version
j
ump
to a new version
"
fi
VERSION=$($cmd print --git)
...
...
@@ -31,15 +42,14 @@ if [[ -z "''${VERSION}" ]]; then
exit 1
fi
echo_step "Replacing version in project.nix"
echo_step "Check version in project.nix"
# check if version replaced
if !
${
pkgs
.
gnused
}
/bin/sed -i "s/version\s*=\s*\"[^\"]*\"/version = \"
''$
{VERSION}\"/g"
${
workingDirectory
}
/project.nix; then
echo_fail "Version not replaced"
exit 1
exit 1
fi
echo_ok "Version
replac
ed"
echo_ok "Version
and hash updat
ed"
''
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