Skip to content

Commit 2e5bf86

Browse files
authored
Clean up &&s in .taskcluster.yml shell scripts (#1060)
1 parent 865e109 commit 2e5bf86

File tree

1 file changed

+137
-120
lines changed

1 file changed

+137
-120
lines changed

.taskcluster.yml

Lines changed: 137 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -40,24 +40,26 @@ tasks:
4040
image: "rust:bookworm"
4141
command:
4242
- "/bin/bash"
43-
- "-cx"
44-
- "apt update && apt install -y python3-full &&
45-
rustup component add clippy rustfmt &&
46-
rustup toolchain install nightly &&
47-
curl -L https://github.com/est31/cargo-udeps/releases/download/v0.1.55/cargo-udeps-v0.1.55-x86_64-unknown-linux-gnu.tar.gz | tar xz -C /usr/local/cargo/bin --strip-components 2 &&
48-
curl -L https://github.com/rustsec/rustsec/releases/download/cargo-audit%2Fv0.21.2/cargo-audit-x86_64-unknown-linux-musl-v0.21.2.tgz | tar xzv -C /usr/local/cargo/bin --strip-components 1 &&
49-
git clone --quiet ${repository} &&
50-
cd rust-code-analysis &&
51-
git -c advice.detachedHead=false checkout ${head_rev} &&
52-
git submodule update --init &&
53-
python3 -m venv myenv &&
54-
. myenv/bin/activate &&
55-
pip3 install --quiet pre-commit &&
56-
pre-commit run -a --show-diff-on-failure &&
57-
pre-commit run --show-diff-on-failure -c .pre-commit-audit-config.yaml &&
58-
cargo test --workspace --verbose --all-features --no-fail-fast -- --nocapture &&
59-
cd enums &&
60-
cargo build --verbose --all-features"
43+
- "-cxe"
44+
- |-
45+
apt update
46+
apt install -y python3-full
47+
rustup component add clippy rustfmt
48+
rustup toolchain install nightly
49+
curl -L https://github.com/est31/cargo-udeps/releases/download/v0.1.55/cargo-udeps-v0.1.55-x86_64-unknown-linux-gnu.tar.gz | tar xz -C /usr/local/cargo/bin --strip-components 2
50+
curl -L https://github.com/rustsec/rustsec/releases/download/cargo-audit%2Fv0.21.2/cargo-audit-x86_64-unknown-linux-musl-v0.21.2.tgz | tar xzv -C /usr/local/cargo/bin --strip-components 1
51+
git clone --quiet ${repository}
52+
cd rust-code-analysis
53+
git -c advice.detachedHead=false checkout ${head_rev}
54+
git submodule update --init
55+
python3 -m venv myenv
56+
. myenv/bin/activate
57+
pip3 install --quiet pre-commit
58+
pre-commit run -a --show-diff-on-failure
59+
pre-commit run --show-diff-on-failure -c .pre-commit-audit-config.yaml
60+
cargo test --workspace --verbose --all-features --no-fail-fast -- --nocapture
61+
cd enums
62+
cargo build --verbose --all-features
6163
metadata:
6264
name: rust-code-analysis lint and test
6365
description: rust-code-analysis lint and test
@@ -74,15 +76,16 @@ tasks:
7476
image: "rust:bookworm"
7577
command:
7678
- "/bin/bash"
77-
- "-cx"
78-
- "git clone --quiet ${repository} &&
79-
cd rust-code-analysis &&
80-
git -c advice.detachedHead=false checkout ${head_rev} &&
81-
cargo install mdbook --no-default-features --features output --vers \"^0.1.0\" &&
82-
cargo doc --release &&
83-
cd rust-code-analysis-book &&
84-
mdbook build &&
85-
tar -zvcf /book.tar.gz book/"
79+
- "-cxe"
80+
- |-
81+
git clone --quiet ${repository}
82+
cd rust-code-analysis
83+
git -c advice.detachedHead=false checkout ${head_rev}
84+
cargo install mdbook --no-default-features --features output --vers "^0.1.0"
85+
cargo doc --release
86+
cd rust-code-analysis-book
87+
mdbook build
88+
tar -zvcf /book.tar.gz book/
8689
artifacts:
8790
public/book.tar.gz:
8891
expires: {$fromNow: '2 weeks'}
@@ -110,18 +113,19 @@ tasks:
110113
LLVM_PROFILE_FILE: rust-code-analysis-%p-%m.profraw
111114
command:
112115
- "/bin/bash"
113-
- "-cx"
114-
- "apt-get -qq update &&
115-
apt-get -qq install -y zip &&
116-
curl -L https://github.com/mozilla/grcov/releases/download/v0.8.6/grcov-v0.8.6-x86_64-unknown-linux-gnu.tar.gz | tar xz &&
117-
rustup component add llvm-tools-preview &&
118-
git clone --quiet ${repository} &&
119-
cd rust-code-analysis &&
120-
git -c advice.detachedHead=false checkout ${head_rev} &&
121-
git submodule update --init &&
122-
cargo test --workspace --verbose --all-features --target x86_64-unknown-linux-gnu &&
123-
../grcov . --binary-path ./target/ -s . -t lcov --llvm --branch --ignore-not-existing --ignore '/*' -o lcov.info &&
124-
bash <(curl -s https://codecov.io/bash) -f lcov.info"
116+
- "-cxe"
117+
- |-
118+
apt-get -qq update
119+
apt-get -qq install -y zip
120+
curl -L https://github.com/mozilla/grcov/releases/download/v0.8.6/grcov-v0.8.6-x86_64-unknown-linux-gnu.tar.gz | tar xz
121+
rustup component add llvm-tools-preview
122+
git clone --quiet ${repository}
123+
cd rust-code-analysis
124+
git -c advice.detachedHead=false checkout ${head_rev}
125+
git submodule update --init
126+
cargo test --workspace --verbose --all-features --target x86_64-unknown-linux-gnu
127+
../grcov . --binary-path ./target/ -s . -t lcov --llvm --branch --ignore-not-existing --ignore '/*' -o lcov.info
128+
bash <(curl -s https://codecov.io/bash) -f lcov.info
125129
metadata:
126130
name: rust-code-analysis grcov test
127131
description: rust-code-analysis grcov test
@@ -175,11 +179,12 @@ tasks:
175179
image: "rust:buster"
176180
command:
177181
- "/bin/bash"
178-
- "-cx"
179-
- "git clone --quiet ${repository} &&
180-
cd rust-code-analysis &&
181-
git -c advice.detachedHead=false checkout ${head_rev} &&
182-
./check-grammars-crates.sh tree-sitter-mozcpp"
182+
- "-cxe"
183+
- |-
184+
git clone --quiet ${repository}
185+
cd rust-code-analysis
186+
git -c advice.detachedHead=false checkout ${head_rev}
187+
./check-grammars-crates.sh tree-sitter-mozcpp
183188
cache:
184189
rust-code-analysis-mozilla-central-repository: /cache
185190
artifacts:
@@ -208,11 +213,12 @@ tasks:
208213
image: "rust:buster"
209214
command:
210215
- "/bin/bash"
211-
- "-cx"
212-
- "git clone --quiet ${repository} &&
213-
cd rust-code-analysis &&
214-
git -c advice.detachedHead=false checkout ${head_rev} &&
215-
./check-grammars-crates.sh tree-sitter-mozjs"
216+
- "-cxe"
217+
- |-
218+
git clone --quiet ${repository}
219+
cd rust-code-analysis
220+
git -c advice.detachedHead=false checkout ${head_rev}
221+
./check-grammars-crates.sh tree-sitter-mozjs
216222
cache:
217223
rust-code-analysis-mozilla-central-repository: /cache
218224
artifacts:
@@ -241,11 +247,12 @@ tasks:
241247
image: "rust:buster"
242248
command:
243249
- "/bin/bash"
244-
- "-cx"
245-
- "git clone --quiet ${repository} &&
246-
cd rust-code-analysis &&
247-
git -c advice.detachedHead=false checkout ${head_rev} &&
248-
./check-grammars-crates.sh tree-sitter-rust"
250+
- "-cxe"
251+
- |-
252+
git clone --quiet ${repository}
253+
cd rust-code-analysis
254+
git -c advice.detachedHead=false checkout ${head_rev}
255+
./check-grammars-crates.sh tree-sitter-rust
249256
cache:
250257
rust-code-analysis-mozilla-central-repository: /cache
251258
artifacts:
@@ -274,11 +281,12 @@ tasks:
274281
image: "rust:buster"
275282
command:
276283
- "/bin/bash"
277-
- "-cx"
278-
- "git clone --quiet ${repository} &&
279-
cd rust-code-analysis &&
280-
git -c advice.detachedHead=false checkout ${head_rev} &&
281-
./check-grammars-crates.sh tree-sitter-java"
284+
- "-cxe"
285+
- |-
286+
git clone --quiet ${repository}
287+
cd rust-code-analysis
288+
git -c advice.detachedHead=false checkout ${head_rev}
289+
./check-grammars-crates.sh tree-sitter-java
282290
cache:
283291
rust-code-analysis-mozilla-central-repository: /cache
284292
artifacts:
@@ -307,11 +315,12 @@ tasks:
307315
image: "rust:buster"
308316
command:
309317
- "/bin/bash"
310-
- "-cx"
311-
- "git clone --quiet ${repository} &&
312-
cd rust-code-analysis &&
313-
git -c advice.detachedHead=false checkout ${head_rev} &&
314-
./check-grammars-crates.sh tree-sitter-kotlin"
318+
- "-cxe"
319+
- |-
320+
git clone --quiet ${repository}
321+
cd rust-code-analysis
322+
git -c advice.detachedHead=false checkout ${head_rev}
323+
./check-grammars-crates.sh tree-sitter-kotlin
315324
cache:
316325
rust-code-analysis-mozilla-central-repository: /cache
317326
artifacts:
@@ -340,11 +349,12 @@ tasks:
340349
image: "rust:buster"
341350
command:
342351
- "/bin/bash"
343-
- "-cx"
344-
- "git clone --quiet ${repository} &&
345-
cd rust-code-analysis &&
346-
git -c advice.detachedHead=false checkout ${head_rev} &&
347-
./check-grammars-crates.sh tree-sitter-python"
352+
- "-cxe"
353+
- |-
354+
git clone --quiet ${repository}
355+
cd rust-code-analysis
356+
git -c advice.detachedHead=false checkout ${head_rev}
357+
./check-grammars-crates.sh tree-sitter-python
348358
cache:
349359
rust-code-analysis-mozilla-central-repository: /cache
350360
artifacts:
@@ -373,11 +383,12 @@ tasks:
373383
image: "rust:buster"
374384
command:
375385
- "/bin/bash"
376-
- "-cx"
377-
- "git clone --quiet ${repository} &&
378-
cd rust-code-analysis &&
379-
git -c advice.detachedHead=false checkout ${head_rev} &&
380-
./check-grammars-crates.sh tree-sitter-typescript"
386+
- "-cxe"
387+
- |-
388+
git clone --quiet ${repository}
389+
cd rust-code-analysis
390+
git -c advice.detachedHead=false checkout ${head_rev}
391+
./check-grammars-crates.sh tree-sitter-typescript
381392
cache:
382393
rust-code-analysis-mozilla-central-repository: /cache
383394
artifacts:
@@ -408,17 +419,20 @@ tasks:
408419
image: "rust:buster"
409420
command:
410421
- "/bin/bash"
411-
- "-cx"
412-
- "git clone --quiet ${repository} &&
413-
[ ! -d \"/cache/gecko-dev\" ] &&
414-
git clone --quiet https://github.com/mozilla/gecko-dev.git /cache/gecko-dev || true &&
415-
pushd /cache/gecko-dev && git pull origin master && popd &&
416-
mkdir -p /tmp/mozilla_central_output &&
417-
cd rust-code-analysis &&
418-
git -c advice.detachedHead=false checkout ${head_rev} &&
419-
cargo build --release --workspace --all-features &&
420-
cargo run --release -p rust-code-analysis-cli -- -p /cache/gecko-dev \
421-
-j4 --metrics -O json -o /tmp/mozilla_central_output"
422+
- "-cxe"
423+
- |-
424+
git clone --quiet ${repository}
425+
[ ! -d "/cache/gecko-dev" ]
426+
git clone --quiet https://github.com/mozilla/gecko-dev.git /cache/gecko-dev || true
427+
pushd /cache/gecko-dev
428+
git pull origin master
429+
popd
430+
mkdir -p /tmp/mozilla_central_output
431+
cd rust-code-analysis
432+
git -c advice.detachedHead=false checkout ${head_rev}
433+
cargo build --release --workspace --all-features
434+
cargo run --release -p rust-code-analysis-cli -- -p /cache/gecko-dev \
435+
-j4 --metrics -O json -o /tmp/mozilla_central_output
422436
cache:
423437
rust-code-analysis-mozilla-central-repository: /cache
424438
scopes:
@@ -450,18 +464,19 @@ tasks:
450464
TASKCLUSTER_SECRET: project/relman/rust-code-analysis/deploy
451465
command:
452466
- "/bin/sh"
453-
- "-cx"
454-
- "git config --global user.email moz-tools-bot@moz.tools &&
455-
git config --global user.name moz.tools Bot &&
456-
git clone --quiet ${repository} &&
457-
cd rust-code-analysis &&
458-
cd tree-sitter-ccomment && taskboot cargo-publish --ignore-published && cd .. &&
459-
cd tree-sitter-preproc && taskboot cargo-publish --ignore-published && cd .. &&
460-
cd tree-sitter-mozjs && taskboot cargo-publish --ignore-published && cd .. &&
461-
cd tree-sitter-mozcpp && taskboot cargo-publish --ignore-published && cd .. &&
462-
taskboot cargo-publish --ignore-published &&
463-
cd rust-code-analysis-cli && taskboot cargo-publish --ignore-published && cd .. &&
464-
cd rust-code-analysis-web && taskboot cargo-publish --ignore-published"
467+
- "-cxe"
468+
- |-
469+
git config --global user.email moz-tools-bot@moz.tools
470+
git config --global user.name moz.tools Bot
471+
git clone --quiet ${repository}
472+
cd rust-code-analysis
473+
cd tree-sitter-ccomment && taskboot cargo-publish --ignore-published && cd ..
474+
cd tree-sitter-preproc && taskboot cargo-publish --ignore-published && cd ..
475+
cd tree-sitter-mozjs && taskboot cargo-publish --ignore-published && cd ..
476+
cd tree-sitter-mozcpp && taskboot cargo-publish --ignore-published && cd ..
477+
taskboot cargo-publish --ignore-published
478+
cd rust-code-analysis-cli && taskboot cargo-publish --ignore-published && cd ..
479+
cd rust-code-analysis-web && taskboot cargo-publish --igoure-published
465480
metadata:
466481
name: "rust-code-analysis crates publishing on crates.io ${head_branch[10:]}"
467482
description: rust-code-analysis crates publishing on crates.io
@@ -482,18 +497,19 @@ tasks:
482497
image: "rust:buster"
483498
command:
484499
- "/bin/bash"
485-
- "-cx"
486-
- "git clone --quiet ${repository} &&
487-
cd rust-code-analysis &&
488-
git -c advice.detachedHead=false checkout ${head_rev} &&
489-
cargo update &&
490-
cargo build --workspace --release &&
491-
cargo package --all-features &&
492-
pushd rust-code-analysis-cli && cargo package --all-features && popd &&
493-
pushd rust-code-analysis-web && cargo package --all-features && popd &&
494-
cd target/release &&
495-
tar -zvcf /rust-code-analysis-linux-cli-x86_64.tar.gz rust-code-analysis-cli &&
496-
tar -zvcf /rust-code-analysis-linux-web-x86_64.tar.gz rust-code-analysis-web"
500+
- "-cxe"
501+
- |-
502+
git clone --quiet ${repository}
503+
cd rust-code-analysis
504+
git -c advice.detachedHead=false checkout ${head_rev}
505+
cargo update
506+
cargo build --workspace --release
507+
cargo package --all-features
508+
pushd rust-code-analysis-cli && cargo package --all-features && popd
509+
pushd rust-code-analysis-web && cargo package --all-features && popd
510+
cd target/release
511+
tar -zvcf /rust-code-analysis-linux-cli-x86_64.tar.gz rust-code-analysis-cli
512+
tar -zvcf /rust-code-analysis-linux-web-x86_64.tar.gz rust-code-analysis-web
497513
artifacts:
498514
public/rust-code-analysis-linux-cli-x86_64.tar.gz:
499515
expires: {$fromNow: '2 weeks'}
@@ -590,17 +606,18 @@ tasks:
590606
TASKCLUSTER_SECRET: project/relman/rust-code-analysis/deploy
591607
command:
592608
- "/bin/sh"
593-
- "-cx"
594-
- "git config --global user.email moz-tools-bot@moz.tools &&
595-
git config --global user.name moz.tools Bot &&
596-
git clone --quiet ${repository} &&
597-
cd rust-code-analysis &&
598-
taskboot retrieve-artifact --output-path=. --artifacts=public/book.tar.gz &&
599-
tar xfz book.tar.gz -C rust-code-analysis-book &&
600-
./rust-code-analysis-book/deploy-to-GitHub-Pages &&
601-
taskboot git-push --force-push github.com/mozilla/rust-code-analysis moz-tools-bot gh-pages &&
602-
taskboot github-release mozilla/rust-code-analysis ${head_branch[10:]} --asset Cargo.lock:public/Cargo.lock ${linux_cli}:public/${linux_cli} ${linux_web}:public/${linux_web} ${win_cli}:public/${win_cli} ${win_web}:public/${win_web} &&
603-
rm -rf book.tar.gz"
609+
- "-cxe"
610+
- |-
611+
git config --global user.email moz-tools-bot@moz.tools
612+
git config --global user.name moz.tools Bot
613+
git clone --quiet ${repository}
614+
cd rust-code-analysis
615+
taskboot retrieve-artifact --output-path=. --artifacts=public/book.tar.gz
616+
tar xfz book.tar.gz -C rust-code-analysis-book
617+
./rust-code-analysis-book/deploy-to-GitHub-Pages
618+
taskboot git-push --force-push github.com/mozilla/rust-code-analysis moz-tools-bot gh-pages
619+
taskboot github-release mozilla/rust-code-analysis ${head_branch[10:]} --asset Cargo.lock:public/Cargo.lock ${linux_cli}:public/${linux_cli} ${linux_web}:public/${linux_web} ${win_cli}:public/${win_cli} ${win_web}:public/${win_web}
620+
rm -rf book.tar.gz
604621
metadata:
605622
name: "rust-code-analysis release publication ${head_branch[10:]}"
606623
description: rust-code-analysis release publication on Github

0 commit comments

Comments
 (0)