Skip to content

Commit 8323831

Browse files
authored
Merge pull request #77 from T-Systems-MMS/pip_requirements
Pip requirements
2 parents 993f9de + ad8750e commit 8323831

File tree

4 files changed

+17
-16
lines changed

4 files changed

+17
-16
lines changed

README.MD

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ Extension of installed tools.
8181
| ARG | Required | Default | Description | build.yaml use default | build.yaml setup custom |
8282
| ------------ | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------- |
8383
| WORKDIR | no | /root | | | |
84-
| REQUIREMENTS | no | | requirements that should be installed for the used tools, currently the following are supported **_[pip, ansible(roles, collections)]_** | requirements:<br>&nbsp;&nbsp;pip:<br>&nbsp;&nbsp;&nbsp;&nbsp;- packaging<br>&nbsp;&nbsp;&nbsp;&nbsp;requests[security]<br>&nbsp;&nbsp;&nbsp;&nbsp;xmltodict<br>&nbsp;&nbsp;ansible:<br>&nbsp;&nbsp;&nbsp;&nbsp;roles:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- t_systems_mms.grafana<br>&nbsp;&nbsp;&nbsp;&nbsp;collections:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- t_systems_mms.acme=2.3.1<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- t_systems_mms.icinga_director=1.28.0 | |
84+
| REQUIREMENTS | no | | requirements that should be installed for the used tools, currently the following are supported **_[pip, ansible(roles, collections)]_** | requirements:<br>&nbsp;&nbsp;pip:<br>&nbsp;&nbsp;&nbsp;&nbsp;packages:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- awsume<br>&nbsp;&nbsp;&nbsp;&nbsp;requirements:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- [https://raw.githubusercontent.com/ansible-collections/azure/dev/requirements-azure.txt](https://raw.githubusercontent.com/ansible-collections/azure/v1.15.0/requirements-azure.txt)<br>&nbsp;&nbsp;ansible:<br>&nbsp;&nbsp;&nbsp;&nbsp;roles:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- t_systems_mms.grafana<br>&nbsp;&nbsp;&nbsp;&nbsp;collections:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- t_systems_mms.acme=2.3.1<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- t_systems_mms.icinga_director=1.28.0<br>&nbsp;&nbsp;&nbsp;&nbsp;requirements:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- https://raw.githubusercontent.com/T-Systems-MMS/ansible-role-maxscale/master/requirements.yml | |
8585
| EXTENSIONS | no | | extensions that should be installed for the used tools, currently the following are supported **_[az, google, helm]_** | extensions:<br>&nbsp;&nbsp;az:<br>&nbsp;&nbsp;&nbsp;&nbsp;- front-door=1.0.15<br>&nbsp;&nbsp;google:<br>&nbsp;&nbsp;&nbsp;&nbsp;- gsutil<br>&nbsp;&nbsp;&nbsp;&nbsp;- gke-gcloud-auth-plugin<br>&nbsp;&nbsp;&nbsp;&nbsp;- kubectl<br>&nbsp;&nbsp;helm:<br>&nbsp;&nbsp;&nbsp;&nbsp;- https://github.com/databus23/helm-diff=3.5.0<br>&nbsp;&nbsp;&nbsp;&nbsp;- https://github.com/jkroepke/helm-secrets | |
8686

8787
#### Post Build Config
@@ -148,9 +148,9 @@ If you mount your repositories to the DMC you might want to run it with your loc
148148

149149
This should give you a few benefits:
150150

151-
- no permissions issues when editing files from within the container
152-
- being able to use the local ssh auth key for ansible
153-
- local configuration is used in the container (.bashrc, .gitconfig, .vimrc etc)
151+
* no permissions issues when editing files from within the container
152+
* being able to use the local ssh auth key for ansible
153+
* local configuration is used in the container (.bashrc, .gitconfig, .vimrc etc)
154154

155155
Example:
156156

examples/full_build.yaml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,22 @@ repositories:
1919
binaries:
2020
github:
2121
- remotemobprogramming/mob=linux_amd64
22-
- derailed/k9s=Linux_x86_64
2322
google:
2423
- google-cloud-cli
2524
requirements:
2625
pip:
27-
- packaging
28-
- requests[security]
29-
- xmltodict
30-
- azure-cli-core
31-
- azure-common
32-
- awsume
26+
packages:
27+
- awsume
28+
requirements:
29+
- https://raw.githubusercontent.com/ansible-collections/azure/dev/requirements-azure.txt
3330
ansible:
3431
roles:
3532
- t_systems_mms.grafana
3633
collections:
3734
- t_systems_mms.acme
3835
- t_systems_mms.icinga_director
36+
requirements:
37+
- https://raw.githubusercontent.com/T-Systems-MMS/ansible-role-maxscale/master/requirements.yml
3938
extensions:
4039
az:
4140
- front-door

render.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ KEYS=$(cut -d '=' -f1 "${BUILD_FILE}" | sort -u)
7070
## generate ARG=VALUE for replacement
7171
for KEY in ${KEYS}
7272
do
73-
if [ "$(grep -wc "${KEY}" "${BUILD_FILE}")" -gt 1 ]; then
74-
VALUE=$(grep -w "${KEY}" "${BUILD_FILE}" | cut -d '=' -f2- | sort -u | tr '\n' ';')
73+
if [ "$(grep -c "^${KEY}=" "${BUILD_FILE}")" -gt 1 ]; then
74+
VALUE=$(grep "^${KEY}=" "${BUILD_FILE}" | cut -d '=' -f2- | sort -u | tr '\n' ';')
7575
else
76-
VALUE=$(grep -w "${KEY}" "${BUILD_FILE}" | cut -d '=' -f2- | sort -u | tr -d '\n')
76+
VALUE=$(grep "^${KEY}=" "${BUILD_FILE}" | cut -d '=' -f2- | sort -u | tr -d '\n')
7777
fi
7878
ARG=$(echo "${KEY}" | awk '{print toupper($0)}')
7979

template.d/21_requirements

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ RUN if [ -n "${REQUIREMENTS}" ]; then \
33
IFS=';' && \
44
for REQUIREMENT in ${REQUIREMENTS[@]}; do IFS='' && declare -u REQ="${REQUIREMENT}" && REQUIREMENTS_REQ=$(eval "echo \$REQUIREMENTS_${REQ}") && \
55
IFS=';' && \
6-
if [ "${REQ}" = "PIP" ]; then for REQUIREMENT_REQ in ${REQUIREMENTS_REQ[@]}; do pip3 install --no-cache-dir "${REQUIREMENT_REQ//=/==}";done; fi && \
6+
if [ "${REQ}" = "PIP" ]; then for REQUIREMENT_REQ in ${REQUIREMENTS_PIP_PACKAGES[@]}; do pip3 install --no-cache-dir "${REQUIREMENT_REQ//=/==}"; done && \
7+
for REQUIREMENT_REQ in ${REQUIREMENTS_PIP_REQUIREMENTS[@]}; do pip3 install --no-cache-dir -r "${REQUIREMENT_REQ}"; done; fi && \
78
if [ "${REQ}" = "ANSIBLE" ]; then for REQUIREMENT_REQ in ${REQUIREMENTS_ANSIBLE_ROLES[@]}; do ansible-galaxy install "${REQUIREMENT_REQ//=/,}"; done && \
8-
for REQUIREMENT_REQ in ${REQUIREMENTS_ANSIBLE_COLLECTIONS[@]}; do ansible-galaxy collection install "${REQUIREMENT_REQ//=/:}"; done; fi; done \
9+
for REQUIREMENT_REQ in ${REQUIREMENTS_ANSIBLE_COLLECTIONS[@]}; do ansible-galaxy collection install "${REQUIREMENT_REQ//=/:}"; done&& \
10+
for REQUIREMENT_REQ in ${REQUIREMENTS_ANSIBLE_REQUIREMENTS[@]}; do ansible-galaxy install -r "${REQUIREMENT_REQ}"; done; fi; done \
911
fi

0 commit comments

Comments
 (0)