-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
126 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/Dockerfile* | ||
/Makefile | ||
bin/build.sh | ||
bin/configure.py |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{% if arch %} | ||
FROM base-builder:{{ codename }}-{{ arch }}-latest | ||
{% else %} | ||
FROM base-builder:{{ codename }}-latest | ||
{% endif %} | ||
LABEL maintainer="{{ vendor}} <{{ vendor_email }}>" | ||
|
||
RUN apt-get -qq update && apt-get -qq -y install git perl postgresql | ||
|
||
WORKDIR /home/builder | ||
USER builder | ||
|
||
ARG TAG={{ version }} | ||
RUN git clone --recursive https://github.com/mysociety/fixmystreet.git | ||
RUN git checkout v{{ version }} | ||
|
||
WORKDIR /home/builder/fixmystreet | ||
|
||
USER root | ||
RUN cp conf/packages.docker /opt/ | ||
RUN xargs -a "/opt/packages.docker" apt-get -qq -y install >/dev/null | ||
|
||
USER builder | ||
RUN ./script/bootstrap | ||
RUN fpm -s dir -t deb \ | ||
--vendor "mySociety" \ | ||
--maintainer "mySociety <sysadmin@mysociety.org>" \ | ||
--version "{{ version }}" \ | ||
--iteration "ms1" \ | ||
--architecture "native" \ | ||
--url "https://github.com/mysociety/fixmystreet" \ | ||
--description "mysociety's package containing build artefacts to speed up the process of deploying new FixMyStreet servers." \ | ||
-n "fms-base" \ | ||
./local/=/data/fms_deps/perl_modules | ||
|
||
CMD ["sh", "-c", "/bin/mv *.deb ../deb/{{ codename }}"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
.PHONEY: all | ||
{% if shared_package %} | ||
all: build | ||
|
||
build: | ||
@./bin/build.sh | ||
|
||
{% else %} | ||
DISTRIBUTIONS := {{ codenames | join(' ') }} | ||
|
||
all: $(DISTRIBUTIONS) | ||
|
||
.PHONY: $(DISTRIBUTIONS) | ||
$(DISTRIBUTIONS): | ||
@echo "==> Building $@..." | ||
@./bin/build.sh $@ | ||
|
||
{% if can_target_arch %} | ||
ARCHITECTURES := {{ architectures | join(' ') }} | ||
# Handle 'make all-all' | ||
.PHONY: all-all | ||
all-all: | ||
@for dist in $(DISTRIBUTIONS); do \ | ||
for arch in $(ARCHITECTURES); do \ | ||
echo "==> Building $$dist for $$arch..."; \ | ||
./bin/build.sh $$dist $$arch; \ | ||
done; \ | ||
done | ||
|
||
# 'make <distribution>-<architecture>' | ||
.PHONY: $(foreach d,$(DISTRIBUTIONS),$(foreach a,$(ARCHITECTURES),$(d)-$(a))) | ||
$(foreach d,$(DISTRIBUTIONS),$(foreach a,$(ARCHITECTURES),$(d)-$(a))): | ||
@dist=$(shell echo $@ | cut -d- -f1); \ | ||
arch=$(shell echo $@ | cut -d- -f2); \ | ||
echo "==> Building $$dist for $$arch..."; \ | ||
./bin/build.sh $$dist $$arch | ||
|
||
# Handle 'make <distribution>-all' | ||
.PHONY: $(foreach d,$(DISTRIBUTIONS),$(d)-all) | ||
$(foreach d,$(DISTRIBUTIONS),$(d)-all): | ||
@dist=$(shell echo $@ | cut -d- -f1); \ | ||
for arch in $(ARCHITECTURES); do \ | ||
echo "==> Building $$dist for $$arch..."; \ | ||
./bin/build.sh $$dist $$arch; \ | ||
done | ||
|
||
# Handle 'make all-<architecture>' | ||
.PHONY: $(foreach d,$(DISTRIBUTIONS),$(d)-all) | ||
$(foreach a,$(ARCHITECTURES),all-$(a)): | ||
@arch=$(shell echo $@ | cut -d- -f2); \ | ||
for dist in $(DISTRIBUTIONS); do \ | ||
echo "==> Building $$dist for $$arch..."; \ | ||
./bin/build.sh $$dist $$arch; \ | ||
done | ||
{% endif %} | ||
{% endif %} | ||
|
||
.PHONEY: clean-deb clean-images clean-config clean | ||
clean-deb: | ||
@echo "==> Removing old artefacts..." | ||
@rm -fr deb/* || echo "==> No artefacts found." | ||
|
||
clean-images: | ||
@echo "==> Removing old Docker images..." | ||
@docker image ls -q $(shell basename $(shell pwd))-builder | xargs docker rmi -f 2>/dev/null || echo "==> No images found." | ||
|
||
clean-config: | ||
@echo "==> Cleaning up locally generated config..." | ||
@rm -f Dockerfile* | ||
@rm -f Makefile | ||
|
||
clean: clean-deb clean-images clean-config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
iteration: ms1 | ||
version: 6.0 | ||
can_target_arch: true | ||
skip_codenames: | ||
- buster | ||
- bionic | ||
- focal | ||
- jammy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/sh | ||
|
||
[ -f ../../.venv/packaging/bin/activate ] && . ../../.venv/packaging/bin/activate | ||
|
||
./bin/configure.py |
Empty file.