Skip to content

Commit e31e226

Browse files
committed
add more docs
1 parent 3423131 commit e31e226

File tree

4 files changed

+135
-3
lines changed

4 files changed

+135
-3
lines changed

docs/index.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Welcome to the documentation of Aeolus!
99
Aeolus is a Domain Specific Language (DSL) for defining continuous integration (CI) jobs in a declarative way.
1010
It is designed to be easy to use and to be able to define CI jobs for programming exercises that can be run on different CI platforms.
1111

12+
Check out our playground on `https://aeolus.artemis.cit.tum.de <https://aeolus.artemis.cit.tum.de>`_
13+
1214
.. toctree::
1315
:maxdepth: 3
1416
:caption: User Guide
@@ -31,6 +33,7 @@ Currently, Aeolus can generate CI jobs for the following platforms:
3133

3234
All three systems can be used with the same Aeolus configuration file, which makes it easy to switch between different CI platforms.
3335
The how and why we generate what we generate, is explained in the different target platform sections, see :ref:`targets`.
36+
3437
An example for such a configuration file, we call in Windfile, looks like this:
3538

3639
.. code-block:: yaml

docs/setup/index.rst

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,31 @@ Other Systems
8181

8282
Seeing as Aeolus is meant to be a complementary tool to `Artemis <https://github.com/ls1intum/Artemis>`_, please refer to the Artemis documentation for more
8383
information on how to set up a local development environment for Artemis, including the documentation on how to set up
84-
`Jenkins <https://docs.artemis.cit.tum.de/dev/setup/jenkins-gitlab.html>`_ and `Bamboo <https://docs.artemis.cit.tum.de/dev/setup/bamboo-bitbucket-jira.html>`_ for local development.
84+
`Jenkins <https://docs.artemis.cit.tum.de/dev/setup/jenkins-gitlab.html>`_ and `Bamboo <https://docs.artemis.cit.tum.de/dev/setup/bamboo-bitbucket-jira.html>`_ for local development.
85+
86+
87+
++++++++++++++++
88+
Production Setup
89+
++++++++++++++++
90+
91+
If you want to set up Aeolus in a production environment, you can use the provided Docker images and compose files.
92+
You can find the docker compose files in the ``deployment`` directory.
93+
94+
If you choose to secure the API with a token, you also need to give Aeolus the following environment variables:
95+
96+
.. code-block:: bash
97+
98+
AEOLUS_API_KEYS=<your-api-key>
99+
# if you want to use jenkins as ci system
100+
JENKINS_URL=<jenkins-url>
101+
JENKINS_USERNAME=<jenkins-username>
102+
JENKINS_TOKEN=<jenkins-password-of-the-user>
103+
104+
# if you want to use bamboo as ci system
105+
BAMBOO_URL=<bamboo-url>
106+
BAMBOO_USERNAME=<bamboo-username>
107+
BAMBOO_TOKEN=<token-of-the-user>
108+
109+
The ``AEOLUS_API_KEYS`` environment variable is a comma-separated list of API keys that are allowed to access the API.
110+
If you want to use the Jenkins or Bamboo generator, you also need to provide the respective environment variables.
111+
The key, if it is set, needs to be provided in the ``Authorization`` header of the request with the prefix ``Bearer``.

docs/targets/cli/index.rst

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,49 @@ commands fail. This is useful to avoid the execution of the next commands if the
2222
the possibility to define actions that always need to be executed, regardless of the result of the previous commands.
2323
For this we use the `trap` command that captures the exit signal and executes the defined action. To also ensure that
2424
an `exit` command within an action does not break the script, we source the script instead of executing it and then execute
25-
the `main` function which spawns a subshell for each action.
25+
the `main` function which spawns a subshell for each action.
26+
27+
One example of the script structure is shown below:
28+
29+
.. code-block:: bash
30+
31+
#!/usr/bin/env bash
32+
set -e
33+
export AEOLUS_INITIAL_DIRECTORY=${PWD}
34+
export REPOSITORY_URL="https://github.com/ls1intum/Aeolus.git"
35+
36+
scriptaction () {
37+
echo '⚙️ executing scriptaction'
38+
echo "I am a script action"
39+
}
40+
41+
templateaction_ () {
42+
local _current_lifecycle="${1}"
43+
if [[ "${_current_lifecycle}" == "preparation" ]]; then
44+
echo "⚙️ skipping templateaction_ because it is excluded during preparation"
45+
return 0
46+
fi
47+
48+
echo '⚙️ executing templateaction_'
49+
50+
export HELLO="world"
51+
export WHO_TO_GREET="hello"
52+
echo "Hello ${WHO_TO_GREET}"
53+
54+
}
55+
56+
main () {
57+
if [[ "${1}" == "aeolus_sourcing" ]]; then
58+
return 0 # just source to use the methods in the subshell, no execution
59+
fi
60+
local _current_lifecycle="${1}"
61+
62+
local _script_name
63+
_script_name=${BASH_SOURCE[0]:-$0}
64+
cd "${AEOLUS_INITIAL_DIRECTORY}"
65+
bash -c "source ${_script_name} aeolus_sourcing; scriptaction \"${_current_lifecycle}\""
66+
cd "${AEOLUS_INITIAL_DIRECTORY}"
67+
bash -c "source ${_script_name} aeolus_sourcing; templateaction_ \"${_current_lifecycle}\""
68+
}
69+
70+
main "${@}"

docs/targets/jenkins/index.rst

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,61 @@ What does Aeolus generate?
1010
++++++++++++++++++++++++++
1111

1212
Aeolus generates a simple Jenkinsfile, that is then used in a simple pipeline. Each action from the input file is
13-
translated into a stage in the Jenkinsfile.
13+
translated into a stage in the Jenkinsfile. One example of a Jenkinsfile generated by Aeolus is:
14+
15+
.. code-block:: groovy
16+
17+
pipeline {
18+
agent {
19+
docker {
20+
image 'ls1tum/artemis-maven-template:java17-20'
21+
}
22+
}
23+
parameters {
24+
string(name: 'current_lifecycle', defaultValue: 'working_time', description: 'The current stage')
25+
}
26+
environment {
27+
REPOSITORY_URL = 'https://github.com/ls1intum/Aeolus.git'
28+
}
29+
30+
stages {
31+
stage('aeolus') {
32+
steps {
33+
dir('aeolus') {
34+
checkout([$class: 'GitSCM',
35+
branches: [[name: 'develop']],
36+
doGenerateSubmoduleConfigurations: false,
37+
userRemoteConfigs: [[
38+
name: 'aeolus',
39+
url: "${REPOSITORY_URL}"
40+
]]
41+
])
42+
}
43+
}
44+
}
45+
stage('script-action') {
46+
steps {
47+
sh '''#!/usr/bin/env bash
48+
echo "I am a script action"
49+
'''
50+
}
51+
}
52+
stage('template-action_0') {
53+
when {
54+
allOf {
55+
expression { params.current_lifecycle != 'preparation' }
56+
}
57+
}
58+
environment {
59+
HELLO = 'world'
60+
WHO_TO_GREET = 'hello'
61+
}
62+
steps {
63+
sh '''#!/usr/bin/env bash
64+
echo "Hello ${WHO_TO_GREET}"
65+
66+
'''
67+
}
68+
}
69+
}
70+
}

0 commit comments

Comments
 (0)