File: prepare-deploy.bash

package info (click to toggle)
rustup 1.27.1-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,636 kB
  • sloc: sh: 856; python: 233; javascript: 183; makefile: 27
file content (35 lines) | stat: -rw-r--r-- 970 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash

set -u -e

# Copy rustup-init to rustup-setup for backwards compatibility
cp target/"$TARGET"/release/rustup-init target/"$TARGET"/release/rustup-setup

# Generate hashes
pushd target/"$TARGET"/release/
if [ "$(uname -s)" = "Darwin" ]; then
    find . -maxdepth 1 -type f -exec sh -c 'fn="$1"; shasum -a 256 -b "$fn" > "$fn".sha256' sh {} \;
else
    find . -maxdepth 1 -type f -exec sh -c 'fn="$1"; sha256sum -b "$fn" > "$fn".sha256' sh {} \;
fi
popd

# The directory for deployment artifacts
dest="deploy"

# Prepare bins for upload
bindest="$dest/dist/$TARGET"
mkdir -p "$bindest/"
cp target/"$TARGET"/release/rustup-init "$bindest/"
cp target/"$TARGET"/release/rustup-init.sha256 "$bindest/"
cp target/"$TARGET"/release/rustup-setup "$bindest/"
cp target/"$TARGET"/release/rustup-setup.sha256 "$bindest/"

if [ "$TARGET" != "x86_64-unknown-linux-gnu" ]; then
    exit 0
fi

cp rustup-init.sh "$dest/"

# Prepare website for upload
cp -R www "$dest/www"