Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packer publish copy orb #8413

Merged
merged 8 commits into from
Mar 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 38 additions & 13 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ version: 2.1
orbs:
go: gotest/tools@0.0.13
aws-cli: circleci/aws-cli@1.3.2
packer: salaxander/packer@0.0.3

executors:
golang:
Expand All @@ -12,6 +11,16 @@ executors:
ubuntu:
docker:
- image: ubuntu:20.04
packer:
description: |
The HashiCorp provided Packer container
parameters:
packer-version:
type: string
default: "1.8"
docker:
- image: hashicorp/packer:<< parameters.packer-version >>


commands:
install-deps:
Expand Down Expand Up @@ -75,6 +84,26 @@ commands:
command: |
git fetch --all

packer_build:
description: "Run a packer build"
parameters:
template:
description: |
The name of the packer template file
type: string
default: packer.json
args:
description: |
Arguments to pass to the packer build command
type: string
default: ""

steps:
- run:
name: "Run a packer build"
command: packer build << parameters.args >> << parameters.template >>
no_output_timeout: 30m

jobs:
mod-tidy-check:
executor: golang
Expand Down Expand Up @@ -688,49 +717,45 @@ jobs:
publish-packer-mainnet:
description: build and push AWS IAM and DigitalOcean droplet.
executor:
name: packer/default
packer-version: 1.6.6
name: packer
steps:
- checkout
- attach_workspace:
at: "."
- packer/build:
- packer_build:
template: tools/packer/lotus.pkr.hcl
args: "-var ci_workspace_bins=./linux -var lotus_network=mainnet -var git_tag=$CIRCLE_TAG"
publish-packer-calibrationnet:
description: build and push AWS IAM and DigitalOcean droplet.
executor:
name: packer/default
packer-version: 1.6.6
name: packer
steps:
- checkout
- attach_workspace:
at: "."
- packer/build:
- packer_build:
template: tools/packer/lotus.pkr.hcl
args: "-var ci_workspace_bins=./linux-calibrationnet -var lotus_network=calibrationnet -var git_tag=$CIRCLE_TAG"
publish-packer-butterflynet:
description: build and push AWS IAM and DigitalOcean droplet.
executor:
name: packer/default
packer-version: 1.6.6
name: packer
steps:
- checkout
- attach_workspace:
at: "."
- packer/build:
- packer_build:
template: tools/packer/lotus.pkr.hcl
args: "-var ci_workspace_bins=./linux-butterflynet -var lotus_network=butterflynet -var git_tag=$CIRCLE_TAG"
publish-packer-snap:
description: build packer image with snap. mainnet only.
executor:
name: packer/default
packer-version: 1.6.6
name: packer
steps:
- checkout
- attach_workspace:
at: "."
- packer/build:
- packer_build:
template: tools/packer/lotus-snap.pkr.hcl
publish-dockerhub:
description: publish to dockerhub
Expand Down
51 changes: 38 additions & 13 deletions .circleci/template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ version: 2.1
orbs:
go: gotest/tools@0.0.13
aws-cli: circleci/aws-cli@1.3.2
packer: salaxander/packer@0.0.3

executors:
golang:
Expand All @@ -12,6 +11,16 @@ executors:
ubuntu:
docker:
- image: ubuntu:20.04
packer:
description: |
The HashiCorp provided Packer container
parameters:
packer-version:
type: string
default: "1.8"
docker:
- image: hashicorp/packer:<< parameters.packer-version >>


commands:
install-deps:
Expand Down Expand Up @@ -75,6 +84,26 @@ commands:
command: |
git fetch --all

packer_build:
description: "Run a packer build"
parameters:
template:
description: |
The name of the packer template file
type: string
default: packer.json
args:
description: |
Arguments to pass to the packer build command
type: string
default: ""

steps:
- run:
name: "Run a packer build"
command: packer build << parameters.args >> << parameters.template >>
no_output_timeout: 30m

jobs:
mod-tidy-check:
executor: golang
Expand Down Expand Up @@ -688,49 +717,45 @@ jobs:
publish-packer-mainnet:
description: build and push AWS IAM and DigitalOcean droplet.
executor:
name: packer/default
packer-version: 1.6.6
name: packer
steps:
- checkout
- attach_workspace:
at: "."
- packer/build:
- packer_build:
template: tools/packer/lotus.pkr.hcl
args: "-var ci_workspace_bins=./linux -var lotus_network=mainnet -var git_tag=$CIRCLE_TAG"
publish-packer-calibrationnet:
description: build and push AWS IAM and DigitalOcean droplet.
executor:
name: packer/default
packer-version: 1.6.6
name: packer
steps:
- checkout
- attach_workspace:
at: "."
- packer/build:
- packer_build:
template: tools/packer/lotus.pkr.hcl
args: "-var ci_workspace_bins=./linux-calibrationnet -var lotus_network=calibrationnet -var git_tag=$CIRCLE_TAG"
publish-packer-butterflynet:
description: build and push AWS IAM and DigitalOcean droplet.
executor:
name: packer/default
packer-version: 1.6.6
name: packer
steps:
- checkout
- attach_workspace:
at: "."
- packer/build:
- packer_build:
template: tools/packer/lotus.pkr.hcl
args: "-var ci_workspace_bins=./linux-butterflynet -var lotus_network=butterflynet -var git_tag=$CIRCLE_TAG"
publish-packer-snap:
description: build packer image with snap. mainnet only.
executor:
name: packer/default
packer-version: 1.6.6
name: packer
steps:
- checkout
- attach_workspace:
at: "."
- packer/build:
- packer_build:
template: tools/packer/lotus-snap.pkr.hcl
publish-dockerhub:
description: publish to dockerhub
Expand Down