generated from hashicorp/packer-plugin-scaffolding
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: update install process, adding example (#58)
- Loading branch information
Showing
7 changed files
with
122 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,24 @@ | ||
## The Example Folder | ||
# Example | ||
|
||
This folder must contain a fully working example of the plugin usage. The example must define the `required_plugins` | ||
block. A pre-defined GitHub Action will run `packer init`, `packer validate`, and `packer build` to test your plugin | ||
with the latest version available of Packer. | ||
## Simple Packer Build | ||
|
||
The folder can contain multiple HCL2 compatible files. The action will execute Packer at this folder level | ||
running `packer init -upgrade .` and `packer build .`. | ||
After cloning this repo, move to the `example` directory by running: | ||
|
||
If the plugin requires authentication, the configuration should be provided via GitHub Secrets and set as environment | ||
variables in the [test-plugin-example.yml](/.github/workflows/test-plugin-example.yml) file. Example: | ||
```sh | ||
$ cd packer-plugin-scaleway/example | ||
``` | ||
|
||
```yml | ||
- name: Build | ||
working-directory: ${{ github.event.inputs.folder }} | ||
run: PACKER_LOG=${{ github.event.inputs.logs }} packer build . | ||
env: | ||
AUTH_KEY: ${{ secrets.AUTH_KEY }} | ||
AUTH_PASSWORD: ${{ secrets.AUTH_PASSWORD }} | ||
``` | ||
Either modify `basic_scaleway.pkr.hcl` to reflect your Scaleway keys and project id, or comment that out and set the environment variables by running: | ||
|
||
```sh | ||
$ export SCW_DEFAULT_PROJECT_ID=<your scaleway project id> | ||
$ export SCW_ACCESS_KEY=<your scaleway access key> | ||
$ export SCW_SECRET_KEY=<your scaleway secret key> | ||
``` | ||
|
||
Then run the following commands to build a simple Scaleway image via Packer: | ||
|
||
```sh | ||
$ packer init basic_scaleway.pkr.hcl | ||
$ packer build basic_scaleway.pkr.hcl | ||
``` |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
packer { | ||
required_plugins { | ||
scaleway = { | ||
version = ">= 1.0.5" | ||
source = "github.com/scaleway/scaleway" | ||
} | ||
} | ||
} | ||
|
||
source "scaleway" "basic" { | ||
project_id = "YOUR PROJECT ID" | ||
access_key = "YOUR ACCESS KEY" | ||
secret_key = "YOUR SECRET KEY" | ||
commercial_type = "DEV1-S" | ||
image = "ubuntu_focal" | ||
image_name = "basic build" | ||
ssh_username = "root" | ||
zone = "fr-par-1" | ||
} | ||
|
||
build { | ||
sources = ["source.scaleway.basic"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters