Skip to content

Commit aa63e31

Browse files
goedelsouptimperrett
authored andcommitted
add Dockerfile and CircleCI orb (#18)
1 parent d38a475 commit aa63e31

2 files changed

Lines changed: 131 additions & 0 deletions

File tree

.circleci/orb.yml

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
version: 2.1
2+
3+
description: |
4+
Run Slipway commands from your workflows
5+
6+
github_creds: &github_creds
7+
8+
endpoint:
9+
description: |
10+
domain of the github api endpoint
11+
type: string
12+
default: $GITHUB_ADDR
13+
14+
github-user:
15+
description: |
16+
the github user with which to perform the operation
17+
type: string
18+
default: $GITHUB_USER
19+
20+
github-token:
21+
description: |
22+
the github access token with which to perform the operation
23+
type: string
24+
default: $GITHUB_TOKEN
25+
26+
executors:
27+
default:
28+
description: |
29+
the base slipway container to use for running commands
30+
31+
parameters:
32+
slipway-version:
33+
type: string
34+
default: "latest"
35+
36+
docker:
37+
- image: getnelson/slipway:<<parameters.slipway-version>>
38+
39+
commands:
40+
gen:
41+
description: |
42+
Generate deployable metadata for units
43+
44+
parameters:
45+
container:
46+
description: |
47+
the container for which to produce a deployable
48+
type: string
49+
50+
format:
51+
description: |
52+
encoding format to use; present options are 'yml' or 'nldp'
53+
type: string
54+
default: yml
55+
56+
steps:
57+
- run:
58+
name: generate deployable metadata
59+
command: |
60+
slipway gen <<parameters.container>> --dir .slipway -f <<parameters.format>>
61+
62+
- persist_workspace:
63+
root: .
64+
paths:
65+
- .slipway
66+
67+
release:
68+
description: |
69+
create a Github release for the given repo + tag
70+
71+
parameters:
72+
<<: *github_creds
73+
74+
repo:
75+
description: the github repository; this must be a fully qualified name [org]/[repo]
76+
type: string
77+
78+
tag:
79+
description: the tag to release
80+
type: string
81+
82+
branch:
83+
description: branch to base release off from
84+
type: string
85+
86+
steps:
87+
- run:
88+
name:
89+
command: |
90+
slipway release --dir .slipway -e <<parameters.endpoint>> -t <<parameters.tag>> -r <<parameters.repo>>
91+
92+
deploy:
93+
description: |
94+
create a Github deployment for a given repository
95+
96+
parameters:
97+
<<: *github_creds
98+
99+
repo:
100+
description: the github repository; this must be a fully qualified name [org]/[repo]
101+
type: string
102+
103+
ref:
104+
description: a github reference to deploy
105+
type: string
106+
107+
context:
108+
description: required Github contexts that should pass before this deployment can be accepted
109+
type: string
110+
default: default
111+
112+
steps:
113+
- run:
114+
name:
115+
command: |
116+
slipway release --dir .slipway -e <<parameters.endpoint>> -t <<parameters.tag>> -r <<parameters.repository>> --ref <<parameters.ref>>

Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM ubuntu:xenial AS install
2+
3+
RUN apt-get update && \
4+
apt-get install -y curl coreutils && \
5+
ln -s /usr/bin/sha1sum /usr/bin/shasum
6+
7+
ADD scripts/install install-slipway
8+
9+
RUN ./install-slipway
10+
11+
FROM gcr.io/distroless/cc
12+
13+
COPY --from=install /usr/local/bin/slipway /usr/bin/slipway
14+
15+
ENTRYPOINT [ "slipway" ]

0 commit comments

Comments
 (0)