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
ffbb9f74
Commit
ffbb9f74
authored
May 01, 2017
by
Ned Batchelder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better modularization of makefiles
Help descriptions are in their own files.
parent
a8d2c5a5
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 @
ffbb9f74
SHELL
:=
/bin/bash
SHELL
:=
/bin/bash
.PHONY
:
help requirements clean build test pkg
.PHONY
:
help requirements clean build test pkg
include
*.mk
help
:
main.help
help
:
main.
help
:
@
echo
''
@
echo
''
@
echo
'Makefile for the edX Configuration'
@
echo
'Makefile for the edX Configuration'
@
echo
''
@
echo
''
...
@@ -14,30 +14,9 @@ help:
...
@@ -14,30 +14,9 @@ help:
@
echo
' make pkg package everything'
@
echo
' make pkg package everything'
@
echo
' make clean remove build by-products'
@
echo
' make clean remove build by-products'
@
echo
''
@
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
:
requirements
:
pip install
-qr
pre-requirements.txt
--exists-action
w
pip install
-qr
pre-requirements.txt
--exists-action
w
pip install
-qr
requirements.txt
--exists-action
w
pip install
-qr
requirements.txt
--exists-action
w
include
*.mk
docker.mk
View file @
ffbb9f74
...
@@ -14,6 +14,26 @@ docker_test=docker.test.
...
@@ -14,6 +14,26 @@ docker_test=docker.test.
docker_pkg
=
docker.pkg.
docker_pkg
=
docker.pkg.
docker_push
=
docker.push.
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 /
# N.B. / is used as a separator so that % will match the /
# in something like 'edxops/trusty-common:latest'
# in something like 'edxops/trusty-common:latest'
# Also, make can't handle ':' in filenames, so we instead '@'
# Also, make can't handle ':' in filenames, so we instead '@'
...
@@ -70,12 +90,12 @@ $(docker_push)%: $(docker_pkg)%
...
@@ -70,12 +90,12 @@ $(docker_push)%: $(docker_pkg)%
.build/%/Dockerfile.test
:
docker/build/%/Dockerfile Makefile
.build/%/Dockerfile.test
:
docker/build/%/Dockerfile Makefile
@
mkdir
-p
.build/
$*
@
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#"
$<
>
$@
@
perl
-pne
"s#FROM edxops/([^:]+)(:
\S
*)?#FROM
\1
:test#"
$<
>
$@
.build/%/Dockerfile.pkg
:
docker/build/%/Dockerfile Makefile
.build/%/Dockerfile.pkg
:
docker/build/%/Dockerfile Makefile
@
mkdir
-p
.build/
$*
@
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#"
$<
>
$@
@
perl
-pne
"s#FROM edxops/([^:]+)(:
\S
*)?#FROM
\1
:test#"
$<
>
$@
-include
$(foreach
image,$(images),.build/$(image)/Dockerfile.d)
-include
$(foreach
image,$(images),.build/$(image)/Dockerfile.d)
test.mk
View file @
ffbb9f74
yml_files:=$(shell find . -name "*.yml")
yml_files:=$(shell find . -name "*.yml")
json_files:=$(shell find . -name "*.json")
json_files:=$(shell find . -name "*.json")
# $(images) is calculated in the docker.mk file
# $(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: test.syntax test.edx_east_roles
test.syntax: test.syntax.yml test.syntax.json test.syntax.dockerfiles
test.syntax: test.syntax.yml test.syntax.json test.syntax.dockerfiles
...
@@ -19,7 +29,7 @@ test.syntax.json/%:
...
@@ -19,7 +29,7 @@ test.syntax.json/%:
test.syntax.dockerfiles:
test.syntax.dockerfiles:
python util/check_dockerfile_coverage.py "$(images)"
python util/check_dockerfile_coverage.py "$(images)"
test.edx_east_roles:
test.edx_east_roles:
tests/test_edx_east_roles.sh
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