Skip to content

Commit

Permalink
Renaming from 'hashicorp-aws' to 'hashistack' (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
QubitPi authored Sep 9, 2024
1 parent 8fa29f6 commit fc39cff
Show file tree
Hide file tree
Showing 32 changed files with 158 additions and 158 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 hashistack 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.
hashistack 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 hashistack 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 hashistack 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 hashistack plugin source (and its dependencies) by running
`go get github.com/QubitPi/packer-plugin-hashistack`. This will download the source to
`$GOPATH/src/github.com/QubitPi/packer-plugin-hashistack`.
2. When working on the hashistack plugin, first `cd $GOPATH/src/github.com/QubitPi/packer-plugin-hashistack`
so you can run `make dev` and easily access other files. `make dev` will build the packer-plugin-hashistack 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 hashistack 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-hashistack` from the project root, and
`mv packer-plugin-hashistack ~/.packer.d/plugins/packer-plugin-hashistack` to install the plugin.
4. After building the hashistack 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-hashistack/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 hashistack plugin](https://github.com/QubitPi/packer-plugin-hashistack/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-hashistack 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 hashistack plugin project.

1. Navigate to the code:

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

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-hashistack.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 hashistack plugin does not attempt to track
the latest version for each dependency.

#### HCL2 Spec Code Generation
Expand Down
14 changes: 7 additions & 7 deletions .github/docker/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Packer Plugin hashicorp-aws Acceptance Tests Base Image
Packer Plugin hashistack Acceptance Tests Base Image
=======================================================

[![badge](https://img.shields.io/badge/DockerHub-2596EC?style=for-the-badge&logo=docker&logoColor=white)](https://hub.docker.com/r/jack20191124/packer-plugin-hashicorp-aws-acc-test-base)
[![badge](https://img.shields.io/badge/DockerHub-2596EC?style=for-the-badge&logo=docker&logoColor=white)](https://hub.docker.com/r/jack20191124/packer-plugin-hashistack-acc-test-base)

This image is used by [packer-plugin-hashicorp-aws](https://github.com/QubitPi/packer-plugin-hashicorp-aws) to perform
This image is used by [packer-plugin-hashistack](https://github.com/QubitPi/packer-plugin-hashistack) to perform
acceptance tests in Docker without the need to test against AWS, which
[requires a real AWS credentials](https://developer.hashicorp.com/packer/tutorials/aws-get-started/aws-get-started-build-image#authenticate-to-aws)

Expand All @@ -19,17 +19,17 @@ packer {
}
}
source "docker" "hashicorp-aws" {
image = "jack20191124/packer-plugin-hashicorp-aws-acc-test-base:latest"
source "docker" "hashistack" {
image = "jack20191124/packer-plugin-hashistack-acc-test-base:latest"
discard = true
}
build {
sources = [
"source.docker.hashicorp-aws"
"source.docker.hashistack"
]
provisioner "hashicorp-aws-webservice-provisioner" {
provisioner "hashistack-webservice-provisioner" {
homeDir = "/"
warSource = "my-webservice.war"
}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@ jobs:
with:
context: .github/docker/
push: true
tags: jack20191124/packer-plugin-hashicorp-aws-acc-test-base:latest
tags: jack20191124/packer-plugin-hashistack-acc-test-base:latest
- name: Push image Description
uses: peter-evans/dockerhub-description@v4
with:
username: jack20191124
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: jack20191124/packer-plugin-hashicorp-aws-acc-test-base
repository: jack20191124/packer-plugin-hashistack-acc-test-base
readme-filepath: .github/docker/README.md

acceptance-tests:
Expand All @@ -103,13 +103,13 @@ jobs:
- name: Install Packer
uses: hashicorp/setup-packer@main
- name: Build plugin
run: go build -ldflags="-X github.com/QubitPi/packer-plugin-hashicorp-aws/version.VersionPrerelease=dev" -o packer-plugin-hashicorp-aws
run: go build -ldflags="-X github.com/QubitPi/packer-plugin-hashistack/version.VersionPrerelease=dev" -o packer-plugin-hashistack
- name: Install dependencies
run: |
packer plugins install github.com/hashicorp/amazon
packer plugins install github.com/hashicorp/docker
- name: Install plugin
run: packer plugins install --path packer-plugin-hashicorp-aws github.com/QubitPi/hashicorp-aws
run: packer plugins install --path packer-plugin-hashistack github.com/QubitPi/hashistack
- name: Run all acceptance tests
run: PACKER_ACC=1 go test -count 1 -v ./... -timeout=120m
env:
Expand All @@ -126,7 +126,7 @@ jobs:
name: Send Slack Notification
if: github.ref != 'refs/heads/master'
needs: acceptance-tests
uses: QubitPi/hashicorp-aws/.github/workflows/slack-notification.yml@master
uses: QubitPi/hashistack/.github/workflows/slack-notification.yml@master
with:
job-status: ${{ needs.acceptance-tests.outputs.outcome }}
secrets:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ permissions:

jobs:
push-release-tag:
uses: QubitPi/hashicorp-aws/.github/workflows/version-bump.yml@master
uses: QubitPi/hashistack/.github/workflows/version-bump.yml@master
with:
user: QubitPi
email: jack20220723@gmail.com
Expand Down Expand Up @@ -77,7 +77,7 @@ jobs:
slack-notification:
name: Send Slack Notification
needs: goreleaser
uses: QubitPi/hashicorp-aws/.github/workflows/slack-notification.yml@master
uses: QubitPi/hashistack/.github/workflows/slack-notification.yml@master
with:
job-status: ${{ needs.goreleaser.outputs.outcome }}
secrets:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
main
packer-plugin-hashicorp-aws
packer-plugin-hashistack
**/packer_log*.txt
**/git_*test.pkr.hcl
crash.log
Expand Down
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 = {
hashistack = {
version = ">= 0.0.1"
source = "github.com/QubitPi/hashicorp-aws"
source = "github.com/QubitPi/hashistack"
}
}
}
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/QubitPi/hashistack
```

### 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 hashistack 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://hashistack.org/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://hashistack.org/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 @@ -52,8 +52,8 @@ packer {
}
}
source "amazon-ebs" "hashicorp-aws" {
ami_name = "packer-plugin-hashicorp-aws-acc-test-ami-react"
source "amazon-ebs" "hashistack" {
ami_name = "packer-plugin-hashistack-acc-test-ami-react"
force_deregister = "true"
force_delete_snapshot = "true"
Expand All @@ -79,10 +79,10 @@ source "amazon-ebs" "hashicorp-aws" {
build {
sources = [
"source.amazon-ebs.hashicorp-aws"
"source.amazon-ebs.hashistack"
]
provisioner "hashicorp-aws-react-provisioner" {
provisioner "hashistack-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://hashistack.org/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://hashistack.org/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" "hashistack" {
ami_name = "packer-plugin-hashistack-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.hashistack"
]
provisioner "hashicorp-aws-sonatype-nexus-repository-provisioner" {
provisioner "hashistack-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" "hashistack" {
ami_name = "packer-plugin-hashistack-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.hashistack"
]
provisioner "hashicorp-aws-webservice-provisioner" {
provisioner "hashistack-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=hashistack
BINARY=packer-plugin-${NAME}

COUNT?=1
Expand Down
Loading

0 comments on commit fc39cff

Please sign in to comment.