Skip to content

Commit 5842deb

Browse files
authored
Dev (#11)
Fixes #6
1 parent 65c6690 commit 5842deb

21 files changed

+459
-546
lines changed

.circleci/config.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: 2.1
22

33
orbs:
4-
orbtools: gofunky/orbtools@dev:198
4+
orbtools: gofunky/orbtools@dev:691
55
envorb: gofunky/envorb@0.3.9
66
docker: gofunky/docker@0.1.2
77

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

49+
orb_tests: &orb_tests
50+
success-config: test/success-test.yml
51+
#fail-config: test/invalid-test.yml
52+
4953
workflows:
5054
build_latest_image:
5155
jobs:
@@ -97,16 +101,14 @@ workflows:
97101
check_orb:
98102
jobs:
99103
- orbtools/check:
100-
name: check_pull_request
101-
<<: [*pr_filter, *use_alpine_version]
104+
<<: [*pr_filter, *use_alpine_version, *orb_tests]
102105

103106
publish_orb:
104107
jobs:
105-
- orbtools/env-pack-publish:
106-
name: publish_latest
108+
- orbtools/publish:
107109
context: orb-tools
108110
version: "dev:${CIRCLE_BUILD_NUM}"
109-
<<: [*master_filter, *use_alpine_version]
111+
<<: [*master_filter, *use_alpine_version, *orb_tests]
110112

111113
release_orb:
112114
jobs:
@@ -116,8 +118,7 @@ workflows:
116118
variable: ORB_PUBLISHING_VERSION
117119
<<: [*tag_filter, *use_alpine_version]
118120

119-
- orbtools/env-pack-publish:
120-
name: publish_release
121+
- orbtools/publish:
121122
context: orb-tools
122-
<<: [*tag_filter, *use_alpine_version]
123+
<<: [*tag_filter, *use_alpine_version, *orb_tests]
123124
requires: [release_tag]

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ARG ALPINE
22
ARG CLI
33

4-
FROM mikefarah/yq:2.1.2 as yq
4+
FROM mikefarah/yq:2.2.0 as yq
55
FROM gofunky/envtpl:0.2.1 as envtpl
66
FROM circleci/circleci-cli:${CLI}-alpine as cli
77

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

20+
RUN apk add --no-cache docker
21+
2022
ARG VERSION
2123
ARG BUILD_DATE
2224
ARG VCS_REF

src/+parameters.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
alpine_version:
2+
description: the Alpine image version
3+
type: string
4+
5+
publish-token-variable:
6+
description: >
7+
the env var containing your publish token. Pass this as a literal string such
8+
as `$ORB_PUBLISHING_TOKEN`. DO NOT paste the actual token into your
9+
configuration. If omitted it's assumed the CLI has already been setup
10+
with a valid token.
11+
By default, an environment variable `$ORB_PUBLISHING_TOKEN` is expected.
12+
Make sure to pass a context to this job that contains the variable.
13+
type: string
14+
default: "${ORB_PUBLISHING_TOKEN}"
15+
16+
destination-file:
17+
description: Path including filename of where the packed orb will be written.
18+
type: string
19+
default: ./.orbspace/orb.yml
20+
21+
orb-path:
22+
description: the path to the orb file
23+
type: string
24+
25+
namespace:
26+
description: >
27+
The namespace of your target orb.
28+
Environment variables from envorbs are accepted.
29+
By default, the git organization is assumed.
30+
type: string
31+
default: ""
32+
33+
orb-name:
34+
description: >
35+
The name of your target orb.
36+
Environment variables from envorbs are accepted.
37+
By default, the git repository name is assumed.
38+
type: string
39+
default: ""
40+
41+
source-dir:
42+
description: >
43+
Path to the root of the orb source directory to be packed.
44+
By default, `src/` is assumed.
45+
type: string
46+
default: src/
47+
48+
store-artifact:
49+
description: If enabled, the destination-file will be stored as artifact.
50+
type: boolean
51+
default: true
52+
53+
patch-environment-variables:
54+
description: >
55+
To replace all template variables with the respective environment variables.
56+
Variables have to be defined in the format `{{"{{"}}.VAR{{"}}"}}`.
57+
type: boolean
58+
default: true
59+
60+
patch-parameters:
61+
description: >
62+
To patch all crosscutting parameters defined in the src/+parameters.yml file.
63+
Parameters that are shared among multiple commands, orbs or executors can thereby be shared.
64+
Define the parameters in the root layer of the +parameters.yml file.
65+
In every yaml file inside the commands, jobs, or executors folder, the parameters are propagated if they
66+
are referenced there via << parameters.xyz >>.
67+
type: boolean
68+
default: true
69+
70+
success-verification:
71+
description: define additional post-test-execution checks to verify that the test succeeded
72+
type: steps
73+
default: []
74+
success-config:
75+
description: the path to the succeeding test case config that refers to the orb jobs to be tested
76+
type: string
77+
default: ""
78+
fail-verification:
79+
description: define additional post-test-execution checks to verify that the test failed
80+
type: steps
81+
default: []
82+
fail-config:
83+
description: the path to the failing test case config that refers to the orb jobs to be tested
84+
type: string
85+
default: ""
86+
87+
test-steps:
88+
description: if you need more than 2 test cases, you can define your own test sequence here using the test command
89+
type: steps
90+
default: []

0 commit comments

Comments
 (0)