Skip to content

Commit

Permalink
refactor: local sandbox rpcUrl change in CI (#10)
Browse files Browse the repository at this point in the history
* chore: try jq change to rpcUrl

* chore: install jq

* chore: test jq without cat

* chore: try single quotes with jq

* chore: remove debugging steps

* chore: added rpcUrl change to readme
  • Loading branch information
GImbrailo authored Jul 8, 2022
1 parent e679573 commit d53abec
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
FROM debian:bullseye
FROM node:16

RUN apt update && apt install jq -y

# Set the DENO_DIR environment variable to controll where the cache is built
RUN mkdir deno
ENV DENO_DIR=/deno
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ A comma separated list of plugins to install.

### `sandbox_name`

The name of the Flextesa sandbox to use. A sandbox will only be created if this input is specified.
The name of the Flextesa sandbox to use. A sandbox will only be created if this input is specified. When running the sandbox, the action will automatically change the value of `rpcUrl` for the sandbox in `config.json`. This is to enable origination to the local sandbox in CI.

### `compile_command`

The compile command used to compile the contracts.

### `originate`

When set to true, contracts will be originated to the environment defined with the `environment` variable (leave empty for default). This option makes use of the `taquito` plugin so please make sure to install it.
When set to true, contracts will be originated to the environment defined with the `environment` variable (leave empty for default). This option makes use of the `taquito` plugin so please make sure to install it.

### `tests`

Expand All @@ -41,7 +41,7 @@ This input is used to select the configured environment for `taqueria` to origin
### Single step action
```yaml
- name: taqueria tasks
uses: ecadlabs/[email protected].0
uses: ecadlabs/[email protected].1
with:
plugins: '@taqueria/plugin-ligo, @taqueria/plugin-flextesa, @taqueria/plugin-taquito'
compile_command: compile
Expand All @@ -53,25 +53,25 @@ This input is used to select the configured environment for `taqueria` to origin
### Multiple step action
```yaml
- name: compile contracts
uses: ecadlabs/[email protected].0
uses: ecadlabs/[email protected].1
with:
project_directory: 'example-projects/hello-tacos'
compile_command: 'compile'

- name: start local sandbox
uses: ecadlabs/[email protected].0
uses: ecadlabs/[email protected].1
with:
project_directory: 'example-projects/hello-tacos'
sandbox_name: 'local'

- name: originate contracts
uses: ecadlabs/[email protected].0
uses: ecadlabs/[email protected].1
with:
project_directory: 'example-projects/hello-tacos'
originate: 'true'

- name: originate contracts
uses: ecadlabs/[email protected].0
uses: ecadlabs/[email protected].1
with:
project_directory: 'example-projects/hello-tacos'
tests: 'true'
Expand Down
2 changes: 2 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ fi

if [ -n "$INPUT_SANDBOX_NAME" ]; then
taq start sandbox $INPUT_SANDBOX_NAME
echo "Setting $INPUT_SANDBOX_NAME sandbox to the correct IP for CICD runs"
cat <<< "$(jq '.sandbox.'$INPUT_SANDBOX_NAME'.rpcUrl="http://172.17.0.1:20000"' .taq/config.json)" > .taq/config.json
fi

if [ "$INPUT_TESTS" == "true" ] || [ "$INPUT_TESTS" == "True" ]; then
Expand Down
2 changes: 1 addition & 1 deletion example-projects/hello-tacos/.taq/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"sandbox": {
"local": {
"label": "Local Tezos Sandbox",
"rpcUrl": "http://172.17.0.1:20000",
"rpcUrl": "http://localhost:20000",
"protocol": "Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A",
"accounts": {
"bob": {
Expand Down

0 comments on commit d53abec

Please sign in to comment.