/
build-openedx.yml
119 lines (107 loc) · 6.11 KB
/
build-openedx.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#------------------------------------------------------------------------------
# written by: mcdaniel
# date: june-2022
#
# usage: top-level workflow. Initiated manually from Github Actions console page
# Builds all Docker containers.
#------------------------------------------------------------------------------
name: Build openedx container
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
env:
AWS_REGION: {{ cookiecutter.global_aws_region }}
NAMESPACE: {{ cookiecutter.global_platform_name }}-{{ cookiecutter.global_platform_region }}-{{ cookiecutter.environment_name }}
EKS_CLUSTER_NAME: {{ cookiecutter.global_platform_name }}-{{ cookiecutter.global_platform_region }}-{{ cookiecutter.global_platform_shared_resource_identifier }}
OPENEDX_RELEASE_BRANCH: open-release/{{ cookiecutter.ci_openedx_release_branch }}
OPENEDX_RELEASE_TAG: open-release/{{ cookiecutter.ci_openedx_release_tag }}
OPENEDX_RELEASE_VERSION: {{ cookiecutter.ci_openedx_release_version }}
steps:
- uses: actions/checkout@{{ cookiecutter.ci_actions_checkout_version }}
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@{{ cookiecutter.ci_actions_configure_aws_credentials_version }}
with:
aws-access-key-id: {% raw %}${{ secrets.AWS_ACCESS_KEY_ID }}{% endraw %}
aws-secret-access-key: {% raw %}${{ secrets.AWS_SECRET_ACCESS_KEY }}{% endraw %}
aws-region: {% raw %}${{ env.AWS_REGION }}{% endraw %}
#------------------------------------------------------------------------
# install and configure tutor
#------------------------------------------------------------------------
- name: Initialize environment
uses: openedx-actions/tutor-k8s-init@{{ cookiecutter.ci_openedx_actions_tutor_k8s_init_version }}
with:
eks-namespace: {% raw %}${{ env.NAMESPACE }}{% endraw %}
eks-cluster-name: {% raw %}${{ env.EKS_CLUSTER_NAME }}{% endraw %}
aws-region: {% raw %}${{ env.AWS_REGION }}{% endraw %}
tutor-version: "{{ cookiecutter.ci_build_tutor_version }}"
tutor-mfe-version: "{{ cookiecutter.ci_build_tutor_mfe_version }}"
kubectl-version: "{{ cookiecutter.ci_build_kubectl_version }}"
#------------------------------------------------------------------------
# un-comment this to pin your build to a specific open edx release.
#
# a word of caution: usually you're better off choosing a version of tutor
# and then letting tutor make decisions of this nature.
# see: https://discuss.openedx.org/t/how-to-move-through-tutor-versions-part-ii/9574
#------------------------------------------------------------------------
#- name: Set OPENEDX_COMMON_VERSION
# shell: bash
# run: |-
# echo "TUTOR_OPENEDX_COMMON_VERSION=open-release/{{ cookiecutter.ci_openedx_release_tag }}" >> $GITHUB_ENV
#------------------------------------------------------------------------
# Add a custom theme here.
#------------------------------------------------------------------------
- name: Add a custom theme
uses: openedx-actions/tutor-plugin-build-openedx-add-theme@{{ cookiecutter.ci_openedx_actions_tutor_plugin_build_openedx_add_theme_version }}
with:
repository: {{ cookiecutter.ci_build_theme_repository }}
repository-organization: {{ cookiecutter.ci_build_theme_repository_organization }}
repository-ref: {{ cookiecutter.ci_build_theme_ref }}
# UN-COMMENT THIS IF YOUR REPO IS PRIVATE.
#----------------------------------------------
#repository-token: {% raw %}${{ secrets.PAT }}{% endraw %}
#----------------------------------------------
#------------------------------------------------------------------------
# Add any Python requirements here.
# These include:
# - generic Python PyPi packages
# - Xblocks
# - Open edX Plugin(s)
# - your own custom repos
#
# note that `repository-token` is optional and is only needed for
# private repositories
#------------------------------------------------------------------------
- name: Add an Open edX Plugin PyPi Package - cookiecutter-openedx-plugin
uses: openedx-actions/tutor-plugin-build-openedx-add-requirement@{{ cookiecutter.ci_openedx_actions_tutor_plugin_build_openedx_add_requirement_version }}
with:
pip-package: cookiecutter-openedx-plugin
pip-package-version: "0.1.3"
- name: Add an Open edX Plugin from source - openedx-plugin-example
uses: openedx-actions/tutor-plugin-build-openedx-add-requirement@{{ cookiecutter.ci_openedx_actions_tutor_plugin_build_openedx_add_requirement_version }}
with:
repository: openedx-plugin-example
repository-organization: cookiecutter-openedx
repository-ref: main
# UN-COMMENT THIS IF YOUR REPO IS PRIVATE.
#----------------------------------------------
#repository-token: {% raw %}${{ secrets.PAT }}{% endraw %}
#----------------------------------------------
- name: Add the edx-ora2 Xblock
uses: openedx-actions/tutor-plugin-build-openedx-add-requirement@{{ cookiecutter.ci_openedx_actions_tutor_plugin_build_openedx_add_requirement_version }}
with:
pip-package: ora2
pip-package-version: "6.0.20"
- name: Dump tutor config
uses: openedx-actions/tutor-print-dump@{{ cookiecutter.ci_openedx_actions_tutor_print_dump }}
with:
namespace: {% raw %}${{ env.NAMESPACE }}{% endraw %}
action: build
#------------------------------------------------------------------------
# Build and upload the Docker container
#------------------------------------------------------------------------
- name: Build openedx
uses: openedx-actions/tutor-plugin-build-openedx@{{ cookiecutter.ci_openedx_actions_tutor_plugin_build_openedx_version }}
with:
aws-ecr-repository: openedx-{% raw %}${{ env.OPENEDX_RELEASE_VERSION}}{% endraw %}