1
1
Fork 0
mirror of https://github.com/mcuadros/ascode synced 2024-04-27 12:25:06 +02:00

documentation: fix some typos and whitespace

This commit is contained in:
Javi Fontan 2020-03-29 22:07:15 +02:00
parent b6b3d7da9f
commit ca69c208d3
No known key found for this signature in database
GPG Key ID: CC378C088E01FF94
4 changed files with 22 additions and 22 deletions

View File

@ -3,9 +3,9 @@ title: 'Documentation'
weight: 1
---
## AsCode - Terraform Alternative Syntax
## AsCode - Terraform Alternative Syntax
**AsCode** is a tool to define infrastructure as code using the [Starlark](https://github.com/google/starlark-go/blob/master/doc/spec.md) language on top of [Terraform](https://github.com/hashicorp/terraform). It allows to describe your infrastructure using an expressive language in Terraform without writing a single line of HCL, meanwhile, you have the complete ecosystem of [providers](https://www.terraform.io/docs/providers/index.html)
**AsCode** is a tool to define infrastructure as code using the [Starlark](https://github.com/google/starlark-go/blob/master/doc/spec.md) language on top of [Terraform](https://github.com/hashicorp/terraform). It allows to describe your infrastructure using an expressive language in Terraform without writing a single line of HCL, meanwhile, you have the complete ecosystem of [providers](https://www.terraform.io/docs/providers/index.html)
### Why?
@ -13,4 +13,4 @@ Terraform is a great tool, with support for almost everything you can imagine, m
### What is Starlark?
Starlark is a dialect of Python intended for use as a configuration language. A Starlark interpreter is typically embedded within a larger application, and this application may define additional domain-specific functions and data types beyond those provided by the core language. For example, Starlark is embedded within (and was originally developed for) the Bazel build tool, and Bazel's build language is based on Starlark.
Starlark is a dialect of Python intended to be used as a configuration language. A Starlark interpreter is typically embedded within a larger application, and this application may define additional domain-specific functions and data types beyond those provided by the core language. For example, Starlark is embedded within (and was originally developed for) the Bazel build tool, and Bazel's build language is based on Starlark.

View File

@ -3,7 +3,7 @@ title: 'Getting Started'
weight: 2
---
This page explains the basics of using AsCode to define your infrastructure in Terraform. It assumes that you have already [installed](/docs/install) Ascode.
This page explains the basics of using AsCode to define your infrastructure in Terraform. It assumes that you have already [installed](/docs/install) AsCode.
```sh
> ascode --help
@ -23,9 +23,9 @@ Available commands:
## The `repl` command
The `repl` command provides a handy `REPL` interface for debugging and tinkering with AsCode.
The `repl` command provides a handy `REPL` interface for debugging and tinkering with AsCode.
For example you can explore the API of a resource printing the list of arguments:
For example you can explore the API of a resource printing the list of arguments:
```sh
> ascode repl
@ -49,16 +49,16 @@ resource "aws_instance" "web" {
The `run` command executes a valid Starlack program. Using the `--print-hcl` and `--to-hcl`, an HCL encoded version of the `tf` object will be printed or saved to a given file, respectively.
This is the first step to deploy any infrastructure d defined with AsCode, using `run` and generating a valid `.tf` file, we can use the standard Terraform tooling to deploy our infrastructure using `terraform init`, `terraform plan` and `terraform apply`.
This is the first step to deploy any infrastructure defined with AsCode, using `run` and generating a valid `.tf` file, we can use the standard Terraform tooling to deploy our infrastructure using `terraform init`, `terraform plan` and `terraform apply`.
To learn about writing Starlark programs, please refer to the [Language definition](/docs/starlark/) and the [API Reference](/docs/reference/) sections of this documentation.
### Basic Example
The goal of the example is create, in DigitalOcean, one `s-1vcpu-1gb` instance called `web` in the `nyc2` region:
The goal of the example is to create, in DigitalOcean, one `s-1vcpu-1gb` instance called `web` in the `nyc2` region:
> For running this example, you need `terraform` correctly installed on your system.
> To run this example, you need `terraform` correctly installed on your system.
```sh
> mkdir example; cd example
@ -89,7 +89,7 @@ resource "digitalocean_droplet" "web" {
```
And now as it's common in terraform we can run `init`, `plan` or/and `apply`
And now as it's usual in terraform we can run `init`, `plan` or/and `apply`
```sh
> terraform init

View File

@ -3,13 +3,13 @@ title: 'GitHub Action'
weight: 40
---
AsCode Github Action allows to execute AsCode `run` command in response to a GitHub event such as updating a pull request or pushing a new commit on a specific branch.
AsCode Github Action allows to execute AsCode `run` command in response to a GitHub event such as updating a pull request or pushing a new commit to a specific branch.
This used in combination with the [Terraform GitHub Actions](https://www.terraform.io/docs/github-actions/getting-started.html) allows to execute the different terraform commands `init`, `plan` and `apply` inside of a [GitHub Workflow](https://help.github.com/en/actions/configuring-and-managing-workflows).
## Parameters
| Parameter | **Mandatory**/**Optional** | Description |
| Parameter | **Mandatory**/**Optional** | Description |
| --------- | -------- | ----------- |
| file | **Mandatory** | Starlark file to execute. Default value: `main.star` |
| hcl | **Mandatory** | HCL output file. Default value: `generated.tf` |
@ -31,14 +31,14 @@ jobs:
runs-on: ubuntu-latest
env:
TF_VERSION: latest
TF_WORKING_DIR: .
TF_WORKING_DIR: .
steps:
- name: 'Checkout'
uses: actions/checkout@master
- name: 'AsCode Run'
uses: mcuadros/ascode@gh-action
- name: 'Terraform Init'
uses: hashicorp/terraform-github-actions@master
with:

View File

@ -1,9 +1,9 @@
---
title: 'Quick Install'
weight: 1
weight: 1
---
AsCode is written in [Go](https://golang.org/) with support for multiple platforms.
AsCode is written in [Go](https://golang.org/) with support for multiple platforms.
The latest release can be found at [GitHub Releases.](https://github.com/mcuadros/ascode/releases), currently provides pre-built binaries for the following:
@ -13,11 +13,11 @@ The latest release can be found at [GitHub Releases.](https://github.com/mcuadro
## Binary (Cross-platform)
Download the appropriate version for your platform from [GitHub Releases.](https://github.com/mcuadros/ascode/releases). Once downloaded, the binary can be run from anywhere. You dont need to install it into a global location.
Download the appropriate version for your platform from [GitHub Releases.](https://github.com/mcuadros/ascode/releases). Once downloaded, the binary can be run from anywhere. You dont need to install it into a global location.
Ideally, you should install it somewhere in your PATH for easy use. `/usr/local/bin` is the most probable location.
### Linux
### Linux
```sh
wget https://github.com/mcuadros/ascode/releases/download/{{< param "version" >}}/ascode-{{< param "version" >}}-linux-amd64.tar.gz
tar -xvzf ascode-{{< param "version" >}}-linux-amd64.tar.gz
@ -31,20 +31,20 @@ tar -xvzf ascode-{{< param "version" >}}-darwin-amd64.tar.gz
mv ascode /usr/local/bin/
```
## Source
## Source
### Prerequisite Tools
### Prerequisite Tools
- [Git](https://git-scm.com/)
- [Go](https://golang.org/) (at least Go 1.12)
### Clone from GitHub
AsCode uses the [Go Modules](https://github.com/golang/go/wiki/Modules), so e easiest way to get started is to clone AsCode in a directory outside of the `$GOPATH`, as in the following example:
AsCode uses the [Go Modules](https://github.com/golang/go/wiki/Modules), so the easiest way to get started is to clone AsCode in a directory outside of the `$GOPATH`, as in the following example:
```sh
git clone https://github.com/mcuadros/ascode.git $HOME/ascode-src
cd $HOME/ascode-src
go install ./...
go install ./...
```