Skip to content

Commit

Permalink
Dev (#11)
Browse files Browse the repository at this point in the history
Fixes #6
  • Loading branch information
matfax committed Nov 27, 2018
1 parent 65c6690 commit 5842deb
Show file tree
Hide file tree
Showing 21 changed files with 459 additions and 546 deletions.
19 changes: 10 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2.1

orbs:
orbtools: gofunky/orbtools@dev:198
orbtools: gofunky/orbtools@dev:691
envorb: gofunky/[email protected]
docker: gofunky/[email protected]

Expand Down Expand Up @@ -46,6 +46,10 @@ orbtools_job: &orbtools_job
context: docker-hub
args: "VERSION=${CLI_VERSION},ALPINE=${ALPINE_VERSION},CLI=${CLI_VERSION}"

orb_tests: &orb_tests
success-config: test/success-test.yml
#fail-config: test/invalid-test.yml

workflows:
build_latest_image:
jobs:
Expand Down Expand Up @@ -97,16 +101,14 @@ workflows:
check_orb:
jobs:
- orbtools/check:
name: check_pull_request
<<: [*pr_filter, *use_alpine_version]
<<: [*pr_filter, *use_alpine_version, *orb_tests]

publish_orb:
jobs:
- orbtools/env-pack-publish:
name: publish_latest
- orbtools/publish:
context: orb-tools
version: "dev:${CIRCLE_BUILD_NUM}"
<<: [*master_filter, *use_alpine_version]
<<: [*master_filter, *use_alpine_version, *orb_tests]

release_orb:
jobs:
Expand All @@ -116,8 +118,7 @@ workflows:
variable: ORB_PUBLISHING_VERSION
<<: [*tag_filter, *use_alpine_version]

- orbtools/env-pack-publish:
name: publish_release
- orbtools/publish:
context: orb-tools
<<: [*tag_filter, *use_alpine_version]
<<: [*tag_filter, *use_alpine_version, *orb_tests]
requires: [release_tag]
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG ALPINE
ARG CLI

FROM mikefarah/yq:2.1.2 as yq
FROM mikefarah/yq:2.2.0 as yq
FROM gofunky/envtpl:0.2.1 as envtpl
FROM circleci/circleci-cli:${CLI}-alpine as cli

Expand All @@ -17,6 +17,8 @@ RUN chmod +x /usr/local/bin/envtpl
COPY --from=cli /usr/local/bin/circleci /usr/local/bin/circleci
RUN chmod +x /usr/local/bin/circleci

RUN apk add --no-cache docker

ARG VERSION
ARG BUILD_DATE
ARG VCS_REF
Expand Down
90 changes: 90 additions & 0 deletions src/+parameters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
alpine_version:
description: the Alpine image version
type: string

publish-token-variable:
description: >
the env var containing your publish token. Pass this as a literal string such
as `$ORB_PUBLISHING_TOKEN`. DO NOT paste the actual token into your
configuration. If omitted it's assumed the CLI has already been setup
with a valid token.
By default, an environment variable `$ORB_PUBLISHING_TOKEN` is expected.
Make sure to pass a context to this job that contains the variable.
type: string
default: "${ORB_PUBLISHING_TOKEN}"

destination-file:
description: Path including filename of where the packed orb will be written.
type: string
default: ./.orbspace/orb.yml

orb-path:
description: the path to the orb file
type: string

namespace:
description: >
The namespace of your target orb.
Environment variables from envorbs are accepted.
By default, the git organization is assumed.
type: string
default: ""

orb-name:
description: >
The name of your target orb.
Environment variables from envorbs are accepted.
By default, the git repository name is assumed.
type: string
default: ""

source-dir:
description: >
Path to the root of the orb source directory to be packed.
By default, `src/` is assumed.
type: string
default: src/

store-artifact:
description: If enabled, the destination-file will be stored as artifact.
type: boolean
default: true

patch-environment-variables:
description: >
To replace all template variables with the respective environment variables.
Variables have to be defined in the format `{{"{{"}}.VAR{{"}}"}}`.
type: boolean
default: true

patch-parameters:
description: >
To patch all crosscutting parameters defined in the src/+parameters.yml file.
Parameters that are shared among multiple commands, orbs or executors can thereby be shared.
Define the parameters in the root layer of the +parameters.yml file.
In every yaml file inside the commands, jobs, or executors folder, the parameters are propagated if they
are referenced there via << parameters.xyz >>.
type: boolean
default: true

success-verification:
description: define additional post-test-execution checks to verify that the test succeeded
type: steps
default: []
success-config:
description: the path to the succeeding test case config that refers to the orb jobs to be tested
type: string
default: ""
fail-verification:
description: define additional post-test-execution checks to verify that the test failed
type: steps
default: []
fail-config:
description: the path to the failing test case config that refers to the orb jobs to be tested
type: string
default: ""

test-steps:
description: if you need more than 2 test cases, you can define your own test sequence here using the test command
type: steps
default: []
Loading

0 comments on commit 5842deb

Please sign in to comment.