mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-17 15:35:09 +00:00
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:
parent
67d3c65847
commit
4d2d51214c
14 changed files with 34 additions and 24 deletions
|
|
@ -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
8
ci/scripts/shellcheck.sh
Executable 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
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Reference in a new issue