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
5cf82198
Commit
5cf82198
authored
Dec 09, 2015
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add CI tasks for docker images
parent
d4ac8b26
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
103 additions
and
10 deletions
+103
-10
.gitignore
+3
-0
.travis.yml
+0
-1
Makefile
+32
-9
docker.mk
+68
-0
No files found.
.gitignore
View file @
5cf82198
...
...
@@ -20,3 +20,6 @@ vagrant_ansible_inventory_default
.AppleDouble
:2e_*
:2e#
## Make artifacts
.build
.travis.yml
View file @
5cf82198
...
...
@@ -60,4 +60,3 @@ script:
root_dir=$output_dir
environment_deployments="."
source $ROOT_DIR/tests/validate_templates.sh
Makefile
View file @
5cf82198
SHELL
:=
/bin/bash
.PHONY
:
help requirements clean build test pkg
include
*.mk
help
:
@
echo
' '
@
echo
'Makefile for the edX Configuration '
@
echo
' '
@
echo
'Usage: '
@
echo
' make requirements install requirements '
@
echo
' '
@
echo
''
@
echo
'Makefile for the edX Configuration'
@
echo
''
@
echo
'Usage:'
@
echo
' make requirements install requirements'
@
echo
' make test run all tests'
@
echo
' make build build everything'
@
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
''
requirements
:
pip install
-qr
pre-requirements.txt
--exists-action
w
pip install
-qr
requirements.txt
--exists-action
w
# Targets in a Makefile which do not produce an output file with the same name as the target name
.PHONY
:
help requirements
docker.mk
0 → 100644
View file @
5cf82198
.PHONY
:
docker.build docker.test docker.pkg
dockerfiles
:=
$(
shell
ls
docker/build/
*
/Dockerfile
)
docker_build
=
docker.build.
docker_test
=
docker.test.
docker_pkg
=
docker.pkg.
docker_push
=
docker.push.
# 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 '@'
# which means the same thing to docker
docker_pull
=
docker.pull/
build
:
docker.build
test
:
docker.test
pkg
:
docker.pkg
clean
:
rm
-rf
.build
$(docker_pull)%
:
docker pull
$*
$(docker_build)%
:
docker/build/%/Dockerfile
docker build
-f
$<
.
$(docker_test)%
:
.build/%/Dockerfile.test
docker build
-t
$*
:test
-f
$<
.
$(docker_pkg)%
:
.build/%/Dockerfile.pkg
docker build
-t
$*
:latest
-f
$<
.
$(docker_push)%
:
$(docker_pkg)%
docker tag
-f
$*
:latest edxops/
$*
:latest
docker push edxops/
$*
:latest
.build/%/Dockerfile.d
:
docker/build/%/Dockerfile Makefile
@
mkdir
-p
.build/
$*
$
(
eval
FROM
=
$(
shell
grep
"FROM"
$<
| sed
--regexp-extended
"s/FROM //"
| sed
--regexp-extended
"s/:/@/g"
)
)
$
(
eval
EDXOPS_FROM
=
$(
shell
echo
"
$(FROM)
"
| sed
--regexp-extended
"s#edxops/([^@]+
)
(@.*
)
?#
\1
#"
)
)
@
echo
"docker.build:
$(docker_build)$*
"
>
$@
@
echo
"docker.test:
$(docker_test)$*
"
>>
$@
@
echo
"docker.pkg:
$(docker_pkg)$*
"
>>
$@
@
echo
"docker.push:
$(docker_push)$*
"
>>
$@
@
echo
"
$(docker_build)$*
:
$(docker_pull)$(FROM)
"
>>
$@
@
if
[
"
$(EDXOPS_FROM)
"
!=
"
$(FROM)
"
]
;
then
\
echo
"
$(docker_test)$*
:
$(docker_test)
$
(EDXOPS_FROM:@%=)"
>>
$@
;
\
echo
"
$(docker_pkg)$*
:
$(docker_pkg)
$
(EDXOPS_FROM:@%=)"
>>
$@
;
\
else
\
echo
"
$(docker_test)$*
:
$(docker_pull)$(FROM)
"
>>
$@
;
\
echo
"
$(docker_pkg)$*
:
$(docker_pull)$(FROM)
"
>>
$@
;
\
fi
.build/%/Dockerfile.test
:
docker/build/%/Dockerfile Makefile
@
mkdir
-p
.build/
$*
@
sed
--regexp-extended
"s#FROM edxops/([^:]+)(:
\S
*)?#FROM
\1
:test#"
$<
>
$@
.build/%/Dockerfile.pkg
:
docker/build/%/Dockerfile Makefile
@
mkdir
-p
.build/
$*
@
sed
--regexp-extended
"s#FROM edxops/([^:]+)(:
\S
*)?#FROM
\1
:test#"
$<
>
$@
include
$(patsubst
docker/build/%/Dockerfile,.build/%/Dockerfile.d,$(dockerfiles))
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