Skip to content

Commit

Permalink
Change 'QubitPi/packer-plugin-hashicorp-aws' to 'paion-data/packer-pl…
Browse files Browse the repository at this point in the history
…ugin-paion-data'
  • Loading branch information
QubitPi committed Jul 10, 2024
1 parent e755fc1 commit 40f503c
Show file tree
Hide file tree
Showing 28 changed files with 126 additions and 202 deletions.
44 changes: 22 additions & 22 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Contributing to hashicorp-aws Plugin
====================================
Contributing to paion-data Plugin
=================================

**First:** if you're unsure or afraid of _anything_, just ask or submit the issue or pull request anyway. You won't be
yelled at for giving your best effort. The worst that can happen is that you'll be politely asked to change something.
Expand Down Expand Up @@ -46,46 +46,46 @@ Setting up Go
-------------

If you have never worked with Go before, you will have to install its runtime in order to build packer with the
hashicorp-aws plugin.
paion-data plugin.

This project always releases from the latest version of golang. [Install go](https://golang.org/doc/install#install) to
properly build from source, you need to have golang >= 1.21

Setting up hashicorp-aws Plugin for Dev
---------------------------------------
Setting up paion-data Plugin for Dev
------------------------------------

With Go installed, you can already `go get` the hashicorp-aws plugin and `make dev` in order to compile and test it.
With Go installed, you can already `go get` the paion-data plugin and `make dev` in order to compile and test it.
These instructions target POSIX-like environments (macOS, Linux, Cygwin, etc.) so you may need to adjust them for
Windows or other shells.

1. Download the hashicorp-aws plugin source (and its dependencies) by running
`go get github.com/QubitPi/packer-plugin-hashicorp-aws`. This will download the source to
`$GOPATH/src/github.com/QubitPi/packer-plugin-hashicorp-aws`.
2. When working on the hashicorp-aws plugin, first `cd $GOPATH/src/github.com/QubitPi/packer-plugin-hashicorp-aws`
so you can run `make dev` and easily access other files. `make dev` will build the packer-plugin-hashicorp-aws binary
1. Download the paion-data plugin source (and its dependencies) by running
`go get github.com/paion-data/packer-plugin-paion-data`. This will download the source to
`$GOPATH/src/github.com/paion-data/packer-plugin-paion-data`.
2. When working on the paion-data plugin, first `cd $GOPATH/src/github.com/paion-data/packer-plugin-paion-data`
so you can run `make dev` and easily access other files. `make dev` will build the packer-plugin-paion-data binary
and install it under `$HOME/.packer.d/plugins/`.
3. Make your changes to the hashicorp-aws plugin source. You can run `make dev` to build and install locally, and
3. Make your changes to the paion-data plugin source. You can run `make dev` to build and install locally, and
`make test` to run unit tests. Any compilation errors will be shown when the binaries are rebuilding. If you don't
have `make` you can simply run `go build -o packer-plugin-hashicorp-aws` from the project root, and
`mv packer-plugin-hashicorp-aws ~/.packer.d/plugins/packer-plugin-hashicorp-aws` to install the plugin.
4. After building the hashicorp-aws plugin successfully, use the latest version of Packer to build a machine and verify
your changes. In the [example folder](https://github.com/QubitPi/packer-plugin-hashicorp-aws/blob/main/example) we
have `make` you can simply run `go build -o packer-plugin-paion-data` from the project root, and
`mv packer-plugin-paion-data ~/.packer.d/plugins/packer-plugin-paion-data` to install the plugin.
4. After building the paion-data plugin successfully, use the latest version of Packer to build a machine and verify
your changes. In the [example folder](https://github.com/paion-data/packer-plugin-paion-data/blob/main/example) we
provide a basic template. Comment out the `packer {}` block to force Packer use the development binary installed in
the previous step.
5. If everything works well and the tests pass, run `go fmt ./...` on your code before submitting a pull-request.

### Opening a Pull Request

Thank you for contributing! When you are ready to open a pull-request, you will
need to [fork the hashicorp-aws plugin](https://github.com/QubitPi/packer-plugin-hashicorp-aws/fork), push your
need to [fork the paion-data plugin](https://github.com/paion-data/packer-plugin-paion-data/fork), push your
changes to your fork, and then open a pull-request.

For example, my github username is `myuser`, so I would do the following:

```
git checkout -b f-my-feature
# Develop a patch.
git push https://github.com/myuser/packer-plugin-hashicorp-aws f-my-feature
git push https://github.com/myuser/packer-plugin-paion-data f-my-feature
```

From there, open your fork in your browser to open a new pull-request.
Expand Down Expand Up @@ -141,12 +141,12 @@ and please know that we appreciate the time and energy you put into the project.

#### Working on forks

The easiest way to work on a fork is to set it as a remote of the hashicorp-aws plugin project.
The easiest way to work on a fork is to set it as a remote of the paion-data plugin project.

1. Navigate to the code:

```shell
cd $GOPATH/src/github.com/QubitPi/packer-plugin-hashicorp-aws
cd $GOPATH/src/github.com/paion-data/packer-plugin-paion-data
```

2. Add the remote by running:
Expand All @@ -158,7 +158,7 @@ The easiest way to work on a fork is to set it as a remote of the hashicorp-aws
For example:

```shell
git remote add myuser https://github.com/myuser/packer-plugin-hashicorp-aws.git
git remote add myuser https://github.com/myuser/packer-plugin-paion-data.git
```

3. Checkout a feature branch:
Expand Down Expand Up @@ -188,7 +188,7 @@ recommended but not required.
Use `go get <project>` to add dependencies to the project. See
[go mod quick start](https://github.com/golang/go/wiki/Modules#quick-start) for examples.

Please only apply the minimal vendor changes to get your PR to work. The hashicorp-aws plugin does not attempt to track
Please only apply the minimal vendor changes to get your PR to work. The paion-data plugin does not attempt to track
the latest version for each dependency.

#### HCL2 Spec Code Generation
Expand Down
22 changes: 0 additions & 22 deletions .github/docker/Dockerfile

This file was deleted.

39 changes: 0 additions & 39 deletions .github/docker/README.md

This file was deleted.

9 changes: 0 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,3 @@ jobs:
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
API_VERSION: ${{ steps.plugin_describe.outputs.api_version }}

slack-notification:
name: Send Slack Notification
needs: goreleaser
uses: QubitPi/hashicorp-aws/.github/workflows/slack-notification.yml@master
with:
job-status: ${{ needs.goreleaser.outputs.outcome }}
secrets:
slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }}
8 changes: 4 additions & 4 deletions .web-docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ To install this plugin, copy and paste this code into Packer configuration, then
```hcl
packer {
required_plugins {
hashicorp-aws = {
paion-data = {
version = ">= 0.0.1"
source = "github.com/QubitPi/hashicorp-aws"
source = "github.com/paion-data/paion-data"
}
}
}
Expand All @@ -25,7 +25,7 @@ packer {
Alternatively, we can use `packer plugins install` to manage installation of this plugin.

```sh
$ packer plugins install github.com/QubitPi/hashicorp-aws
$ packer plugins install github.com/paion-data/paion-data
```

### Components
Expand All @@ -38,7 +38,7 @@ They enable
1. programmatic configuration management which is not possible with HCL, and
2. code reuse

The business logics that satisfy the two criteria above are offered as the hashicorp-aws provisioners below:
The business logics that satisfy the two criteria above are offered as the paion-data provisioners below:

- [React App](./provisioners/react.mdx)
- [Sonatype Nexus Repository](./provisioners/sonatype-nexus-repository.mdx)
Expand Down
12 changes: 6 additions & 6 deletions .web-docs/components/provisioner/react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ The `react` provisioner is used to install a compiled React-based APP in AWS AMI
If it is relative, it is relative to the working directory when Packer is executed.
- `appDomain` (string) - the SSL-enabled domain that will serve the deployed HTTP React APP instance.
- `sslCertBase64` (string) - is a __base64 encoded__ string of the content of
[SSL certificate file](https://hashicorp-aws.com/docs/setup#optional-setup-ssl) for the SSL-enabled domain, for
[SSL certificate file](https://immutable-infrastructure.com/docs/setup#optional-setup-ssl) for the SSL-enabled domain, for
example `app.mycompany.com` given the `appDomain` is `app.mycompany.com`.
- `sslCertKeyBase64` (string) - is a __base64 encoded__ string of the content of
[SSL certificate key file](https://hashicorp-aws.com/docs/setup#optional-setup-ssl) for the SSL-enabled domain, for
[SSL certificate key file](https://immutable-infrastructure.com/docs/setup#optional-setup-ssl) for the SSL-enabled domain, for
example `app.mycompany.com` given the `appDomain` is `app.mycompany.com`.


Expand Down Expand Up @@ -51,8 +51,8 @@ packer {
}
}
source "amazon-ebs" "hashicorp-aws" {
ami_name = "packer-plugin-hashicorp-aws-acc-test-ami-react"
source "amazon-ebs" "paion-data" {
ami_name = "packer-plugin-paion-data-acc-test-ami-react"
force_deregister = "true"
force_delete_snapshot = "true"
Expand All @@ -78,10 +78,10 @@ source "amazon-ebs" "hashicorp-aws" {
build {
sources = [
"source.amazon-ebs.hashicorp-aws"
"source.amazon-ebs.paion-data"
]
provisioner "hashicorp-aws-react-provisioner" {
provisioner "paion-data-react-provisioner" {
distSource = "./dist"
homeDir = "/home/ubuntu"
sslCertBase64 = "YXNkZnNnaHRkeWhyZXJ3ZGZydGV3ZHNmZ3RoeTY0cmV3ZGZyZWd0cmV3d2ZyZw=="
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ The `sonatype-nexus-repository` provisioner is used to install Sonatype Nexus Re

- `sonatypeNexusRepositoryDomain` (string) - the SSL-enabled domain that will serve the deployed HTTP Nexus instance.
- `sslCertBase64` (string) - is a __base64 encoded__ string of the content of
[SSL certificate file](https://hashicorp-aws.com/docs/setup#optional-setup-ssl) for the SSL-enabled domain, for
[SSL certificate file](https://immutable-infrastructure.com/docs/setup#optional-setup-ssl) for the SSL-enabled domain, for
example `nexus.mycompany.com` given the `sonatypeNexusRepositoryDomain` is `nexus.mycompany.com`.
- `sslCertKeyBase64` (string) - is a __base64 encoded__ string of the content of
[SSL certificate key file](https://hashicorp-aws.com/docs/setup#optional-setup-ssl) for the SSL-enabled domain, for
[SSL certificate key file](https://immutable-infrastructure.com/docs/setup#optional-setup-ssl) for the SSL-enabled domain, for
example `nexus.mycompany.com` given the `sonatypeNexusRepositoryDomain` is `nexus.mycompany.com`.

<!--
Expand Down Expand Up @@ -48,8 +48,8 @@ packer {
}
}
source "amazon-ebs" "hashicorp-aws" {
ami_name = "packer-plugin-hashicorp-aws-acc-test-ami"
source "amazon-ebs" "paion-data" {
ami_name = "packer-plugin-paion-data-acc-test-ami"
force_deregister = "true"
force_delete_snapshot = "true"
Expand All @@ -75,10 +75,10 @@ source "amazon-ebs" "hashicorp-aws" {
build {
sources = [
"source.amazon-ebs.hashicorp-aws"
"source.amazon-ebs.paion-data"
]
provisioner "hashicorp-aws-sonatype-nexus-repository-provisioner" {
provisioner "paion-data-sonatype-nexus-repository-provisioner" {
homeDir = "/home/ubuntu"
sslCertBase64 = "YXNkZnNnaHRkeWhyZXJ3ZGZydGV3ZHNmZ3RoeTY0cmV3ZGZyZWd0cmV3d2ZyZw=="
sslCertKeyBase64 = "MzI0NXRnZjk4dmJoIGNsO2VbNDM1MHRdzszNDM1b2l0cmo="
Expand Down
8 changes: 4 additions & 4 deletions .web-docs/components/provisioner/webservice/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ packer {
}
}
source "amazon-ebs" "hashicorp-aws" {
ami_name = "packer-plugin-hashicorp-aws-acc-test-ami"
source "amazon-ebs" "paion-data" {
ami_name = "packer-plugin-paion-data-acc-test-ami"
force_deregister = "true"
force_delete_snapshot = "true"
Expand All @@ -71,10 +71,10 @@ source "amazon-ebs" "hashicorp-aws" {
build {
sources = [
"source.amazon-ebs.hashicorp-aws"
"source.amazon-ebs.paion-data"
]
provisioner "hashicorp-aws-webservice-provisioner" {
provisioner "paion-data-webservice-provisioner" {
homeDir = "/home/ubuntu"
warSource = "my-webservice.war"
}
Expand Down
2 changes: 1 addition & 1 deletion GNUmakefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
NAME=hashicorp-aws
NAME=paion-data
BINARY=packer-plugin-${NAME}

COUNT?=1
Expand Down
Loading

0 comments on commit 40f503c

Please sign in to comment.