-image: swift:5.0.1
+image: lyriclitest/swift:5.0.1
stages:
- lint
paths:
- .build/
-before_script:
- - apt install -y ruby ruby-dev libsqlite3-dev wget
- - gem install jazzy
- - "./Scripts/install_sourcekitten.sh"
- - "./Scripts/install_swiftlint.sh"
-
lint:
stage: lint
script:
--- /dev/null
+ARG swift_version=latest
+FROM swift:${swift_version}
+
+RUN apt-get update && apt-get install -y \
+ libsqlite3-dev \
+ ruby \
+ ruby-dev \
+ wget \
+ && rm -rf /var/lib/apt/lists/*
+
+RUN gem install --no-ri --no-rdoc jazzy
+
+# SourceKitten
+
+RUN git clone https://github.com/jpsim/SourceKitten.git /tmp/SourceKitten \
+ && cd /tmp/SourceKitten \
+ && make install \
+ && rm -rf /tmp/SourceKitten
+
+# Swiftlint
+
+RUN git clone https://github.com/realm/SwiftLint.git /tmp/SwiftLint \
+ && cd /tmp/SwiftLint \
+ && git submodule update --init --recursive \
+ && make install \
+ && rm -rf /tmp/SwiftLint
install_path = /usr/local/bin
source_binary_path = $(build_path)/$(configuration)/$(source_binary_name)
install_binary_path = $(install_path)/$(target_binary_name)
+swift_version = 5.0.1
# Default to release configuration on install
install: configuration = release
clean:
swift package clean
-.PHONY: build install test clean lint
+docker-build:
+ docker build --force-rm --build-arg swift_version=$(swift_version) -t lyriclitest/swift:$(swift_version) .
+
+docker-push: docker-build
+ docker push lyriclitest/swift:$(swift_version)
+
+.PHONY: build install test clean lint docker-build docker-push
+++ /dev/null
-#!/bin/bash
-
-# Installs SourceKitten from source (Intended to be used with
-# swift docker image)
-
-set -e
-
-git clone https://github.com/jpsim/SourceKitten.git /tmp/SourceKitten &&
-cd /tmp/SourceKitten &&
-make install
+++ /dev/null
-#!/bin/bash
-
-# Installs SwiftLint from source (Intended to be used with
-# swift docker image)
-
-set -e
-
-git clone https://github.com/realm/SwiftLint.git /tmp/SwiftLint &&
-cd /tmp/SwiftLint &&
-git submodule update --init --recursive &&
-make install