Skip to content

Commit

Permalink
feat: add shellcheck to circleci (#2835)
Browse files Browse the repository at this point in the history
Closes #2832
  • Loading branch information
hirasawayuki authored Nov 9, 2021
1 parent 49b582c commit 38cbcc0
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 18 deletions.
3 changes: 3 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ orbs:
go: circleci/go@1.5.0
prettier: ory/prettier@0.0.11
node: circleci/node@4.2.0
shellcheck: circleci/shellcheck@2.2.4

jobs:
# test-legacy-migrations:
Expand Down Expand Up @@ -55,6 +56,8 @@ jobs:

- nancy/install
- nancy/check
- shellcheck/install
- shellcheck/check
- prettier/install
- prettier/check
- prettier/install:
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/guides/oauth2-public-spa-mobile.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ client_id=...&

:::note

The public clients using a non-https redirect scheme cannot skip
consent as per OpenID Sepcification & Certification.
The public clients using a non-https redirect scheme cannot skip consent as per
OpenID Sepcification & Certification.

:::
1 change: 0 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,6 @@ EOF
PROJECT_NAME="hydra"
OWNER=ory
REPO="hydra"
BINARY=hydra
FORMAT=tar.gz
OS=$(uname_os)
ARCH=$(uname_arch)
Expand Down
3 changes: 2 additions & 1 deletion internal/certification/scripts/configure.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash

source $HOME/.profile
# shellcheck disable=SC1090,SC1091
source "$HOME"/.profile

hydra clients delete \
--endpoint http://localhost:9000 \
Expand Down
12 changes: 8 additions & 4 deletions internal/certification/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@ sudo apt-get install -y nodejs
wget https://dl.google.com/go/go1.10.2.linux-amd64.tar.gz
tar -C /usr/local -xzf go1.10.2.linux-amd64.tar.gz
mkdir -p go/bin
echo "export PATH=\$PATH:/usr/local/go/bin" >> $HOME/.profile
echo "GOPATH=\$HOME/go" >> $HOME/.profile
echo "export PATH=\$PATH:\$HOME/go" >> $HOME/.profile
source $HOME/.profile
{
echo "export PATH=\$PATH:/usr/local/go/bin"
echo "GOPATH=\$HOME/go"
echo "export PATH=\$PATH:\$HOME/go"
} >> "$HOME"/.profile

# shellcheck disable=SC1090,SC1091
source "$HOME"/.profile

# go/dep
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
Expand Down
9 changes: 5 additions & 4 deletions internal/certification/scripts/start.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash

source $HOME/.profile
# shellcheck disable=SC1090,SC1091
source "$HOME"/.profile

domain=oidc-certification.ory.sh:8443
hydraport=9000
Expand All @@ -19,21 +20,21 @@ curl -i -X DELETE --url http://localhost:8001/apis/login-consent
curl -i -X POST \
--url http://localhost:8001/apis/ \
--data 'name=hydra-oauth' \
--data upstream_url=http://${ip}:9000/ \
--data upstream_url=http://"${ip}":9000/ \
--data 'uris=/oauth2,/.well-known,/userinfo,/clients' \
--data 'strip_uri=false' \
--data 'preserve_host=true'

curl -i -X POST \
--url http://localhost:8001/apis/ \
--data 'name=login-consent' \
--data upstream_url=http://$ip:9001/ \
--data upstream_url=http://"$ip":9001/ \
--data 'uris=/login,/consent' \
--data 'strip_uri=false' \
--data 'preserve_host=true'


(cd ./hydra-login-consent-node; HYDRA_URL=http://localhost:$hydraport PORT=$idport npm start &)
(cd ./hydra-login-consent-node || exit; HYDRA_URL=http://localhost:$hydraport PORT=$idport npm start &)

PORT=$hydraport \
OAUTH2_CONSENT_URL=https://$domain/consent \
Expand Down
9 changes: 5 additions & 4 deletions internal/certification/scripts/update.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#!/bin/bash

source $HOME/.profile
# shellcheck disable=SC1090,SC1091
source "$HOME"/.profile

go get -u -d github.com/ory/hydra
go get -d -u github.com/devopsfaith/krakend-examples/gin
(cd $HOME/hydra-login-consent-node; git pull -ff; npm i)
cd $HOME
(cd "$HOME"/hydra-login-consent-node || exit; git pull -ff; npm i)
cd "$HOME" || exit
go install github.com/ory/hydra
go install github.com/devopsfaith/krakend-examples/gin
go install github.com/devopsfaith/krakend-examples/gin
2 changes: 1 addition & 1 deletion scripts/run-bench.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ hydra clients create \
--endpoint http://localhost:9001

echo "Generating initial access tokens for token introspection benchmark"
authToken=$(hydra token client --endpoint http://localhost:9000 --client-id $clientId --client-secret $clientSecret)
introToken=$(hydra token client --endpoint http://localhost:9000 --client-id $clientId --client-secret $clientSecret)

cat >> BENCHMARKS.md << EOF
Expand Down Expand Up @@ -94,6 +93,7 @@ hey -n $numReqs -c $numParallel -m POST \
| tee -a BENCHMARKS.md


# shellcheck disable=SC2006
cat >> BENCHMARKS.md << EOF
\`\`\`
Expand Down
1 change: 1 addition & 0 deletions scripts/run-configuration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ set -Eeuxo pipefail

cd "$( dirname "${BASH_SOURCE[0]}" )/.."

# shellcheck disable=SC2006
cat > configuration.md << EOF
---
id: configuration
Expand Down
2 changes: 1 addition & 1 deletion test/conformance/ssl/generate.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

set -euxo pipefail
cd "$( dirname "${BASH_SOURCE[0]}" )"
Expand Down
1 change: 1 addition & 0 deletions test/conformance/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
set -euxo pipefail
cd "$( dirname "${BASH_SOURCE[0]}" )/../.."

# shellcheck disable=SC2086
docker-compose -f quickstart.yml -f quickstart-postgres.yml -f test/conformance/docker-compose.yml up ${1:-} -d

0 comments on commit 38cbcc0

Please sign in to comment.