From bbabd63a7b1e463571af11e34e543ceeb66644a4 Mon Sep 17 00:00:00 2001 From: shnee Date: Mon, 30 Jan 2023 14:45:02 -0500 Subject: [PATCH] Added make. --- .drone.yml | 19 ++++++++++++++++++- .gitmodules | 3 +++ Dockerfile | 4 ---- Dockerfile.j2 | 15 +++++++++++++++ Makefile | 27 +++++++++++++++++++++++++++ README.md | 2 ++ common | 1 + 7 files changed, 66 insertions(+), 5 deletions(-) create mode 100644 .gitmodules delete mode 100644 Dockerfile create mode 100644 Dockerfile.j2 create mode 100644 Makefile create mode 160000 common diff --git a/.drone.yml b/.drone.yml index 17519ec..f8ab43b 100644 --- a/.drone.yml +++ b/.drone.yml @@ -11,7 +11,24 @@ steps: path: /var/run commands: - sleep 5 # give docker enough time to start - - docker build . -t shnee/ansible-fedora + - make push-all + + - name: gotify + image: fredix/arm64v8-alpine-drone-gotify + settings: + gotifytoken: + from_secret: gotify-token + gotifyendpoint: http://push.shnee.net + gotifytitle: "{{ repo.name }} - Pipeline Build {{ build.number }}" + gotifypriority: 5 + message: > + {{#success build.status}} + build {{build.number}} succeeded on {{repo.name}}. Good job {{build.author}} {{build.link}} + {{else}} + build {{build.number}} failed on {{repo.name}}. Fix me please {{build.author}} {{build.link}} + {{/success}} + when: + status: [ success, failure ] services: - name: docker diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..9b1adec --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "common"] + path = common + url = git@git.shnee.net:shnee/docker-common.git diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index a87f93c..0000000 --- a/Dockerfile +++ /dev/null @@ -1,4 +0,0 @@ -FROM fedora:latest - -# TODO REM add comment. -RUN dnf install -y ansible diff --git a/Dockerfile.j2 b/Dockerfile.j2 new file mode 100644 index 0000000..f2ed243 --- /dev/null +++ b/Dockerfile.j2 @@ -0,0 +1,15 @@ +FROM {{ base_image_name }}:{{ version }} + +# TODO REM add comment. +RUN \ + dnf install -y nfs-utils && \ + mkdir -p /var/cache/dnf && \ + mount \ + -t nfs \ + -o nolock \ + 192.168.1.204:/pool1/package-caches/dnf \ + /var/cache/dnf && \ + echo "keepcache=1" >> /etc/dnf/dnf.conf && \ + dnf install -y ansible && \ + echo yay + # dnf clean all diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..11ab9b7 --- /dev/null +++ b/Makefile @@ -0,0 +1,27 @@ +default: common/.git build-all + +IMAGE_NAME = ansible-fedora +BASE_IMAGE_NAME = fedora +VERSION_LIST = 36 37 latest + +common/.git: + git submodule update --init + +# TODO REM remove? +# # TODO REM STARTHERE what if we just mafe version targets here that set a +# # 'VERSION' variable? +# latest: +# $(eval VERSION = latest) +# +# # ':' is a bash noop, not sure how other shells will handle it, zsh handles it +# # ok. +# # The ';@:' ensures that 'make: Nothing to be done for '' output for +# # recipes that only have things like 'eval' and 'info'. +# # https://stackoverflow.com/questions/31749487/suppress-make-nothing-to-be-done-for-target +# 36: ;@: +# $(eval VERSION = 36) + +-include common/makefiles/common.mk + +# TODO REM remove version-list? +.PHONY: version-list latest 36 diff --git a/README.md b/README.md index ce6cb17..f3edb99 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ # anisible-fedora-docker +[![Build status](http://drone.shnee.net/api/badges/shnee/ansible-fedora-docker/status.svg?ref=refs/heads/init)](http://drone.shnee.net/shnee/ansible-fedora-docker) + diff --git a/common b/common new file mode 160000 index 0000000..5ced3b0 --- /dev/null +++ b/common @@ -0,0 +1 @@ +Subproject commit 5ced3b0bd482c9e31ee99313f0fb50a9587da78d