Skip to content

Commit

Permalink
automate devstack docker build and push to dockerhub
Browse files Browse the repository at this point in the history
  • Loading branch information
OmarIthawi committed May 11, 2022
1 parent 67e15f2 commit 06674fc
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 12 deletions.
30 changes: 23 additions & 7 deletions Dockerfile.devstack
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,28 @@ FROM edxops/edxapp:juniper.master
# 2. Use the https://github.com/appsembler/edxapp-envs environment files
#

RUN cd /edx/app/edxapp \
&& git clone https://github.com/appsembler/edx-platform.git --branch main --single-branch --depth 1 \
&& bash -c 'cd edx-platform && source ../edxapp_env && paver install_prereqs' \
&& rm -rf edx-platform \
&& rm -f /edx/etc/lms.yml /edx/etc/studio.yml \
&& ln -s /edx/src/edxapp-envs/lms.yml /edx/etc/ \
&& ln -s /edx/src/edxapp-envs/studio.yml /edx/etc/
# Build this docker image with the following command:
#
# $ make devstack-docker-build
#
# To push to dockerhub:
#
# $ make devstack-docker-push
#

RUN rm -rf /edx/app/edxapp/edx-platform

COPY . /edx/app/edxapp/edx-platform

RUN cd /edx/app/edxapp/edx-platform \
&& . ../edxapp_env \
&& paver install_prereqs \
&& pip install -r requirements/edx/appsembler.txt

RUN rm -rf /edx/app/edxapp/edx-platform

RUN rm -f /edx/etc/lms.yml /edx/etc/studio.yml
RUN ln -s /edx/src/edxapp-envs/lms.yml /edx/etc/
RUN ln -s /edx/src/edxapp-envs/studio.yml /edx/etc/

WORKDIR /edx/app/edxapp/edx-platform
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,19 @@ shell: ## launch a bash shell in a Docker container with all edx-platform depend
-v edxapp_node_modules:/edx/app/edxapp/edx-platform/node_modules \
edxops/edxapp:latest /edx/app/edxapp/devstack.sh open


DATE := $(shell date --iso-8601)
devstack-docker-build:
docker build --no-cache --squash -f Dockerfile.devstack \
-t appsembler/edxapp:juniper.master \
-t appsembler/edxapp:juniper.manual-$(DATE) .


devstack-docker-push:
docker push appsembler/edxapp:juniper.master
docker push appsembler/edxapp:juniper.manual-$(DATE)


# Order is very important in this list: files must appear after everything they include!
REQ_FILES = \
requirements/edx/pip-tools \
Expand Down
5 changes: 0 additions & 5 deletions pavelib/prereqs.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@
if os.path.exists(PRIVATE_REQS):
PYTHON_REQ_FILES.append(PRIVATE_REQS)

# Appsembler: Install appsembler.txt requirements files during devstack provisioning.
APPSEMBLER_REQS = 'requirements/edx/appsembler.txt'
if os.path.exists(APPSEMBLER_REQS):
PYTHON_REQ_FILES.append(APPSEMBLER_REQS)


def str2bool(s):
s = str(s)
Expand Down

0 comments on commit 06674fc

Please sign in to comment.