-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
34 lines (28 loc) · 1.15 KB
/
Makefile
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
28
29
30
31
32
33
34
.PHONY: dependencies test
COMPONENTNAME = mozart-fetcher
COMPONENT = mozart-fetcher-eu-west-1
REGION = eu-west-1
BUILDPATH = /root/rpmbuild
none:
@ echo Please specifiy a target
dependencies:
mix deps.get
test:
MIX_ENV=test mix compile
MIX_ENV=test mix test
build:
$(eval COSMOS_VERSION:=$(shell cosmos-release generate-version ${COMPONENTNAME}-${REGION}))
mix release
mkdir -p ${BUILDPATH}/SOURCES
cp _build/prod/mozart_fetcher-1.0.0.tar.gz ${BUILDPATH}/SOURCES/mozart_fetcher.tar.gz
tar -zcf ${BUILDPATH}/SOURCES/bake-scripts.tar.gz bake-scripts/
cp mozart-fetcher.spec ${BUILDPATH}/SOURCES/
cp SOURCES/* ${BUILDPATH}/SOURCES/
rpmbuild --define "_topdir ${BUILDPATH}" --define "version ${COSMOS_VERSION}" --define '%dist .bbc.el8' -ba mozart-fetcher.spec
set_repositories:
git clone --single-branch --branch master https://github.com/bbc/mozart-fetcher-build
export COSMOS_CERT=/etc/pki/tls/certs/client.crt; \
export COSMOS_CERT_KEY=/etc/pki/tls/private/client.key; \
cosmos set-repositories ${COMPONENT} mozart-fetcher-build/repositories.json; \
release:
cosmos-release service ${COMPONENT} --release-version=v ${BUILDPATH}/RPMS/x86_64/*.x86_64.rpm;