> For the complete CircleCI developer hub index, see [llms.txt](https://circleci.com/developer/llms.txt)

# bufferings/pixela

An Orb to update your Pixela graph. This Orb supports increment/decrement/put pixel.


## Commands

### decrement

Decrement pixel quantity of the day.


| Parameter | Type | Default | Description |
|---|---|---|---|
| `graph-id` | string | ${PIXELA_GRAPH_ID} | Pixela graph ID. |
| `token-envvar` | env_var_name | PIXELA_TOKEN | Environment variable name to get pixela token. Please don't specify the token value, but the env var name.
 |
| `username` | string | ${PIXELA_USERNAME} | Pixela username. |
| `when` | enum | on_success | When to run the command. |

### increment

Increment pixel quantity of the day.


| Parameter | Type | Default | Description |
|---|---|---|---|
| `graph-id` | string | ${PIXELA_GRAPH_ID} | Pixela graph ID. |
| `token-envvar` | env_var_name | PIXELA_TOKEN | Environment variable name to get pixela token. Please don't specify the token value, but the env var name.
 |
| `username` | string | ${PIXELA_USERNAME} | Pixela username. |
| `when` | enum | on_success | When to run the command. |

### put

Update pixel quantity. It uses the following environment variables:
* PIXELA_DATE: yyyyMMdd
* PIXELA_QUANTITY: pixel quantity to set
* PIXELA_OPTIONAL_DATA: additional information for the pixel
It expects these values are set in the $BASH_ENV in the previous steps.


| Parameter | Type | Default | Description |
|---|---|---|---|
| `graph-id` | string | ${PIXELA_GRAPH_ID} | Pixela graph ID. |
| `token-envvar` | env_var_name | PIXELA_TOKEN | Environment variable name to get pixela token. Please don't specify the token value, but the env var name.
 |
| `username` | string | ${PIXELA_USERNAME} | Pixela username. |
| `when` | enum | on_success | When to run the command. |

## Jobs

### decrement

Decrement pixel quantity of the day.


| Parameter | Type | Default | Description |
|---|---|---|---|
| `graph-id` | string | ${PIXELA_GRAPH_ID} | Pixela graph ID. |
| `token-envvar` | env_var_name | PIXELA_TOKEN | Environment variable name to get pixela token. Please don't specify the token value, but the env var name.
 |
| `username` | string | ${PIXELA_USERNAME} | Pixela username. |
| `when` | enum | on_success | When to run the command. |

### increment

Increment pixel quantity of the day.


| Parameter | Type | Default | Description |
|---|---|---|---|
| `graph-id` | string | ${PIXELA_GRAPH_ID} | Pixela graph ID. |
| `token-envvar` | env_var_name | PIXELA_TOKEN | Environment variable name to get pixela token. Please don't specify the token value, but the env var name.
 |
| `username` | string | ${PIXELA_USERNAME} | Pixela username. |
| `when` | enum | on_success | When to run the command. |

### put

Update pixel quantity. It uses the following environment variables:
* PIXELA_DATE: yyyyMMdd
* PIXELA_QUANTITY: pixel quantity to set
* PIXELA_OPTIONAL_DATA: additional information for the pixel
It expects these values are set in the $BASH_ENV in the pre-steps.


| Parameter | Type | Default | Description |
|---|---|---|---|
| `graph-id` | string | ${PIXELA_GRAPH_ID} | Pixela graph ID. |
| `token-envvar` | env_var_name | PIXELA_TOKEN | Environment variable name to get pixela token. Please don't specify the token value, but the env var name.
 |
| `username` | string | ${PIXELA_USERNAME} | Pixela username. |
| `when` | enum | on_success | When to run the command. |

## Executors

### default

Base image for this Orb.
This Orb depends on curl and jq, so please install them when you use other images.


| Parameter | Type | Default | Description |
|---|---|---|---|
| `tag` | string | stable | Pick a specific cimg/base image variant: https://hub.docker.com/r/cimg/base/tags
 |

## Examples

### example

You can just call "pixela/increment" and "pixela/decrement" job with the following env vars
* PIXELA_TOKEN
* PIXELA_USERNAME
* PIXELA_GRAPH_ID

You can use parameter if you want to update different graphs.

You can call "pixela/put" job with "pre-steps" to pass date and quantity through the $BASH_ENV
* PIXELA_DATE (yyyyMMdd)
* PIXELA_QUANTITY

All the three jobs have "when" parameter so that you can choose when to execute the step if you use "pre-steps".

Working example → https://github.com/bufferings/orb-pixela-example


```yaml
version: '2.1'
orbs:
  pixela: bufferings/pixela@<please set the latest version>
workflows:
  envvars-example:
    jobs:
      - pixela/increment
  parameters-example:
    jobs:
      - pixela/decrement:
          graph-id: another-graph-id
  put-example:
    jobs:
      - pixela/put:
          pre-steps:
            - run:
                command: >
                  echo "export PIXELA_DATE=$(TZ=Asia/Tokyo date '+%Y%m%d' --date
                  '1 day ago')" >> $BASH_ENV

                  echo 'export PIXELA_QUANTITY=15' >> $BASH_ENV
```