forked from ComplianceAsCode/content
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitpod.yml
38 lines (36 loc) · 1.97 KB
/
.gitpod.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
# Commands to start on workspace startup
image:
file: .gitpod.Dockerfile
vscode:
extensions:
- ggbecker.content-navigator # useful extension for the ComplianceAsCode/content project
- ritwickdey.liveserver # HTML preview
- rogalmic.bash-debug # support bashdb debug configurations
- eamodio.gitlens # cool git extension with a bunch of extra features
- twxs.cmake # support to CMakeLists.txt syntax highlighting and more
- ms-python.python # running python configurations
tasks:
- name: Prepare Env
init: |
pip install docker ansible json2html docutils==0.17.1 \
myst-parser
sphinx \
sphinx-rtd-theme \
git+https://github.com/ggbecker/sphinxcontrib.jinjadomain.git#egg=sphinxcontrib-jinjadomain
[ -z "$PRODUCT" ] && PRODUCT="fedora"
[ -z "$CONTAINER" ] && CONTAINER=$PRODUCT
[ -z "$CONTAINER_VERSION" ] && CONTAINER_VERSION="$CONTAINER:34"
[ -z "$CPE" ] && CPE="cpe:/o:fedoraproject:fedora:34"
mkdir -p .vscode && cp .gitpod.launch.json .vscode/launch.json
CONTAINER_NAME=${CONTAINER}_container
sed -i "s/&&CONTAINER_NAME&&/$CONTAINER_NAME/g" .vscode/launch.json
sed -i "s/&&DEFAULT_PRODUCT&&/$PRODUCT/g" .vscode/launch.json
sed -i "s,&&CPE&&,$CPE,g" .vscode/launch.json
PRIVATE_KEY_FOLDER=.ssh
PRIVATE_KEY_FILEPATH=$PRIVATE_KEY_FOLDER/id_rsa
sed -i "s,&&PRIVATE_KEY_FILEPATH&&,$PRIVATE_KEY_FILEPATH,g" .vscode/launch.json
mkdir -p $PRIVATE_KEY_FOLDER
ssh-keygen -N '' -f $PRIVATE_KEY_FILEPATH
docker build --build-arg "CLIENT_PUBLIC_KEY=$(cat $PRIVATE_KEY_FILEPATH.pub)" -t $CONTAINER_NAME --build-arg IMAGE=$CONTAINER_VERSION -f Dockerfiles/test_suite-$CONTAINER .
[ -n "$WORKSHOP" ] && ansible-playbook -i 127.0.0.1, docs/workshop/labs_setup.yml -e EXERCISE=$WORKSHOP -e LAB_DIR=$GITPOD_REPO_ROOT --connection=local -u gitpod --ssh-extra-args '-F docs/workshop/data/ssh_config'
[ -z "$WORKSHOP" ] && ./build_product $PRODUCT --datastream-only