Skip to content

Commit 27d9d96

Browse files
authored
Merge pull request #18 from linuxserver/readme-typo
fix readme typo, update templates
2 parents e2e9662 + 5856559 commit 27d9d96

File tree

7 files changed

+216
-54
lines changed

7 files changed

+216
-54
lines changed

.github/CONTRIBUTING.md

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
# Contributing to swag
2+
3+
## Gotchas
4+
5+
* While contributing make sure to make all your changes before creating a Pull Request, as our pipeline builds each commit after the PR is open.
6+
* Read, and fill the Pull Request template
7+
* If this is a fix for a typo in code or documentation in the README please file an issue
8+
* If the PR is addressing an existing issue include, closes #\<issue number>, in the body of the PR commit message
9+
* If you want to discuss changes, you can also bring it up in [#dev-talk](https://discordapp.com/channels/354974912613449730/757585807061155840) in our [Discord server](https://discord.gg/YWrKVTn)
10+
11+
## Common files
12+
13+
| File | Use case |
14+
| :----: | --- |
15+
| `Dockerfile` | Dockerfile used to build amd64 images |
16+
| `Dockerfile.aarch64` | Dockerfile used to build 64bit ARM architectures |
17+
| `Dockerfile.armhf` | Dockerfile used to build 32bit ARM architectures |
18+
| `Jenkinsfile` | This file is a product of our builder and should not be edited directly. This is used to build the image |
19+
| `jenkins-vars.yml` | This file is used to generate the `Jenkinsfile` mentioned above, it only affects the build-process |
20+
| `package_versions.txt` | This file is generated as a part of the build-process and should not be edited directly. It lists all the installed packages and their versions |
21+
| `README.md` | This file is a product of our builder and should not be edited directly. This displays the readme for the repository and image registries |
22+
| `readme-vars.yml` | This file is used to generate the `README.md` |
23+
24+
## Readme
25+
26+
If you would like to change our readme, please __**do not**__ directly edit the readme, as it is auto-generated on each commit.
27+
Instead edit the [readme-vars.yml](https://github.com/linuxserver/docker-swag/edit/master/readme-vars.yml).
28+
29+
These variables are used in a template for our [Jenkins Builder](https://github.com/linuxserver/docker-jenkins-builder) as part of an ansible play.
30+
Most of these variables are also carried over to [docs.linuxserver.io](https://docs.linuxserver.io/images/docker-swag)
31+
32+
### Fixing typos or clarify the text in the readme
33+
34+
There are variables for multiple parts of the readme, the most common ones are:
35+
36+
| Variable | Description |
37+
| :----: | --- |
38+
| `project_blurb` | This is the short excerpt shown above the project logo. |
39+
| `app_setup_block` | This is the text that shows up under "Application Setup" if enabled |
40+
41+
### Parameters
42+
43+
The compose and run examples are also generated from these variables.
44+
45+
We have a [reference file](https://github.com/linuxserver/docker-jenkins-builder/blob/master/vars/_container-vars-blank) in our Jenkins Builder.
46+
47+
These are prefixed with `param_` for required parameters, or `opt_param` for optional parameters, except for `cap_add`.
48+
Remember to enable param, if currently disabled. This differs between parameters, and can be seen in the reference file.
49+
50+
Devices, environment variables, ports and volumes expects its variables in a certain way.
51+
52+
### Devices
53+
54+
```yml
55+
param_devices:
56+
- { device_path: "/dev/dri", device_host_path: "/dev/dri", desc: "For hardware transcoding" }
57+
opt_param_devices:
58+
- { device_path: "/dev/dri", device_host_path: "/dev/dri", desc: "For hardware transcoding" }
59+
```
60+
61+
### Environment variables
62+
63+
```yml
64+
param_env_vars:
65+
- { env_var: "TZ", env_value: "Europe/London", desc: "Specify a timezone to use EG Europe/London." }
66+
opt_param_env_vars:
67+
- { env_var: "VERSION", env_value: "latest", desc: "Supported values are LATEST, PLEXPASS or a specific version number." }
68+
```
69+
70+
### Ports
71+
72+
```yml
73+
param_ports:
74+
- { external_port: "80", internal_port: "80", port_desc: "Application WebUI" }
75+
opt_param_ports:
76+
- { external_port: "80", internal_port: "80", port_desc: "Application WebUI" }
77+
```
78+
79+
### Volumes
80+
81+
```yml
82+
param_volumes:
83+
- { vol_path: "/config", vol_host_path: "</path/to/appdata/config>", desc: "Configuration files." }
84+
opt_param_volumes:
85+
- { vol_path: "/config", vol_host_path: "</path/to/appdata/config>", desc: "Configuration files." }
86+
```
87+
88+
### Testing template changes
89+
90+
After you make any changes to the templates, you can use our [Jenkins Builder](https://github.com/linuxserver/docker-jenkins-builder) to have the files updated from the modified templates. Please use the command found under `Running Locally` [on this page](https://github.com/linuxserver/docker-jenkins-builder/blob/master/README.md) to generate them prior to submitting a PR.
91+
92+
## Dockerfiles
93+
94+
We use multiple Dockerfiles in our repos, this is because sometimes some CPU architectures needs different packages to work.
95+
If you are proposing additional packages to be added, ensure that you added the packages to all the Dockerfiles in alphabetical order.
96+
97+
### Testing your changes
98+
99+
```
100+
git clone https://github.com/linuxserver/docker-swag.git
101+
cd docker-swag
102+
docker build \
103+
--no-cache \
104+
--pull \
105+
-t linuxserver/swag:latest .
106+
```
107+
108+
The ARM variants can be built on x86_64 hardware using `multiarch/qemu-user-static`
109+
```
110+
docker run --rm --privileged multiarch/qemu-user-static:register --reset
111+
```
112+
113+
Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64`.
114+
115+
## Update the chagelog
116+
117+
If you are modifying the Dockerfiles or any of the startup scripts in [root](https://github.com/linuxserver/docker-swag/tree/master/root), add an entry to the changelog
118+
119+
```yml
120+
changelogs:
121+
- { date: "DD.MM.YY:", desc: "Added some love to templates" }
122+
```

.github/ISSUE_TEMPLATE.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
[linuxserverurl]: https://linuxserver.io
22
[![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)][linuxserverurl]
33

4-
If you are new to Docker or this application our issue tracker is **ONLY** used for reporting bugs or requesting features. Please use [our discord server](https://discord.gg/YWrKVTn) for general support.
4+
<!--- If you are new to Docker or this application our issue tracker is **ONLY** used for reporting bugs or requesting features. Please use [our discord server](https://discord.gg/YWrKVTn) for general support. --->
5+
6+
<!--- If this acts as a feature request please ask yourself if this modification is something the whole userbase will benefit from --->
7+
<!--- If this is a specific change for corner case functionality or plugins please look at making a Docker Mod or local script https://blog.linuxserver.io/2019/09/14/customizing-our-containers/ -->
58

69
<!--- Provide a general summary of the issue in the Title above -->
710

@@ -22,9 +25,10 @@ If you are new to Docker or this application our issue tracker is **ONLY** used
2225
4.
2326

2427
## Environment
25-
**OS:**
26-
**CPU architecture:** x86_64/arm32/arm64
27-
**How docker service was installed:**
28+
**OS:**
29+
**CPU architecture:** x86_64/arm32/arm64
30+
**How docker service was installed:**
31+
<!--- ie. from the official docker repo, from the distro repo, nas OS provided, etc. -->
2832
<!--- Providing context helps us come up with a solution that is most useful in the real world -->
2933

3034
## Command used to create docker container (run/create/compose/screenshot)

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
[linuxserverurl]: https://linuxserver.io
44
[![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)][linuxserverurl]
5-
5+
66

77
<!--- Before submitting a pull request please check the following -->
88

9-
<!--- If this is a fix for a typo in code or documentation in the README please file an issue and let us sort it out we do not need a PR -->
9+
<!--- If this is a fix for a typo in code or documentation in the README please file an issue and let us sort it out we do not need a PR -->
1010
<!--- Ask yourself if this modification is something the whole userbase will benefit from, if this is a specific change for corner case functionality or plugins please look at making a Docker Mod or local script https://blog.linuxserver.io/2019/09/14/customizing-our-containers/ -->
1111
<!--- That if the PR is addressing an existing issue include, closes #<issue number> , in the body of the PR commit message -->
1212
<!--- You have included links to any files / patches etc your PR may be using in the body of the PR commit message -->
@@ -21,7 +21,11 @@
2121

2222
------------------------------
2323

24-
We welcome all PR’s though this doesn’t guarantee it will be accepted.
24+
- [ ] I have read the [contributing](https://github.com/linuxserver/docker-swag/blob/master/.github/CONTRIBUTING.md) guideline and understand that I have made the correct modifications
25+
26+
------------------------------
27+
28+
<!--- We welcome all PR’s though this doesn’t guarantee it will be accepted. -->
2529

2630
## Description:
2731
<!--- Describe your changes in detail -->

.github/workflows/greetings.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ jobs:
88
steps:
99
- uses: actions/first-interaction@v1
1010
with:
11-
issue-message: 'Thanks for opening your first issue here! Be sure to follow the [issue template](https://github.com/linuxserver/docker-swag/.github/ISSUE_TEMPLATE.md)!'
12-
pr-message: 'Thanks for opening this pull request! Be sure to follow the [pull request template](https://github.com/linuxserver/docker-swag/.github/PULL_REQUEST_TEMPLATE.md)!'
11+
issue-message: 'Thanks for opening your first issue here! Be sure to follow the [issue template](https://github.com/linuxserver/docker-swag/blob/master/.github/ISSUE_TEMPLATE.md)!'
12+
pr-message: 'Thanks for opening this pull request! Be sure to follow the [pull request template](https://github.com/linuxserver/docker-swag/blob/master/.github/PULL_REQUEST_TEMPLATE.md)!'
1313
repo-token: ${{ secrets.GITHUB_TOKEN }}

Jenkinsfile

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ pipeline {
5656
env.CODE_URL = 'https://github.com/' + env.LS_USER + '/' + env.LS_REPO + '/commit/' + env.GIT_COMMIT
5757
env.DOCKERHUB_LINK = 'https://hub.docker.com/r/' + env.DOCKERHUB_IMAGE + '/tags/'
5858
env.PULL_REQUEST = env.CHANGE_ID
59-
env.TEMPLATED_FILES = 'Jenkinsfile README.md LICENSE ./.github/FUNDING.yml ./.github/ISSUE_TEMPLATE.md ./.github/PULL_REQUEST_TEMPLATE.md ./.github/workflows/greetings.yml ./.github/workflows/stale.yml ./root/donate.txt'
59+
env.TEMPLATED_FILES = 'Jenkinsfile README.md LICENSE ./.github/CONTRIBUTING.md ./.github/FUNDING.yml ./.github/ISSUE_TEMPLATE.md ./.github/PULL_REQUEST_TEMPLATE.md ./.github/workflows/greetings.yml ./.github/workflows/stale.yml ./root/donate.txt'
6060
}
6161
script{
6262
env.LS_RELEASE_NUMBER = sh(
@@ -136,6 +136,7 @@ pipeline {
136136
env.CI_TAGS = env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER
137137
}
138138
env.META_TAG = env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER
139+
env.EXT_RELEASE_TAG = 'version-' + env.EXT_RELEASE_CLEAN
139140
}
140141
}
141142
}
@@ -156,6 +157,7 @@ pipeline {
156157
env.CI_TAGS = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA
157158
}
158159
env.META_TAG = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA
160+
env.EXT_RELEASE_TAG = 'version-' + env.EXT_RELEASE_CLEAN
159161
env.DOCKERHUB_LINK = 'https://hub.docker.com/r/' + env.DEV_DOCKERHUB_IMAGE + '/tags/'
160162
}
161163
}
@@ -176,6 +178,7 @@ pipeline {
176178
env.CI_TAGS = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST
177179
}
178180
env.META_TAG = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST
181+
env.EXT_RELEASE_TAG = 'version-' + env.EXT_RELEASE_CLEAN
179182
env.CODE_URL = 'https://github.com/' + env.LS_USER + '/' + env.LS_REPO + '/pull/' + env.PULL_REQUEST
180183
env.DOCKERHUB_LINK = 'https://hub.docker.com/r/' + env.PR_DOCKERHUB_IMAGE + '/tags/'
181184
}
@@ -543,15 +546,18 @@ pipeline {
543546
for PUSHIMAGE in "${GITHUBIMAGE}" "${GITLABIMAGE}" "${IMAGE}"; do
544547
docker tag ${IMAGE}:${META_TAG} ${PUSHIMAGE}:${META_TAG}
545548
docker tag ${PUSHIMAGE}:${META_TAG} ${PUSHIMAGE}:latest
549+
docker tag ${PUSHIMAGE}:${META_TAG} ${PUSHIMAGE}:${EXT_RELEASE_TAG}
546550
docker push ${PUSHIMAGE}:latest
547551
docker push ${PUSHIMAGE}:${META_TAG}
552+
docker push ${PUSHIMAGE}:${EXT_RELEASE_TAG}
548553
done
549554
'''
550555
}
551556
sh '''#! /bin/bash
552557
for DELETEIMAGE in "${GITHUBIMAGE}" "{GITLABIMAGE}" "${IMAGE}"; do
553558
docker rmi \
554559
${DELETEIMAGE}:${META_TAG} \
560+
${DELETEIMAGE}:${EXT_RELEASE_TAG} \
555561
${DELETEIMAGE}:latest || :
556562
done
557563
'''
@@ -592,12 +598,18 @@ pipeline {
592598
docker tag ${MANIFESTIMAGE}:amd64-${META_TAG} ${MANIFESTIMAGE}:amd64-latest
593599
docker tag ${MANIFESTIMAGE}:arm32v7-${META_TAG} ${MANIFESTIMAGE}:arm32v7-latest
594600
docker tag ${MANIFESTIMAGE}:arm64v8-${META_TAG} ${MANIFESTIMAGE}:arm64v8-latest
601+
docker tag ${MANIFESTIMAGE}:amd64-${META_TAG} ${MANIFESTIMAGE}:amd64-${EXT_RELEASE_TAG}
602+
docker tag ${MANIFESTIMAGE}:arm32v7-${META_TAG} ${MANIFESTIMAGE}:arm32v7-${EXT_RELEASE_TAG}
603+
docker tag ${MANIFESTIMAGE}:arm64v8-${META_TAG} ${MANIFESTIMAGE}:arm64v8-${EXT_RELEASE_TAG}
595604
docker push ${MANIFESTIMAGE}:amd64-${META_TAG}
596605
docker push ${MANIFESTIMAGE}:arm32v7-${META_TAG}
597606
docker push ${MANIFESTIMAGE}:arm64v8-${META_TAG}
598607
docker push ${MANIFESTIMAGE}:amd64-latest
599608
docker push ${MANIFESTIMAGE}:arm32v7-latest
600609
docker push ${MANIFESTIMAGE}:arm64v8-latest
610+
docker push ${MANIFESTIMAGE}:amd64-${EXT_RELEASE_TAG}
611+
docker push ${MANIFESTIMAGE}:arm32v7-${EXT_RELEASE_TAG}
612+
docker push ${MANIFESTIMAGE}:arm64v8-${EXT_RELEASE_TAG}
601613
docker manifest push --purge ${MANIFESTIMAGE}:latest || :
602614
docker manifest create ${MANIFESTIMAGE}:latest ${MANIFESTIMAGE}:amd64-latest ${MANIFESTIMAGE}:arm32v7-latest ${MANIFESTIMAGE}:arm64v8-latest
603615
docker manifest annotate ${MANIFESTIMAGE}:latest ${MANIFESTIMAGE}:arm32v7-latest --os linux --arch arm
@@ -606,8 +618,12 @@ pipeline {
606618
docker manifest create ${MANIFESTIMAGE}:${META_TAG} ${MANIFESTIMAGE}:amd64-${META_TAG} ${MANIFESTIMAGE}:arm32v7-${META_TAG} ${MANIFESTIMAGE}:arm64v8-${META_TAG}
607619
docker manifest annotate ${MANIFESTIMAGE}:${META_TAG} ${MANIFESTIMAGE}:arm32v7-${META_TAG} --os linux --arch arm
608620
docker manifest annotate ${MANIFESTIMAGE}:${META_TAG} ${MANIFESTIMAGE}:arm64v8-${META_TAG} --os linux --arch arm64 --variant v8
621+
docker manifest create ${MANIFESTIMAGE}:${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:amd64-${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:arm32v7-${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:arm64v8-${EXT_RELEASE_TAG}
622+
docker manifest annotate ${MANIFESTIMAGE}:${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:arm32v7-${EXT_RELEASE_TAG} --os linux --arch arm
623+
docker manifest annotate ${MANIFESTIMAGE}:${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:arm64v8-${EXT_RELEASE_TAG} --os linux --arch arm64 --variant v8
609624
docker manifest push --purge ${MANIFESTIMAGE}:latest
610625
docker manifest push --purge ${MANIFESTIMAGE}:${META_TAG}
626+
docker manifest push --purge ${MANIFESTIMAGE}:${EXT_RELEASE_TAG}
611627
done
612628
docker tag ${IMAGE}:amd64-${META_TAG} ${GITHUBIMAGE}:amd64-${META_TAG}
613629
docker tag ${IMAGE}:arm32v7-${META_TAG} ${GITHUBIMAGE}:arm32v7-${META_TAG}
@@ -616,13 +632,21 @@ pipeline {
616632
docker tag ${GITHUBIMAGE}:amd64-${META_TAG} ${GITHUBIMAGE}:${META_TAG}
617633
docker tag ${GITHUBIMAGE}:arm32v7-${META_TAG} ${GITHUBIMAGE}:arm32v7-latest
618634
docker tag ${GITHUBIMAGE}:arm64v8-${META_TAG} ${GITHUBIMAGE}:arm64v8-latest
635+
docker tag ${GITHUBIMAGE}:amd64-${META_TAG} ${GITHUBIMAGE}:amd64-${EXT_RELEASE_TAG}
636+
docker tag ${GITHUBIMAGE}:amd64-${META_TAG} ${GITHUBIMAGE}:${EXT_RELEASE_TAG}
637+
docker tag ${GITHUBIMAGE}:arm32v7-${META_TAG} ${GITHUBIMAGE}:arm32v7-${EXT_RELEASE_TAG}
638+
docker tag ${GITHUBIMAGE}:arm64v8-${META_TAG} ${GITHUBIMAGE}:arm64v8-${EXT_RELEASE_TAG}
619639
docker push ${GITHUBIMAGE}:amd64-${META_TAG}
620640
docker push ${GITHUBIMAGE}:arm32v7-${META_TAG}
621641
docker push ${GITHUBIMAGE}:arm64v8-${META_TAG}
622642
docker push ${GITHUBIMAGE}:latest
623643
docker push ${GITHUBIMAGE}:${META_TAG}
624644
docker push ${GITHUBIMAGE}:arm32v7-latest
625645
docker push ${GITHUBIMAGE}:arm64v8-latest
646+
docker push ${GITHUBIMAGE}:${EXT_RELEASE_TAG}
647+
docker push ${GITHUBIMAGE}:amd64-${EXT_RELEASE_TAG}
648+
docker push ${GITHUBIMAGE}:arm32v7-${EXT_RELEASE_TAG}
649+
docker push ${GITHUBIMAGE}:arm64v8-${EXT_RELEASE_TAG}
626650
'''
627651
}
628652
sh '''#! /bin/bash
@@ -691,7 +715,7 @@ pipeline {
691715
set -e
692716
TEMPDIR=$(mktemp -d)
693717
docker pull linuxserver/jenkins-builder:latest
694-
docker run --rm -e CONTAINER_NAME=${CONTAINER_NAME} -e GITHUB_BRANCH=master -v ${TEMPDIR}:/ansible/jenkins linuxserver/jenkins-builder:latest
718+
docker run --rm -e CONTAINER_NAME=${CONTAINER_NAME} -e GITHUB_BRANCH="${BRANCH_NAME}" -v ${TEMPDIR}:/ansible/jenkins linuxserver/jenkins-builder:latest
695719
docker pull lsiodev/readme-sync
696720
docker run --rm=true \
697721
-e DOCKERHUB_USERNAME=$DOCKERUSER \

0 commit comments

Comments
 (0)