forked from sagemath/sage-archive-2023-02-01
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitpod.yml
More file actions
86 lines (77 loc) · 3.73 KB
/
Copy path.gitpod.yml
File metadata and controls
86 lines (77 loc) · 3.73 KB
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
# Use custom docker image. https://www.gitpod.io/docs/config-docker
image:
file: docker/.gitpod.Dockerfile
# Start up tasks. https://www.gitpod.io/docs/config-start-tasks/
tasks:
- name: Setup
init: |
# Create conda environment
./bootstrap-conda
mamba env create --file src/environment-dev.yml --prefix venv
conda config --append envs_dirs /workspace/sagetrac-mirror
conda activate /workspace/sagetrac-mirror/venv
# Build sage
./bootstrap
./configure --enable-build-as-root --with-python=$CONDA_PREFIX/bin/python --prefix=$CONDA_PREFIX
pip install --no-build-isolation -v -v -e ./pkgs/sage-conf ./pkgs/sage-setup
pip install --no-build-isolation -v -v -e ./src
command: |
# Activate conda environment
conda config --append envs_dirs /workspace/sagetrac-mirror
conda activate /workspace/sagetrac-mirror/venv
# RestructuredText extension recommends python extension, although we have already installed it
## So disable the recommendation dialog
echo "{\"restructuredtext.pythonRecommendation.disabled\": true}" > /workspace/.vscode-remote/data/Machine/settings.json
# Setup trac as remote
## In order to push to trac, generate a new key with `ssh-keygen -f tempkey` and save the private key to gitpod `gp env PRIVATE_SSH_KEY="$(<tempkey)"` (or by following https://www.gitpod.io/docs/environment-variables#using-the-account-settings)
## then follow https://doc.sagemath.org/html/en/developer/trac.html#linking-your-public-key-to-your-trac-account to register the public key with trac.
## Afterwards, create a new gitpod workspace.
git remote remove trac 2> /dev/null # might still exists from a previous run/prebuild
if [[ -n "${PRIVATE_SSH_KEY}" ]]; then
# Setup ssh key for authentication with trac
mkdir -p ~/.ssh
echo $PRIVATE_SSH_KEY | sed 's/\(-----\(BEGIN\|END\) OPENSSH PRIVATE KEY-----\)/\n\1\n/g' > ~/.ssh/id_rsa
sed -i '/^$/d' ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
echo "PubkeyAcceptedKeyTypes +ssh-rsa" > ~/.ssh/config
ssh-keyscan -H trac.sagemath.org >> ~/.ssh/known_hosts
# Setup trac repo
git remote add trac git@trac.sagemath.org:sage.git -t master -t develop -t $(git branch --show-current)
git remote set-url --push trac git@trac.sagemath.org:sage.git
git fetch trac
git branch -u trac/$(git branch --show-current)
else
# Fallback to sagemath mirror
git remote add trac https://github.com/sagemath/sagetrac-mirror.git -t master -t develop
git remote set-url --push trac pushing-needs-ssh-key
fi
env:
SAGE_NUM_THREADS: 8
# Preinstalled VS Code extensions. https://www.gitpod.io/docs/vscode-extensions
vscode:
extensions:
- ms-pyright.pyright
- ms-python.python
- trond-snekvik.simple-rst
- lextudio.restructuredtext
- streetsidesoftware.code-spell-checker
- ms-toolsai.jupyter
- ms-toolsai.jupyter-keymap
- ms-toolsai.jupyter-renderers
# https://www.gitpod.io/docs/prebuilds#github-specific-configuration
github:
prebuilds:
# enable for the default branch (defaults to true)
master: true
# enable for all branches in this repo (defaults to false)
branches: true
# enable for pull requests coming from this repo (defaults to true)
pullRequests: true
# enable for pull requests coming from forks (defaults to false)
pullRequestsFromForks: true
# add a check to pull requests (defaults to true)
addCheck: true
# add a "Review in Gitpod" button as a comment to pull requests (defaults to false)
addComment: true
# add a "Review in Gitpod" button to the pull request's description (defaults to false)
addBadge: true