-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
57 changed files
with
14,360 additions
and
805 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
const fs = require("fs"); | ||
|
||
if (process.argv.length !== 3) { | ||
throw Error(`Usage: ${process.argv[0]} ${process.argv[1]} <version>`); | ||
} | ||
|
||
const version = process.argv[2]; | ||
|
||
const updateVersion = packageFile => { | ||
const original = JSON.parse(fs.readFileSync(packageFile, "utf8")); | ||
|
||
const updated = { | ||
...original, | ||
version, | ||
...(original.packages | ||
? { | ||
packages: { | ||
...original.packages, | ||
"": { | ||
...original.packages[""], | ||
version, | ||
}, | ||
}, | ||
} | ||
: {}), | ||
}; | ||
|
||
return fs.writeFileSync(packageFile, JSON.stringify(updated, null, 2)); | ||
}; | ||
|
||
updateVersion("./package.json"); | ||
updateVersion("./package-lock.json"); | ||
updateVersion("./packages/app/package.json"); | ||
updateVersion("./packages/app/package-lock.json"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/sh | ||
|
||
destdir=$1 | ||
pcsd_webui_dir=$2 | ||
cockpit_dir=$2 | ||
|
||
if [ "$pcsd_webui_dir" = "" ] && [ "$cockpit_dir" = "" ]; then | ||
echo "No install location found, skipping installation" | ||
exit 0 | ||
fi | ||
|
||
if [ ! "$pcsd_webui_dir" = "" ]; then | ||
standalone_dir="$destdir"/"$pcsd_webui_dir" | ||
mkdir -p "$standalone_dir" | ||
cp -r build/for-standalone/* "$standalone_dir" | ||
fi | ||
|
||
if [ ! "$cockpit_dir" = "" ]; then | ||
cockpit_ha_cluster_dir="$destdir"/"$cockpit_dir"/ha-cluster | ||
mkdir -p "$cockpit_ha_cluster_dir" | ||
cp -r build/for-cockpit/* "$cockpit_ha_cluster_dir" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,31 @@ | ||
#!/bin/sh | ||
|
||
# Change all nexus occurrences in package-lock.json files to standard npm paths. | ||
fix_lock() { | ||
lock_file=$1 | ||
|
||
sed -i "s#repository.engineering.redhat.com/nexus/repository/##g" "$lock_file" | ||
git add "$lock_file" | ||
} | ||
|
||
for lockDir in \ | ||
"./" \ | ||
"./packages/app" \ | ||
"./packages/dev" \ | ||
"./packages/dev-backend" \ | ||
"./packages/test"; do | ||
|
||
lock="$lockDir"/package-lock.json | ||
sed -i "s#repository.engineering.redhat.com/nexus/repository/##g" "$lock" | ||
git add "$lock" | ||
fix_lock "$lockDir"/package-lock.json | ||
done | ||
|
||
# Deal with reduced packages (for building process). | ||
app=packages/app | ||
package_build="$app"/.bin/package-build | ||
|
||
packages_build="$app"/$("$package_build"/fname.sh) | ||
packages_build_lock="$app"/$("$package_build"/fname.sh -l) | ||
|
||
"$package_build"/generate.sh "$app" | ||
git add "$packages_build" "$packages_build_lock" | ||
|
||
fix_lock "$packages_build_lock" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/bin/sh | ||
|
||
spec_template=$1 | ||
version=$2 | ||
date="$3" | ||
pcsd_webui_dir="$4" | ||
cockpit_dir="$5" | ||
pcsd_unix_socket="$6" | ||
|
||
expressions="s/@date@/$date/g" | ||
delete_global() { | ||
expressions="${expressions};/^%glo.*${1}.*$/d" | ||
} | ||
replace() { | ||
expressions="${expressions};s|@${1}@|${2}|g" | ||
} | ||
|
||
replace pcsd-webui-dir "$pcsd_webui_dir" | ||
replace cockpit-dir "$cockpit_dir" | ||
replace pcsd-unix-socket "$pcsd_unix_socket" | ||
|
||
if echo "$version" | grep '-' --quiet; then | ||
# The version structure (modified `git describe`, e.g. 0.1.20+34-89788-dirty): | ||
# git tag (e.g. 0.1.20) | ||
# +commits ahead last tag (git-version-gen made "+" from first "-" e.g. -34) | ||
# -hash of the current commit (e.g. -8978888c) | ||
# -dirty (optional) | ||
replace version "${version%%+*}" | ||
replace current_commit "$(echo "$version" | sed 's/[^-]*-\([^-]*\).*/\1/')" | ||
replace commits_ahead_tag "$(echo "$version" | sed 's/[^+]*+\([^-]*\).*/\1/')" | ||
else | ||
# If the current commit is annotated tag, the version is the tag, e.g. 0.1.20 | ||
replace version "$version" | ||
delete_global current_commit | ||
delete_global commits_ahead_tag | ||
fi | ||
|
||
if echo "$version" | grep '\-dirty$' --quiet; then | ||
replace dirty dirty | ||
else | ||
delete_global dirty | ||
fi | ||
|
||
if [ -z "$CI_BRANCH" ]; then | ||
delete_global cibranch | ||
else | ||
replace cibranch "$CI_BRANCH" | ||
fi | ||
|
||
sed --expression "$expressions" "$spec_template" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ref names:$Format:%d$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
configure.ac export-subst | ||
.gitarchivever export-subst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.