Skip to content

Commit

Permalink
make it work with Node.js and Bun
Browse files Browse the repository at this point in the history
fix example
  • Loading branch information
tsirysndr committed Mar 4, 2024
1 parent 1741676 commit 32dcabc
Show file tree
Hide file tree
Showing 54 changed files with 2,180 additions and 341 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Do not edit this file directly. It is generated by https://deno.land/x/fluent_github_actions

name: Tests
name: ci
on:
push:
branches:
Expand All @@ -14,9 +14,19 @@ jobs:
uses: fluentci-io/setup-fluentci@v4
- name: Run Dagger Pipelines
run: |
fluentci run deno_pipeline
fluentci run deno_pipeline fmt test
dagger -m github.com/fluent-ci-templates/terraform-pipeline@main functions
- name: Upload to Codecov
run: fluentci run codecov_pipeline
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
publish:
needs: tests
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- name: Publish package
run: npx jsr publish --allow-slow-types
2 changes: 1 addition & 1 deletion .github/workflows/example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v2
- uses: denoland/setup-deno@v1
with:
deno-version: v1.37
deno-version: v1.41
- name: Setup Fluent CI CLI
run: deno install -A -r https://cli.fluentci.io -n fluentci
- name: Setup Dagger
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/zenith.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,13 @@ jobs:
working-directory: example
env:
DAGGER_CLOUD_TOKEN: ${{ secrets.DAGGER_CLOUD_TOKEN }}
publish:
needs: tests
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- name: Publish package
run: npx jsr publish --allow-slow-types
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[![fluentci pipeline](https://img.shields.io/badge/dynamic/json?label=pkg.fluentci.io&labelColor=%23000&color=%23460cf1&url=https%3A%2F%2Fapi.fluentci.io%2Fv1%2Fpipeline%2Fterraform_pipeline&query=%24.version)](https://pkg.fluentci.io/terraform_pipeline)
![deno compatibility](https://shield.deno.dev/deno/^1.37)
[![dagger-min-version](https://img.shields.io/badge/dagger-v0.10.0-blue?color=3D66FF&labelColor=000000)](https://dagger.io)
[![ci](https://github.com/fluent-ci-templates/terraform-pipeline/actions/workflows/ci.yml/badge.svg)](https://github.com/fluent-ci-templates/terraform-pipeline/actions/workflows/ci.yml)

A ready-to-use CI/CD Pipeline for managing your infrastructure with [Terraform](https://www.terraform.io/).

Expand All @@ -28,7 +29,7 @@ Now you can run the pipeline with:
fluentci run .
```

## Dagger Module
## 🧩 Dagger Module

Use as a [Dagger](https://dagger.io) module:

Expand All @@ -51,7 +52,7 @@ dagger call apply --src . \
--google-application-credentials /path/to/credentials.json
```

## Environment variables
## 🛠️ Environment variables

| Variable | Description |
| --------------------------- | -------------------------------------------------- |
Expand All @@ -74,7 +75,7 @@ dagger call apply --src . \
| TF_PLUGIN_CACHE_DIR | The Terraform plugin cache directory |
| TF_IGNORE | Display ignored files and directories |

## Jobs
## Jobs

| Job | Description |
| --------- | -------------------------------------- |
Expand Down Expand Up @@ -108,12 +109,12 @@ apply(
): Promise<string>
```

## Programmatic usage
## 👨‍💻 Programmatic usage

You can also use this pipeline programmatically:

```ts
import { init, validate, plan, apply } from "https://pkg.fluentci.io/terraform_pipeline@v0.6.5/mod.ts";
import { init, validate, plan, apply } from "jsr:@fluentci/terraform";

await init();
await validate();
Expand Down
7 changes: 1 addition & 6 deletions ci.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import {
init,
validate,
plan,
apply,
} from "https://pkg.fluentci.io/terraform_pipeline@v0.6.5/mod.ts";
import { init, validate, plan, apply } from "jsr:@fluentci/terraform";

await init();
await validate();
Expand Down
3 changes: 3 additions & 0 deletions deno.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"name": "@fluentci/terraform",
"version": "0.7.0",
"exports": "./mod.ts",
"importMap": "import_map.json",
"tasks": {
"esm:add": "deno run -A https://esm.sh/v128 add",
Expand Down
205 changes: 205 additions & 0 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 23 additions & 29 deletions deps.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
export { assertEquals } from "https://deno.land/std@0.191.0/testing/asserts.ts";
export { assertEquals } from "jsr:@std/testing@0.218.2/asserts";

export type { DirectoryID, SecretID } from "./sdk/client.gen.ts";
export { Directory, Secret, File, Container, dag } from "./sdk/client.gen.ts";
export { connect, uploadContext } from "https://sdk.fluentci.io/v0.3.0/mod.ts";
export { brightGreen } from "https://deno.land/std@0.191.0/fmt/colors.ts";
export { withDevbox } from "https://nix.fluentci.io/v0.5.3/src/dagger/steps.ts";
export { stringifyTree } from "https://esm.sh/stringify-tree@1.1.1";
import gql from "https://esm.sh/graphql-tag@2.12.6";
export { Container, File, Directory, Secret, dag } from "./sdk/client.gen.ts";
export { brightGreen } from "jsr:@std/fmt@0.218.2/colors";
export { stringifyTree } from "npm:stringify-tree@1.1.1";
import { gql } from "npm:graphql-request@6.1.0";
export { gql };
export {
dirname,
join,
resolve,
} from "https://deno.land/std@0.203.0/path/mod.ts";
export { parse } from "https://deno.land/std@0.205.0/flags/mod.ts";
export { snakeCase, camelCase } from "https://cdn.skypack.dev/lodash";
export { dirname, join, resolve } from "jsr:@std/path@0.218.2";
export { parse } from "jsr:@std/flags@0.218.2";

export {
ClientError,
GraphQLClient,
} from "https://esm.sh/v128/graphql-request@6.1.0";
import * as _ from "npm:lodash@4.17.21";
const snakeCase = _.default.snakeCase;
const camelCase = _.default.camelCase;
export { snakeCase, camelCase };

import * as env from "jsr:@tsirysndr/env-js@0.1.3";
export { env };
export { exit } from "jsr:@tsirysndr/exit-js@0.1.0";

export { ClientError, GraphQLClient } from "npm:graphql-request@6.1.0";
export {
DaggerSDKError,
UnknownDaggerError,
Expand All @@ -33,15 +32,10 @@ export {
EngineSessionConnectionTimeoutError,
NotAwaitedRequestError,
ERROR_CODES,
} from "https://esm.sh/@dagger.io/dagger@0.9.3";

export type {
CallbackFct,
ConnectOpts,
} from "https://sdk.fluentci.io/v0.3.0/mod.ts";
} from "./sdk/common/errors/index.ts";

export * as FluentGitlabCI from "https://deno.land/x/fluent_gitlab_ci@v0.4.2/mod.ts";
export * as FluentGithubActions from "https://deno.land/x/fluent_github_actions@v0.2.1/mod.ts";
export * as FluentCircleCI from "https://deno.land/x/fluent_circleci@v0.2.5/mod.ts";
export * as FluentAzurePipelines from "https://deno.land/x/fluent_azure_pipelines@v0.2.0/mod.ts";
export * as FluentAWSCodePipeline from "https://deno.land/x/fluent_aws_codepipeline@v0.2.3/mod.ts";
export * as FluentGitlabCI from "jsr:@tsirysndr/fluent-gitlab-ci@0.5";
export * as FluentGithubActions from "jsr:@tsirysndr/fluent-gh-actions@0.3";
export * as FluentCircleCI from "jsr:@tsirysndr/fluent-circleci@0.3";
export * as FluentAzurePipelines from "jsr:@tsirysndr/fluent-az-pipelines@0.3";
export * as FluentAWSCodePipeline from "jsr:@tsirysndr/fluent-codepipeline@0.3";
Loading

0 comments on commit 32dcabc

Please sign in to comment.