Skip to content

Commit

Permalink
use bash env instead of outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
twoshark committed Nov 15, 2023
1 parent 9d704e4 commit 5ea6959
Showing 1 changed file with 11 additions and 28 deletions.
39 changes: 11 additions & 28 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,12 @@ jobs:
if ./ops/verify-geth-endpoint.sh "<< pipeline.parameters.l1_sepolia_rpc_url >>" && \
ops/verify-geth-endpoint.sh "<< pipeline.parameters.l2_sepolia_rpc_url >>"; then
echo "Both RPC endpoints are up to date and not syncing."
echo "<< pipeline.parameters.l1_sepolia_rpc_url >>" > /tmp/l1_sepolia_rpc_url
echo "<< pipeline.parameters.l2_sepolia_rpc_url >>" > /tmp/l2_sepolia_rpc_url
echo "L1_RPC_SEPOLIA=<< pipeline.parameters.l1_sepolia_rpc_url >>" >> $BASH_ENV
echo "L2_RPC_SEPOLIA=<< pipeline.parameters.l2_sepolia_rpc_url >>" >> $BASH_ENV
else
echo "One or both of the RPC endpoints failed the checks."
exit 1
fi
- persist_to_workspace:
root: /tmp
paths:
- l1_sepolia_rpc_url
- l2_sepolia_rpc_url
check_goerli_rpc_endpoints:
circleci_ip_ranges: true
docker:
Expand All @@ -59,17 +54,12 @@ jobs:
if ./ops/verify-geth-endpoint.sh "<< pipeline.parameters.l1_goerli_rpc_url >>" && \
./ops/verify-geth-endpoint.sh "<< pipeline.parameters.l2_goerli_rpc_url >>"; then
echo "Both RPC endpoints are up to date and not syncing."
echo "<< pipeline.parameters.l1_goerli_rpc_url >>" > /tmp/l1_goerli_rpc_url
echo "<< pipeline.parameters.l2_goerli_rpc_url >>" > /tmp/l2_goerli_rpc_url
echo "L1_RPC_GOERLI=<< pipeline.parameters.l1_goerli_rpc_url >>" >> $BASH_ENV
echo "L2_RPC_GOERLI=<< pipeline.parameters.l2_goerli_rpc_url >>" >> $BASH_ENV
else
echo "One or both of the RPC endpoints failed the checks."
exit 1
fi
- persist_to_workspace:
root: /tmp
paths:
- l1_goerli_rpc_url
- l2_goerli_rpc_url
check_mainnet_rpc_endpoints:
circleci_ip_ranges: true
docker:
Expand All @@ -82,17 +72,12 @@ jobs:
if ops/verify-geth-endpoint.sh "<< pipeline.parameters.l1_mainnet_rpc_url >>" && \
ops/verify-geth-endpoint.sh "<< pipeline.parameters.l2_mainnet_rpc_url >>"; then
echo "Both RPC endpoints are up to date and not syncing."
echo "<< pipeline.parameters.l1_mainnet_rpc_url >>" > /tmp/l1_mainnet_rpc_url
echo "<< pipeline.parameters.l2_mainnet_rpc_url >>" > /tmp/l2_mainnet_rpc_url
echo "L1_RPC_MAINNET=<< pipeline.parameters.l1_mainnet_rpc_url >>" >> $BASH_ENV
echo "L2_RPC_MAINNET=<< pipeline.parameters.l2_mainnet_rpc_url >>" >> $BASH_ENV
else
echo "One or both of the RPC endpoints failed the checks."
exit 1
fi
- persist_to_workspace:
root: /tmp
paths:
- l1_mainnet_rpc_url
- l2_mainnet_rpc_url
# TODO: remove/replace when there are real consumers of the RPC URLs
example_mainnet_job:
circleci_ip_ranges: true
Expand All @@ -104,16 +89,14 @@ jobs:
- run:
name: Use RPC URLs
command: |
if [ -f /tmp/l1_mainnet_rpc_url ] && [ -f /tmp/l2_mainnet_rpc_url ]; then
L1_RPC_URL=$(cat /tmp/l1_mainnet_rpc_url)
L2_RPC_URL=$(cat /tmp/l2_mainnet_rpc_url)
if [ -z $L1_RPC_MAINNET ] || [ -z $L1_RPC_MAINNET ]; then
echo "Required RPC URLs are not available."
fi
L1_RPC_URL=$L1_RPC_MAINNET
L2_RPC_URL=$L2_RPC_MAINNET
echo "L1 RPC URL: $L1_RPC_URL"
echo "L2 RPC URL: $L2_RPC_URL"
# Use L1_RPC_URL and L2_RPC_URL here.
else
echo "Required RPC URLs are not available."
exit 1
fi
workflows:
version: 2
Expand Down

0 comments on commit 5ea6959

Please sign in to comment.