-
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ jobs: | |
runs-on: ubuntu-20.04 | ||
if: github.repository == 'open-telemetry/opentelemetry.io' | ||
env: | ||
DEPTH: --depth 100 # submodule clone depth | ||
DEPTH: --depth 500 # submodule clone depth | ||
|
||
steps: | ||
- name: Checkout | ||
|
@@ -23,15 +23,7 @@ jobs: | |
git config user.name opentelemetrybot | ||
git config user.email [email protected] | ||
- name: Auto-update | ||
run: | | ||
.github/workflows/scripts/auto-update-version.sh opentelemetry-collector-releases vers content/en/docs/collector/_index.md | ||
.github/workflows/scripts/auto-update-version.sh opentelemetry-java otel content/en/docs/instrumentation/java/_index.md | ||
.github/workflows/scripts/auto-update-version.sh opentelemetry-java-instrumentation instrumentation content/en/docs/instrumentation/java/_index.md | ||
.github/workflows/scripts/auto-update-version.sh opentelemetry-specification spec scripts/content-modules/adjust-pages.pl | ||
.github/workflows/scripts/auto-update-version.sh opentelemetry-proto otlp scripts/content-modules/adjust-pages.pl | ||
.github/workflows/scripts/auto-update-version.sh semantic-conventions semconv scripts/content-modules/adjust-pages.pl | ||
.github/workflows/scripts/auto-update-version.sh semantic-conventions-java semconv content/en/docs/instrumentation/java/_index.md | ||
- run: ./scripts/auto-update/all-versions.sh | ||
env: | ||
# change this to secrets.GITHUB_TOKEN when testing against a fork | ||
GH_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }} |
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: $!"; | ||
} | ||
} |