Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
configuration
Commits
9d27b4db
Commit
9d27b4db
authored
May 03, 2017
by
Ned Batchelder
Committed by
GitHub
May 03, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3844 from edx/nedbat/modular-makefiles
Better modularization of makefiles
parents
8c79f35a
ffbb9f74
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
29 deletions
+38
-29
Makefile
+4
-25
docker.mk
+22
-2
test.mk
+12
-2
No files found.
Makefile
View file @
9d27b4db
SHELL
:=
/bin/bash
.PHONY
:
help requirements clean build test pkg
include
*.mk
help
:
main.help
help
:
main.
help
:
@
echo
''
@
echo
'Makefile for the edX Configuration'
@
echo
''
...
...
@@ -14,30 +14,9 @@ help:
@
echo
' make pkg package everything'
@
echo
' make clean remove build by-products'
@
echo
''
@
echo
' Docker:'
@
echo
' $$image: any dockerhub image'
@
echo
' $$container: any container defined in docker/build/$$container/Dockerfile'
@
echo
''
@
echo
' make
$(docker_pull)
$$image pull $$image from dockerhub'
@
echo
''
@
echo
' make
$(docker_build)
$$container build $$container'
@
echo
' make
$(docker_test)
$$container test that $$container will build'
@
echo
' make
$(docker_pkg)
$$container package $$container for a push to dockerhub'
@
echo
' make
$(docker_push)
$$container push $$container to dockerhub '
@
echo
''
@
echo
' make docker.build build all defined docker containers (based on dockerhub base images)'
@
echo
' make docker.test test all defined docker containers'
@
echo
' make docker.pkg package all defined docker containers (using local base images)'
@
echo
' make docker.push push all defined docker containers'
@
echo
''
@
echo
' Tests:'
@
echo
' test.syntax Run all syntax tests'
@
echo
' test.syntax.json Run syntax tests on .json files'
@
echo
' test.syntax.yml Run syntax tests on .yml files'
@
echo
' test.syntax.jinja Run syntax tests on .j2 files'
@
echo
' test.edx_east_roles Run validation on edx-east roles'
@
echo
''
requirements
:
pip install
-qr
pre-requirements.txt
--exists-action
w
pip install
-qr
requirements.txt
--exists-action
w
include
*.mk
docker.mk
View file @
9d27b4db
...
...
@@ -14,6 +14,26 @@ docker_test=docker.test.
docker_pkg
=
docker.pkg.
docker_push
=
docker.push.
help
:
docker.help
docker.help
:
@
echo
' Docker:'
@
echo
' $$image: any dockerhub image'
@
echo
' $$container: any container defined in docker/build/$$container/Dockerfile'
@
echo
''
@
echo
'
$(docker_pull)
$$image pull $$image from dockerhub'
@
echo
''
@
echo
'
$(docker_build)
$$container build $$container'
@
echo
'
$(docker_test)
$$container test that $$container will build'
@
echo
'
$(docker_pkg)
$$container package $$container for a push to dockerhub'
@
echo
'
$(docker_push)
$$container push $$container to dockerhub '
@
echo
''
@
echo
' docker.build build all defined docker containers (based on dockerhub base images)'
@
echo
' docker.test test all defined docker containers'
@
echo
' docker.pkg package all defined docker containers (using local base images)'
@
echo
' docker.push push all defined docker containers'
@
echo
''
# N.B. / is used as a separator so that % will match the /
# in something like 'edxops/trusty-common:latest'
# Also, make can't handle ':' in filenames, so we instead '@'
...
...
@@ -70,12 +90,12 @@ $(docker_push)%: $(docker_pkg)%
.build/%/Dockerfile.test
:
docker/build/%/Dockerfile Makefile
@
mkdir
-p
.build/
$*
# perl p (print the line) n (loop over every line) e (exec the regex), like sed but cross platform
@
# perl p
(
print the line
)
n
(
loop over every line
)
e
(
exec
the regex
)
, like sed but cross platform
@
perl
-pne
"s#FROM edxops/([^:]+)(:
\S
*)?#FROM
\1
:test#"
$<
>
$@
.build/%/Dockerfile.pkg
:
docker/build/%/Dockerfile Makefile
@
mkdir
-p
.build/
$*
# perl p (print the line) n (loop over every line) e (exec the regex), like sed but cross platform
@
# perl p
(
print the line
)
n
(
loop over every line
)
e
(
exec
the regex
)
, like sed but cross platform
@
perl
-pne
"s#FROM edxops/([^:]+)(:
\S
*)?#FROM
\1
:test#"
$<
>
$@
-include
$(foreach
image,$(images),.build/$(image)/Dockerfile.d)
test.mk
View file @
9d27b4db
yml_files:=$(shell find . -name "*.yml")
json_files:=$(shell find . -name "*.json")
# $(images) is calculated in the docker.mk file
help: test.help
test.help:
@echo ' Tests:'
@echo ' test.syntax Run all syntax tests'
@echo ' test.syntax.json Run syntax tests on .json files'
@echo ' test.syntax.yml Run syntax tests on .yml files'
@echo ' test.syntax.jinja Run syntax tests on .j2 files'
@echo ' test.edx_east_roles Run validation on edx-east roles'
@echo ''
test: test.syntax test.edx_east_roles
test.syntax: test.syntax.yml test.syntax.json test.syntax.dockerfiles
...
...
@@ -19,7 +29,7 @@ test.syntax.json/%:
test.syntax.dockerfiles:
python util/check_dockerfile_coverage.py "$(images)"
test.edx_east_roles:
tests/test_edx_east_roles.sh
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment