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

# altostra/altostra-orb

Integrate Altostra projects into your CircleCI workflows. Use Altostra to accelerate serverless applications development in a no-code environment. To use this orb, sign up for a free account at https://altostra.com. Learn more: https://docs.altostra.com/integrations/ci-cd/circleci-integration.html


## Commands

### deploy

Push and deploy the current project

| Parameter | Type | Default | Description |
|---|---|---|---|
| `env-name` | string |  | The environment to which to deploy |
| `image-name` | string |  | Optional. The image name (i.e: 1.0.0, v2.4.1, alpha, dev, test, ...) |
| `instance-name` | string |  | The instance name to deploy |

### deploy-version

Deploy the current project from an existing image

| Parameter | Type | Default | Description |
|---|---|---|---|
| `env-name` | string |  | The environment to which to deploy |
| `image-name` | string |  | The image name (i.e: 1.0.0, v2.4.1, ...) |
| `instance-name` | string |  | The instance name to deploy |

### invalidate

Invalidate the CDN caches of the current project

| Parameter | Type | Default | Description |
|---|---|---|---|
| `all` | boolean | true | Invalidate all the CDNs in the instance |
| `cdns` | string |  | Invalidate only the given CDNs by name - spaces separated list |
| `instance-name` | string |  | The instance name to invalidate |
| `paths` | string | /* | The paths to invalidate. Default to all if not provided - spaces separated list |

### push

Push a new image of the current project

| Parameter | Type | Default | Description |
|---|---|---|---|
| `image-name` | string |  | The image name (i.e: 1.0.0, v2.4.1, alpha, dev, test, ...) |

### setup

Install and authenticate with Altostra.


| Parameter | Type | Default | Description |
|---|---|---|---|
| `api-token` | env_var_name | ALTO_API_KEY | Your Altostra API token from https://app.altostra.com/settings/tokens |

### sync

Synchronize files to buckets of the current project

| Parameter | Type | Default | Description |
|---|---|---|---|
| `all` | boolean | true | Sync all the buckets in the instance |
| `buckets` | string |  | Sync only the given buckets by name - spaces separated list |
| `instance-name` | string |  | The instance name to sync |
| `public` | boolean | false | Set public access to files after syncing - private by default |

## Jobs

### deploy-node-project

Build, test and deploy a basic NodeJS project.
This job runs `npm install`, `npm run build` and `npm run test`,
and on success, runs `npm ci --production` and deploys the current project to the requested instance.


| Parameter | Type | Default | Description |
|---|---|---|---|
| `env-name` | string |  | The environment containing this instance |
| `image-name` | string |  | Optional. Image name to use when pushing this version |
| `instance-name` | string |  | The instance this version will be deployed to |
| `node-version` | string | 12.19 | Pick a specific circleci/node image variant: https://hub.docker.com/r/cimg/node/tags |

## Examples

### deploy-node-project

Deploying a standard node project to your repo. Use the "setup" command to install and authenticate with your account. Use the "deploy" command to package and deploy the current project to your repo


```yaml
version: '2.1'
orbs:
  altostra-orb: altostra/altostra-orb@x.y
jobs:
  build-and-push:
    docker:
      - image: cimg/node:12.19
    steps:
      - checkout
      - altostra-orb/setup
      - install:
          command: |
            npm install
          name: Install node modules
      - altostra-orb/deploy:
          env-name: Development
          instance-name: MyInstance
    working_directory: ~/repo
workflows:
  use-my-orb:
    jobs:
      - build-and-push
```

### sync-invalidate-website

Syncing and invalidating a static website project Use the "setup" command to install and authenticate with your account. Use the "sync" command to sync your new files to the s3 bucket Use the "invalidate" command to invalidate the existing CDN


```yaml
version: '2.1'
orbs:
  altostra-orb: altostra/altostra-orb@x.y
jobs:
  sync-and-invalidate:
    docker:
      - image: cimg/node:12.19
    steps:
      - checkout
      - altostra-orb/setup
      - altostra-orb/sync:
          all: true
          instance-name: prod
          public: true
      - altostra-orb/invalidate:
          all: true
          instance-name: prod
    working_directory: ~/repo
workflows:
  use-my-orb:
    jobs:
      - sync-and-invalidate
```