You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(nns-tools): Release runscript automatically grabs the latest commit (dfinity#3713)
After this PR, the runscript acquires the latest commit and shows it to
you, saving you from running the command yourself.
[← Previous PR](dfinity#3712) | [Next PR
→](dfinity#3714)
If you would like to pick a different commit, follow these steps:
93
-
2. Go to https://github.com/dfinity/ic/actions/workflows/ci-main.yml?query=branch%3Amaster+event%3Apush+is%3Asuccess
94
-
3. Find a recent commit with passing CI Main in the master branch
95
-
4. Record this commit (e.g., post to Slack)
96
-
97
-
Pre-built artifacts check:
98
-
- Install aws tool if needed
99
-
- List available files:
100
-
aws s3 ls --no-sign-request s3://dfinity-download-public/ic/${COMMIT}/canisters/
101
-
- Note: Our tools download from the analogous https://download.dfinity.systems/... URL",
97
+
// Get the ic directory.
98
+
let ic = ic_dir();
99
+
100
+
// Build the absolute path to the cmd.sh script.
101
+
let cmd_path = ic.join("testnet/tools/nns-tools/cmd.sh");
102
+
103
+
// Run the command with the required argument.
104
+
let output = Command::new(cmd_path)
105
+
.arg("latest_commit_with_prebuilt_artifacts")
106
+
.current_dir(&ic)
107
+
.output()
108
+
.unwrap();
109
+
110
+
let commit = if output.status.success(){
111
+
let commit = String::from_utf8_lossy(&output.stdout).trim().to_string();
112
+
println!("A commit with prebuilt artifacts was found with the following command: `./testnet/tools/nns-tools/cmd.sh latest_commit_with_prebuilt_artifacts`.");
113
+
input_with_default("Commit to release",&commit)
114
+
}else{
115
+
println!(
116
+
"Automatically determining the commit hash failed with error:\n{}",
117
+
String::from_utf8_lossy(&output.stderr)
118
+
);
119
+
// get input from user for the commit
120
+
input("Enter the commit hash, which you can find by running `./testnet/tools/nns-tools/cmd.sh latest_commit_with_prebuilt_artifacts`")
0 commit comments