Skip to content

Commit

Permalink
build and push devstack docker images after merges to main
Browse files Browse the repository at this point in the history
  • Loading branch information
OmarIthawi committed May 15, 2022
1 parent a43103c commit 731fb56
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/dockerimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: 'Build the Docker images'
- name: 'Build the Tutor Docker images'
shell: bash
run: |
# Build both images at once corresponding to `edx-platform` branch names
Expand All @@ -32,7 +32,17 @@ jobs:
password: ${{ secrets.DOCKERPASSWORD }}
if: ${{ env.BRANCH == 'main' || env.BRANCH == 'prod' }}

- name: 'Push the docker images after merge to `main` and `prod`'
- name: 'build devstack image (push after merge to `main`)'
shell: bash
run: |
# This overrides same-day merges on `main` but it's devstack so it doesn't matter much
DATE=$(date --iso-8601)
make DATE="$DATE" devstack-docker-build
if [ "$BRANCH" == "main" ]; then
make DATE="$DATE" devstack-docker-push
fi
- name: 'Push the Tutor docker images after merge to `main` and `prod`'
shell: bash
run: |
IMAGE_NAME="appsembler/edxapp-juniper"
Expand Down
13 changes: 5 additions & 8 deletions Dockerfile.devstack
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,15 @@ FROM edxops/edxapp:juniper.master
#

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/
&& pip install -r requirements/edx/appsembler.txt \
&& rm -rf /edx/app/edxapp/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/

WORKDIR /edx/app/edxapp/edx-platform
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ shell: ## launch a bash shell in a Docker container with all edx-platform depend

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

Expand Down

0 comments on commit 731fb56

Please sign in to comment.