-
-
Notifications
You must be signed in to change notification settings - Fork 150
Expand file tree
/
Copy pathDockerfile
More file actions
27 lines (20 loc) · 1.12 KB
/
Dockerfile
File metadata and controls
27 lines (20 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
ARG SWIFT_VERSION=5.9
FROM swift:${SWIFT_VERSION}-focal
LABEL org.opencontainers.image.authors="Orta Therox"
LABEL "com.github.actions.name"="Danger Swift"
LABEL "com.github.actions.description"="Runs Swift Dangerfiles"
LABEL "com.github.actions.icon"="zap"
LABEL "com.github.actions.color"="blue"
# Install nodejs and Danger
RUN apt-get update -q \
&& apt-get install -qy curl make ca-certificates \
&& curl -sL https://deb.nodesource.com/setup_18.x | bash - \
&& apt-get install -qy nodejs \
&& npm install -g danger \
&& rm -r /var/lib/apt/lists/*
RUN curl -s https://api.github.com/repos/realm/SwiftLint/releases/latest | grep "browser_download_url" | grep "swiftlint_linux_amd64.zip" | cut -d '"' -f 4 | xargs curl -L -o swiftlint.zip && unzip swiftlint.zip -d swiftlint && mv swiftlint/swiftlint /usr/local/bin/swiftlint && chmod +x /usr/local/bin/swiftlint && rm -rf swiftlint swiftlint.zip # swiftlint
# Install danger-swift globally
COPY . _danger-swift
RUN cd _danger-swift && make install && rm -rf _danger-swift
# Run Danger Swift via Danger JS, allowing for custom args
ENTRYPOINT ["danger-swift", "ci"]