Remove bash dependency from test network nano (#671)

The scripts do not require bash so switch to sh and add shellcheck linting

Signed-off-by: James Taylor <jamest@uk.ibm.com>
This commit is contained in:
James Taylor 2022-03-09 08:46:56 +00:00 committed by GitHub
parent 67d3c65847
commit 4d2d51214c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 34 additions and 24 deletions

View file

@ -98,6 +98,8 @@ jobs:
inputs:
versionSpec: $(NODE_VER)
displayName: Install Node.js
- script: ./ci/scripts/shellcheck.sh
displayName: Lint Shell Scripts
- script: ./ci/scripts/lint.sh
displayName: Lint Code

8
ci/scripts/shellcheck.sh Executable file
View file

@ -0,0 +1,8 @@
#!/bin/bash
set -euo pipefail
scversion="v0.8.0" # or "stable", or "latest"
wget -qO- "https://github.com/koalaman/shellcheck/releases/download/${scversion?}/shellcheck-${scversion?}.linux.x86_64.tar.xz" | tar -xJv "shellcheck-${scversion}/shellcheck"
"./shellcheck-${scversion}/shellcheck" --version
"./shellcheck-${scversion}/shellcheck" ./test-network-nano-bash/*.sh

View file

@ -1,5 +1,5 @@
#!/usr/bin/env bash
set -euo pipefail
#!/usr/bin/env sh
set -eu
# remove existing artifacts, or proceed on if the directories don't exist
rm -r "${PWD}"/channel-artifacts || true

View file

@ -1,5 +1,5 @@
#!/usr/bin/env bash
set -euo pipefail
#!/usr/bin/env sh
set -eu
# look for binaries in local dev environment /build/bin directory and then in local samples /bin directory
export PATH="${PWD}"/../../fabric/build/bin:"${PWD}"/../bin:"$PATH"

View file

@ -1,5 +1,5 @@
#!/usr/bin/env bash
set -euo pipefail
#!/usr/bin/env sh
set -eu
# look for binaries in local dev environment /build/bin directory and then in local samples /bin directory
export PATH="${PWD}"/../../fabric/build/bin:"${PWD}"/../bin:"$PATH"

View file

@ -1,5 +1,5 @@
#!/usr/bin/env bash
set -euo pipefail
#!/usr/bin/env sh
set -eu
# look for binaries in local dev environment /build/bin directory and then in local samples /bin directory
export PATH="${PWD}"/../../fabric/build/bin:"${PWD}"/../bin:"$PATH"

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -euo pipefail
#!/usr/bin/env sh
set -eu
if [ "$(uname)" == "Linux" ] ; then
if [ "$(uname)" = "Linux" ] ; then
CCADDR="127.0.0.1"
else
CCADDR="host.docker.internal"

View file

@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/usr/bin/env sh
# look for binaries in local dev environment /build/bin directory and then in local samples /bin directory
export PATH="${PWD}"/../../fabric/build/bin:"${PWD}"/../bin:"$PATH"

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -euo pipefail
#!/usr/bin/env sh
set -eu
if [ "$(uname)" == "Linux" ] ; then
if [ "$(uname)" = "Linux" ] ; then
CCADDR="127.0.0.1"
else
CCADDR="host.docker.internal"

View file

@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/usr/bin/env sh
# look for binaries in local dev environment /build/bin directory and then in local samples /bin directory
export PATH="${PWD}"/../../fabric/build/bin:"${PWD}"/../bin:"$PATH"

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -euo pipefail
#!/usr/bin/env sh
set -eu
if [ "$(uname)" == "Linux" ] ; then
if [ "$(uname)" = "Linux" ] ; then
CCADDR="127.0.0.1"
else
CCADDR="host.docker.internal"

View file

@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/usr/bin/env sh
# look for binaries in local dev environment /build/bin directory and then in local samples /bin directory
export PATH="${PWD}"/../../fabric/build/bin:"${PWD}"/../bin:"$PATH"

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -euo pipefail
#!/usr/bin/env sh
set -eu
if [ "$(uname)" == "Linux" ] ; then
if [ "$(uname)" = "Linux" ] ; then
CCADDR="127.0.0.1"
else
CCADDR="host.docker.internal"

View file

@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/usr/bin/env sh
# look for binaries in local dev environment /build/bin directory and then in local samples /bin directory
export PATH="${PWD}"/../../fabric/build/bin:"${PWD}"/../bin:"$PATH"