-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add testdata for integration testing collapse command with hugo orb
- Loading branch information
Zachary Scott
committed
Jun 22, 2018
1 parent
8d42f72
commit 998a258
Showing
10 changed files
with
217 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
workflows: | ||
foo: | ||
jobs: | ||
- hugo/build |
Empty file.
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,3 @@ | ||
# The hugo orb | ||
|
||
I'm just here to make sure we don't try to parse this markdown file as yaml. |
24 changes: 24 additions & 0 deletions
24
cmd/testdata/hugo-collapse/.circleci/orbs/hugo/commands/build-hugo.yml
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,24 @@ | ||
description: "Runs the `hugo` CLI against a given source (default: current path) in a given env (default: production)" | ||
parameters: | ||
env: | ||
description: "Passed in as the value of HUGO_ENV prior to running the hugo command" | ||
type: string | ||
default: "production" | ||
source: | ||
description: "a file path, relative to the root of your working directory, where your hugo root is. (passed as the value of the `-s` flag to hugo)" | ||
type: string | ||
default: "." | ||
update-submodules: | ||
description: "Boolean for whether to update git submodules." | ||
type: boolean | ||
default: false | ||
steps: | ||
- when: | ||
condition: << parameters.update-submodules >> | ||
steps: | ||
- run: | ||
name: "Get submodules to refresh themes" | ||
command: git submodule update --init --recursive | ||
- run: | ||
name: "Build site with hugo" | ||
command: HUGO_ENV=<< parameters.env >> hugo -v -s << parameters.source >> |
8 changes: 8 additions & 0 deletions
8
cmd/testdata/hugo-collapse/.circleci/orbs/hugo/commands/html-proofer.yml
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,8 @@ | ||
parameters: | ||
path: | ||
type: string | ||
description: "Path to the directory containing the published site, relative to the execution environment root." | ||
steps: | ||
- run: | ||
name: "Run HTML Proofer to check for good html and such" | ||
command: htmlproofer << parameters.path>> --allow-hash-href --check-html --empty-alt-ignore --disable-external |
34 changes: 34 additions & 0 deletions
34
cmd/testdata/hugo-collapse/.circleci/orbs/hugo/jobs/build.yml
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,34 @@ | ||
parameters: | ||
source: | ||
description: "a file path, relative to the root of your working directory, where your hugo root is. (passed as the value of the `-s` flag to hugo)" | ||
default: "." | ||
type: string | ||
publishdir: | ||
description: "Hugo sets the name of your publish Dir inside the site config, not as a CLI argument. Most people leave this to the default value of `public`, so that's what we do here. In most case you don't need to change this value." | ||
default: "public" | ||
type: string | ||
html-proofer: | ||
description: "Boolean value for whether to run the HTML Proofer. Set to `false` to stop the default behavior of running the proofer." | ||
type: boolean | ||
default: true | ||
persist_to_workspace: | ||
description: "Boolean value for whether to persist to a workspace drawing from the `parameters.source` as root and `parameters.publishdir` as the path." | ||
type: boolean | ||
default: true | ||
executor: default | ||
steps: | ||
- checkout | ||
- build-hugo: | ||
source: "<< parameters.source >>" | ||
- when: | ||
condition: << parameters.html-proofer >> | ||
steps: | ||
- html-proofer: | ||
- path: "<< parameters.source >>/<< parameters.publishdir >>" | ||
- when: | ||
condition: << parameters.persist_to_workspace >> | ||
steps: | ||
- persist_to_workspace: | ||
root: "<< parameters.source >>" | ||
paths: | ||
- "<< parameters.publishdir >>" |
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,10 @@ | ||
description: "A simple encapsulation of common tasks in Hugo" | ||
|
||
executors: | ||
default: | ||
parameters: | ||
tag: | ||
description: "The tag to use on the image" | ||
type: string | ||
docker: | ||
- image: cibuilds/hugo:<< parameters.image >> |
8 changes: 8 additions & 0 deletions
8
cmd/testdata/hugo-collapse/.circleci/orbs/hugo/usage/build.yml
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,8 @@ | ||
version: 2 | ||
orbs: | ||
hugo: circleci/hugo@latest | ||
|
||
workflows: | ||
build-hugo: | ||
jobs: | ||
- hugo/build |
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,108 @@ | ||
orbs: | ||
hugo: | ||
commands: | ||
build-hugo: | ||
description: 'Runs the `hugo` CLI against a given source (default: current | ||
path) in a given env (default: production)' | ||
parameters: | ||
env: | ||
default: production | ||
description: Passed in as the value of HUGO_ENV prior to running the hugo | ||
command | ||
type: string | ||
source: | ||
default: . | ||
description: a file path, relative to the root of your working directory, | ||
where your hugo root is. (passed as the value of the `-s` flag to hugo) | ||
type: string | ||
update-submodules: | ||
default: false | ||
description: Boolean for whether to update git submodules. | ||
type: boolean | ||
steps: | ||
- when: | ||
condition: << parameters.update-submodules >> | ||
steps: | ||
- run: | ||
command: git submodule update --init --recursive | ||
name: Get submodules to refresh themes | ||
- run: | ||
command: HUGO_ENV=<< parameters.env >> hugo -v -s << parameters.source | ||
>> | ||
name: Build site with hugo | ||
html-proofer: | ||
parameters: | ||
path: | ||
description: Path to the directory containing the published site, relative | ||
to the execution environment root. | ||
type: string | ||
steps: | ||
- run: | ||
command: htmlproofer << parameters.path>> --allow-hash-href --check-html | ||
--empty-alt-ignore --disable-external | ||
name: Run HTML Proofer to check for good html and such | ||
description: A simple encapsulation of common tasks in Hugo | ||
executors: | ||
default: | ||
docker: | ||
- image: cibuilds/hugo:<< parameters.image >> | ||
parameters: | ||
tag: | ||
description: The tag to use on the image | ||
type: string | ||
jobs: | ||
build: | ||
executor: default | ||
parameters: | ||
html-proofer: | ||
default: true | ||
description: Boolean value for whether to run the HTML Proofer. Set to | ||
`false` to stop the default behavior of running the proofer. | ||
type: boolean | ||
persist_to_workspace: | ||
default: true | ||
description: Boolean value for whether to persist to a workspace drawing | ||
from the `parameters.source` as root and `parameters.publishdir` as | ||
the path. | ||
type: boolean | ||
publishdir: | ||
default: public | ||
description: Hugo sets the name of your publish Dir inside the site config, | ||
not as a CLI argument. Most people leave this to the default value of | ||
`public`, so that's what we do here. In most case you don't need to | ||
change this value. | ||
type: string | ||
source: | ||
default: . | ||
description: a file path, relative to the root of your working directory, | ||
where your hugo root is. (passed as the value of the `-s` flag to hugo) | ||
type: string | ||
steps: | ||
- checkout | ||
- build-hugo: | ||
source: << parameters.source >> | ||
- when: | ||
condition: << parameters.html-proofer >> | ||
steps: | ||
- html-proofer: null | ||
- path: << parameters.source >>/<< parameters.publishdir >> | ||
- when: | ||
condition: << parameters.persist_to_workspace >> | ||
steps: | ||
- persist_to_workspace: | ||
paths: | ||
- << parameters.publishdir >> | ||
root: << parameters.source >> | ||
usage: | ||
build: | ||
orbs: | ||
hugo: circleci/hugo@latest | ||
version: 2 | ||
workflows: | ||
build-hugo: | ||
jobs: | ||
- hugo/build | ||
workflows: | ||
foo: | ||
jobs: | ||
- hugo/build |