-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CI] Auto-update-versions: fix action + pin gitmodules
- Loading branch information
Showing
5 changed files
with
75 additions
and
21 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
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,19 +1,24 @@ | ||
[submodule "themes/docsy"] | ||
path = themes/docsy | ||
url = https://github.com/cncf/docsy.git | ||
branch = opentelemetry.io | ||
docsy-pin = v0.8.0-11-gce52bb0 | ||
[submodule "content-modules/opentelemetry-specification"] | ||
path = content-modules/opentelemetry-specification | ||
url = https://github.com/open-telemetry/opentelemetry-specification.git | ||
spec-pin = v1.29.0 | ||
[submodule "content-modules/community"] | ||
path = content-modules/community | ||
url = https://github.com/open-telemetry/community | ||
community-pin = 0cb6dca | ||
[submodule "content-modules/opentelemetry-proto"] | ||
path = content-modules/opentelemetry-proto | ||
url = https://github.com/open-telemetry/opentelemetry-proto | ||
otlp-pin = v1.1.0 | ||
[submodule "content-modules/semantic-conventions"] | ||
path = content-modules/semantic-conventions | ||
url = https://github.com/open-telemetry/semantic-conventions | ||
semconv-pin = v1.24.0 | ||
[submodule "content-modules/opamp-spec"] | ||
path = content-modules/opamp-spec | ||
url = https://github.com/open-telemetry/opamp-spec | ||
opamp-pin = v0.8.0-5-g0360da8 |
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/bash -e | ||
|
||
function auto_update_versions() { | ||
local cmd="./scripts/auto-update/version-in-file.sh" | ||
local updates=( | ||
"opentelemetry-collector-releases vers content/en/docs/collector/_index.md" | ||
"opentelemetry-java otel content/en/docs/languages/java/_index.md" | ||
"opentelemetry-java-instrumentation instrumentation content/en/docs/languages/java/_index.md" | ||
"opentelemetry-specification spec scripts/content-modules/adjust-pages.pl .gitmodules" | ||
"opentelemetry-proto otlp scripts/content-modules/adjust-pages.pl .gitmodules" | ||
"semantic-conventions semconv scripts/content-modules/adjust-pages.pl .gitmodules" | ||
"semantic-conventions-java semconv content/en/docs/languages/java/_index.md" | ||
) | ||
|
||
for args in "${updates[@]}"; do | ||
echo "> $cmd $args" | ||
$cmd $args | ||
echo | ||
done | ||
} | ||
|
||
auto_update_versions |
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
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,29 @@ | ||
#!/usr/bin/perl -w | ||
|
||
use strict; | ||
use warnings; | ||
use FileHandle; | ||
|
||
my $file = '.gitmodules'; | ||
my $fh = FileHandle->new($file, 'r') or die "Error opening $file: $!"; | ||
my $content = do { local $/; <$fh> }; | ||
$fh->close or die "Error closing $file: $!"; | ||
|
||
# Extract submodule paths and pin values | ||
my @submodules = $content =~ /\[submodule "(.*?)".*?\w+-pin = ([^\s]+)/gs; | ||
|
||
# Iterate through submodules | ||
for (my $i = 0; $i < @submodules; $i += 2) { | ||
my $submodule_path = $submodules[$i]; | ||
my $commit = $submodules[$i + 1]; | ||
|
||
my $command = "cd $submodule_path && git switch --detach $commit"; | ||
print "> $command\n"; | ||
system($command); | ||
|
||
if ($? == -1) { | ||
die "Failed to execute command: $!"; | ||
} elsif ($? >> 8) { | ||
die "Command exited with error: $!"; | ||
} | ||
} |