From 1fb7762c6c54a1f72ccc11d08c68468ae1599097 Mon Sep 17 00:00:00 2001
From: Janne Koschinski <janne@kuschku.de>
Date: Fri, 2 Aug 2019 15:23:44 +0200
Subject: [PATCH] Add proper makefile and build info

---
 Dockerfile |  8 ++++++--
 Makefile   | 17 +++++++++++++++++
 2 files changed, 23 insertions(+), 2 deletions(-)
 create mode 100644 Makefile

diff --git a/Dockerfile b/Dockerfile
index 90df3da..571d627 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,5 +1,9 @@
 FROM openjdk:8-jdk
 
+# define arguments for versions to be used for platform and build tools
+ARG PLATFORM
+ARG BUILD_TOOLS
+
 RUN apt-get --quiet update --yes && \
     apt-get --quiet install --yes wget tar unzip lib32stdc++6 lib32z1
 RUN wget --quiet --output-document=android-sdk.zip https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip && \
@@ -10,7 +14,7 @@ RUN mkdir android-sdk-linux/licenses && \
     printf "84831b9409646a918e30573bab4c9c91346d8abd" > android-sdk-linux/licenses/android-sdk-preview-license
 RUN android-sdk-linux/tools/bin/sdkmanager --update
 RUN android-sdk-linux/tools/bin/sdkmanager \
-        "platforms;android-28" \
-        "build-tools;29.0.1" \
+        "platforms;android-${PLATFORM}" \
+        "build-tools;${BUILD_TOOLS}" \
         "extras;google;m2repository" \
         "extras;android;m2repository"
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..724ed10
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,17 @@
+NAME=k8r.eu/justjanne/android-sdk
+PLATFORM=28
+BUILD_TOOLS=28.0.3
+
+.PHONY: all
+all: push
+
+.PHONY: build
+build: Dockerfile
+	docker build -t $(NAME):$(PLATFORM)-$(BUILD_TOOLS) --build-arg PLATFORM=$(PLATFORM) --build-arg BUILD_TOOLS=$(BUILD_TOOLS) .
+	docker tag $(NAME):$(PLATFORM)-$(BUILD_TOOLS) $(NAME):latest
+
+.PHONY: push
+push: build
+	docker push $(NAME):$(PLATFORM)-$(BUILD_TOOLS)
+	docker push $(NAME):latest
+
-- 
GitLab