-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
189 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
sudo: required | ||
git: | ||
depth: false | ||
services: | ||
- docker | ||
install: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
edi/plugins/playbooks/debian/base_system/roles/apt_setup/defaults/main.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
|
||
install_documentation: True | ||
install_documentation: full | ||
dpkg_no_documentation: /etc/dpkg/dpkg.cfg.d/01_no_documentation | ||
translations_filter: "" | ||
dpkg_translations_filter: /etc/dpkg/dpkg.cfg.d/02_translations_filter |
28 changes: 28 additions & 0 deletions
28
...ns/playbooks/debian/base_system/roles/apt_setup/files/remove_documentation_keep_changelog
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
|
||
set -o errexit | ||
set -o nounset | ||
|
||
DPKG_CONTROL_FILE=$1 | ||
|
||
find /usr/share/doc -depth -type f ! -name copyright ! -name changelog.Debian.gz ! -name changelog.gz |xargs rm || true | ||
find /usr/share/doc -empty|xargs rmdir || true | ||
rm -rf /usr/share/man /usr/share/groff /usr/share/info | ||
rm -rf /usr/share/lintian /usr/share/linda /var/cache/man | ||
|
||
cat << EOF > ${DPKG_CONTROL_FILE} | ||
# save disk space by excluding documentation | ||
path-exclude /usr/share/doc/* | ||
# keep copyright files for legal reasons | ||
path-include /usr/share/doc/*/copyright | ||
# keep changelog files | ||
path-include /usr/share/doc/*/changelog.Debian.gz | ||
path-include /usr/share/doc/*/changelog.gz | ||
path-exclude /usr/share/man/* | ||
path-exclude /usr/share/groff/* | ||
path-exclude /usr/share/info/* | ||
path-exclude /usr/share/lintian/* | ||
path-exclude /usr/share/linda/* | ||
EOF | ||
|
||
chmod 644 ${DPKG_CONTROL_FILE} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
edi/plugins/playbooks/debian/base_system_cleanup/roles/document_artifact/defaults/main.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
document_build_setup: False | ||
document_packages: False | ||
documentation_directory: /usr/share/doc/edi | ||
package_documentation_command: "dpkg-query --show --showformat='${Package}:\n architecture: ${Architecture}\n version: \"${Version}\"\n source_package: ${source:Package}\n status: ${db:Status-Abbrev}\n'" | ||
package_documentation_file: packages.yml | ||
build_documentation_file: build.yml |
38 changes: 38 additions & 0 deletions
38
...aybooks/debian/base_system_cleanup/roles/document_artifact/files/get_project_scm_revision
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -o nounset | ||
set -o errexit | ||
set -o pipefail | ||
|
||
print_error_and_exit() | ||
{ | ||
local MESSAGE="${1}" | ||
>&2 echo -e "Error: ${MESSAGE}" | ||
exit 1 | ||
} | ||
|
||
if [[ "$#" -ne 1 ]] | ||
then | ||
print_error_and_exit "Missing project directory.\nUsage: ${0} PROJECT_DIRECTORY" | ||
fi | ||
|
||
PROJECT_DIRECTORY=${1} | ||
|
||
if [[ ! -d ${PROJECT_DIRECTORY} ]] | ||
then | ||
print_error_and_exit "Invalid project directory ${PROJECT_DIRECTORY}." | ||
fi | ||
|
||
if ! command -v git > /dev/null | ||
then | ||
echo "git-not-available" | ||
exit 0 | ||
fi | ||
|
||
cd "${PROJECT_DIRECTORY}" | ||
|
||
if ! git rev-parse HEAD 2> /dev/null | ||
then | ||
echo "not-a-git-repository" | ||
exit 0 | ||
fi |
32 changes: 32 additions & 0 deletions
32
edi/plugins/playbooks/debian/base_system_cleanup/roles/document_artifact/tasks/main.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
- name: Create documentation directory within artifact. | ||
file: | ||
dest: "{{ documentation_directory }}" | ||
state: directory | ||
when: document_build_setup or document_packages | ||
|
||
- name: Get project configuration scm revision. | ||
script: get_project_scm_revision {{ edi_project_directory }} | ||
delegate_to: 127.0.0.1 | ||
register: project_scm_revision | ||
changed_when: false | ||
become: no | ||
when: document_build_setup | ||
|
||
- name: Write build information file. | ||
template: | ||
src: build.yml | ||
dest: "{{ documentation_directory }}/{{ build_documentation_file }}" | ||
when: document_build_setup | ||
|
||
- name: Generate a list of installed packages. | ||
command: "{{ package_documentation_command }}" | ||
register: installed_packages | ||
changed_when: false | ||
when: document_packages | ||
|
||
- name: Write a file that documents the installed packages. | ||
template: | ||
src: packages | ||
dest: "{{ documentation_directory }}/{{ package_documentation_file }}" | ||
when: document_packages |
4 changes: 4 additions & 0 deletions
4
edi/plugins/playbooks/debian/base_system_cleanup/roles/document_artifact/templates/build.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
configuration_name: "{{ edi_configuration_name }}" | ||
project_scm_revision: "{{ project_scm_revision.stdout.strip('\n') }}" | ||
edi_version: "{{ edi_edi_version }}" | ||
ansible_version: "{{ ansible_version.full }}" |
1 change: 1 addition & 0 deletions
1
edi/plugins/playbooks/debian/base_system_cleanup/roles/document_artifact/templates/packages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{{ installed_packages.stdout }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.