Compare commits
36 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
c8c1718be3 | ||
|
009ccd7c40 | ||
|
f10b927650 | ||
|
6b2e8aba2d | ||
|
98ddc0511b | ||
|
fa8e7ec060 | ||
|
b6e3907d96 | ||
|
63e6e479c4 | ||
|
f895dc3733 | ||
|
4b1584a1c4 | ||
|
b6c41fb2d8 | ||
|
3c59459358 | ||
|
4340d12bd3 | ||
|
3a95c903a2 | ||
|
b381f74bb7 | ||
|
fc6209f267 | ||
|
184bebf187 | ||
|
104c960831 | ||
|
a03c8c90b2 | ||
|
b4d2e76279 | ||
|
86ffa8dae9 | ||
|
85e4974447 | ||
|
fca86db64c | ||
|
3ef48fba67 | ||
|
88e086a27e | ||
|
f547b3c43e | ||
|
f66e4741e0 | ||
|
bad1f20ad3 | ||
|
21fdb1893a | ||
|
0433e9f6b8 | ||
|
c8d8c16b55 | ||
|
1a62a9f7d5 | ||
|
b271618f12 | ||
|
d9237db3af | ||
|
17ff73aaf7 | ||
|
77b3ae63d0 |
20
.editorconfig
Executable file
20
.editorconfig
Executable file
@ -0,0 +1,20 @@
|
||||
# This file is globally distributed to all container image projects from
|
||||
# https://github.com/linuxserver/docker-jenkins-builder/blob/master/.editorconfig
|
||||
|
||||
# top-most EditorConfig file
|
||||
root = true
|
||||
|
||||
# Unix-style newlines with a newline ending every file
|
||||
[*]
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
# trim_trailing_whitespace may cause unintended issues and should not be globally set true
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[{Dockerfile*,**.yml}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[{**.sh,root/etc/cont-init.d/**,root/etc/services.d/**}]
|
||||
indent_style = space
|
||||
indent_size = 4
|
123
.github/CONTRIBUTING.md
vendored
Executable file
123
.github/CONTRIBUTING.md
vendored
Executable file
@ -0,0 +1,123 @@
|
||||
# Contributing to calibre-web
|
||||
|
||||
## Gotchas
|
||||
|
||||
* 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.
|
||||
* Read, and fill the Pull Request template
|
||||
* If this is a fix for a typo (in code, documentation, or the README) please file an issue and let us sort it out. We do not need a PR
|
||||
* If the PR is addressing an existing issue include, closes #\<issue number>, in the body of the PR commit message
|
||||
* 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)
|
||||
|
||||
## Common files
|
||||
|
||||
| File | Use case |
|
||||
| :----: | --- |
|
||||
| `Dockerfile` | Dockerfile used to build amd64 images |
|
||||
| `Dockerfile.aarch64` | Dockerfile used to build 64bit ARM architectures |
|
||||
| `Dockerfile.armhf` | Dockerfile used to build 32bit ARM architectures |
|
||||
| `Jenkinsfile` | This file is a product of our builder and should not be edited directly. This is used to build the image |
|
||||
| `jenkins-vars.yml` | This file is used to generate the `Jenkinsfile` mentioned above, it only affects the build-process |
|
||||
| `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 |
|
||||
| `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 |
|
||||
| `readme-vars.yml` | This file is used to generate the `README.md` |
|
||||
|
||||
## Readme
|
||||
|
||||
If you would like to change our readme, please __**do not**__ directly edit the readme, as it is auto-generated on each commit.
|
||||
Instead edit the [readme-vars.yml](https://github.com/linuxserver/docker-calibre-web/edit/calibre/readme-vars.yml).
|
||||
|
||||
These variables are used in a template for our [Jenkins Builder](https://github.com/linuxserver/docker-jenkins-builder) as part of an ansible play.
|
||||
Most of these variables are also carried over to [docs.linuxserver.io](https://docs.linuxserver.io)
|
||||
|
||||
### Fixing typos or clarify the text in the readme
|
||||
|
||||
There are variables for multiple parts of the readme, the most common ones are:
|
||||
|
||||
| Variable | Description |
|
||||
| :----: | --- |
|
||||
| `project_blurb` | This is the short excerpt shown above the project logo. |
|
||||
| `app_setup_block` | This is the text that shows up under "Application Setup" if enabled |
|
||||
|
||||
### Parameters
|
||||
|
||||
The compose and run examples are also generated from these variables.
|
||||
|
||||
We have a [reference file](https://github.com/linuxserver/docker-jenkins-builder/blob/master/vars/_container-vars-blank) in our Jenkins Builder.
|
||||
|
||||
These are prefixed with `param_` for required parameters, or `opt_param` for optional parameters, except for `cap_add`.
|
||||
Remember to enable param, if currently disabled. This differs between parameters, and can be seen in the reference file.
|
||||
|
||||
Devices, environment variables, ports and volumes expects its variables in a certain way.
|
||||
|
||||
### Devices
|
||||
|
||||
```yml
|
||||
param_devices:
|
||||
- { device_path: "/dev/dri", device_host_path: "/dev/dri", desc: "For hardware transcoding" }
|
||||
opt_param_devices:
|
||||
- { device_path: "/dev/dri", device_host_path: "/dev/dri", desc: "For hardware transcoding" }
|
||||
```
|
||||
|
||||
### Environment variables
|
||||
|
||||
```yml
|
||||
param_env_vars:
|
||||
- { env_var: "TZ", env_value: "Europe/London", desc: "Specify a timezone to use EG Europe/London." }
|
||||
opt_param_env_vars:
|
||||
- { env_var: "VERSION", env_value: "latest", desc: "Supported values are LATEST, PLEXPASS or a specific version number." }
|
||||
```
|
||||
|
||||
### Ports
|
||||
|
||||
```yml
|
||||
param_ports:
|
||||
- { external_port: "80", internal_port: "80", port_desc: "Application WebUI" }
|
||||
opt_param_ports:
|
||||
- { external_port: "80", internal_port: "80", port_desc: "Application WebUI" }
|
||||
```
|
||||
|
||||
### Volumes
|
||||
|
||||
```yml
|
||||
param_volumes:
|
||||
- { vol_path: "/config", vol_host_path: "</path/to/appdata/config>", desc: "Configuration files." }
|
||||
opt_param_volumes:
|
||||
- { vol_path: "/config", vol_host_path: "</path/to/appdata/config>", desc: "Configuration files." }
|
||||
```
|
||||
|
||||
### Testing template changes
|
||||
|
||||
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.
|
||||
|
||||
## Dockerfiles
|
||||
|
||||
We use multiple Dockerfiles in our repos, this is because sometimes some CPU architectures needs different packages to work.
|
||||
If you are proposing additional packages to be added, ensure that you added the packages to all the Dockerfiles in alphabetical order.
|
||||
|
||||
### Testing your changes
|
||||
|
||||
```bash
|
||||
git clone https://github.com/linuxserver/docker-calibre-web.git
|
||||
cd docker-calibre-web
|
||||
docker build \
|
||||
--no-cache \
|
||||
--pull \
|
||||
-t linuxserver/calibre-web:latest .
|
||||
```
|
||||
|
||||
The ARM variants can be built on x86_64 hardware using `multiarch/qemu-user-static`
|
||||
|
||||
```bash
|
||||
docker run --rm --privileged multiarch/qemu-user-static:register --reset
|
||||
```
|
||||
|
||||
Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64`.
|
||||
|
||||
## Update the changelog
|
||||
|
||||
If you are modifying the Dockerfiles or any of the startup scripts in [root](https://github.com/linuxserver/docker-calibre-web/tree/calibre/root), add an entry to the changelog
|
||||
|
||||
```yml
|
||||
changelogs:
|
||||
- { date: "DD.MM.YY:", desc: "Added some love to templates" }
|
||||
```
|
2
.github/FUNDING.yml
vendored
Executable file
2
.github/FUNDING.yml
vendored
Executable file
@ -0,0 +1,2 @@
|
||||
github: linuxserver
|
||||
open_collective: linuxserver
|
21
.github/ISSUE_TEMPLATE.md
vendored
21
.github/ISSUE_TEMPLATE.md
vendored
@ -1,21 +0,0 @@
|
||||
<!--- Provide a general summary of the issue in the Title above -->
|
||||
|
||||
[linuxserverurl]: https://linuxserver.io
|
||||
[![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)][linuxserverurl]
|
||||
|
||||
|
||||
<!--- If you have an issue with the project, please provide us with the following information -->
|
||||
|
||||
<!--- Host OS -->
|
||||
<!--- Command line users, your run/create command, GUI/Unraid users, a screenshot of your template settings. -->
|
||||
<!--- Docker log output, docker log <container-name> -->
|
||||
<!--- Mention if you're using symlinks on any of the volume mounts. -->
|
||||
|
||||
|
||||
<!--- If you have a suggestion or fix for the project, please provide us with the following information -->
|
||||
|
||||
<!--- What you think your suggestion brings to the project, or fixes with the project -->
|
||||
<!--- If it's a fix, would it be better suited as a Pull request to the repo ? -->
|
||||
|
||||
## Thanks, team linuxserver.io
|
||||
|
13
.github/ISSUE_TEMPLATE/config.yml
vendored
Executable file
13
.github/ISSUE_TEMPLATE/config.yml
vendored
Executable file
@ -0,0 +1,13 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: Discord chat support
|
||||
url: https://discord.gg/YWrKVTn
|
||||
about: Realtime support / chat with the community and the team.
|
||||
|
||||
- name: Discourse discussion forum
|
||||
url: https://discourse.linuxserver.io
|
||||
about: Post on our community forum.
|
||||
|
||||
- name: Documentation
|
||||
url: https://docs.linuxserver.io
|
||||
about: Documentation - information about all of our containers.
|
40
.github/ISSUE_TEMPLATE/issue.bug.md
vendored
Executable file
40
.github/ISSUE_TEMPLATE/issue.bug.md
vendored
Executable file
@ -0,0 +1,40 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
|
||||
---
|
||||
[linuxserverurl]: https://linuxserver.io
|
||||
[![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)][linuxserverurl]
|
||||
|
||||
<!--- 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. --->
|
||||
|
||||
<!--- Provide a general summary of the bug in the Title above -->
|
||||
|
||||
------------------------------
|
||||
|
||||
## Expected Behavior
|
||||
<!--- Tell us what should happen -->
|
||||
|
||||
## Current Behavior
|
||||
<!--- Tell us what happens instead of the expected behavior -->
|
||||
|
||||
## Steps to Reproduce
|
||||
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
|
||||
<!--- reproduce this bug. Include code to reproduce, if relevant -->
|
||||
1.
|
||||
2.
|
||||
3.
|
||||
4.
|
||||
|
||||
## Environment
|
||||
**OS:**
|
||||
**CPU architecture:** x86_64/arm32/arm64
|
||||
**How docker service was installed:**
|
||||
<!--- ie. from the official docker repo, from the distro repo, nas OS provided, etc. -->
|
||||
<!--- Providing context helps us come up with a solution that is most useful in the real world -->
|
||||
|
||||
## Command used to create docker container (run/create/compose/screenshot)
|
||||
<!--- Provide your docker create/run command or compose yaml snippet, or a screenshot of settings if using a gui to create the container -->
|
||||
|
||||
## Docker logs
|
||||
<!--- Provide a full docker log, output of "docker logs calibre-web" -->
|
25
.github/ISSUE_TEMPLATE/issue.feature.md
vendored
Executable file
25
.github/ISSUE_TEMPLATE/issue.feature.md
vendored
Executable file
@ -0,0 +1,25 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
|
||||
---
|
||||
[linuxserverurl]: https://linuxserver.io
|
||||
[![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)][linuxserverurl]
|
||||
|
||||
<!--- 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. --->
|
||||
|
||||
<!--- If this acts as a feature request please 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/ -->
|
||||
|
||||
<!--- Provide a general summary of the request in the Title above -->
|
||||
|
||||
------------------------------
|
||||
|
||||
## Desired Behavior
|
||||
<!--- Tell us what should happen -->
|
||||
|
||||
## Current Behavior
|
||||
<!--- Tell us what happens instead of the expected behavior -->
|
||||
|
||||
## Alternatives Considered
|
||||
<!--- Tell us what other options you have tried or considered -->
|
34
.github/PULL_REQUEST_TEMPLATE.md
vendored
34
.github/PULL_REQUEST_TEMPLATE.md
vendored
@ -6,10 +6,38 @@
|
||||
|
||||
<!--- Before submitting a pull request please check the following -->
|
||||
|
||||
<!--- That you have made a branch in your fork, we'd rather not merge from your master -->
|
||||
<!--- If this is a fix for a typo (in code, documentation, or the README) please file an issue and let us sort it out. We do not need a PR -->
|
||||
<!--- 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/ -->
|
||||
<!--- That if the PR is addressing an existing issue include, closes #<issue number> , in the body of the PR commit message -->
|
||||
<!--- You have included links to any files / patches etc your PR may be using in the body of the PR commit message -->
|
||||
<!--- -->
|
||||
<!--- We maintain a changelog of major revisions to the container at the end of readme-vars.yml in the root of this repository, please add your changes there if appropriate -->
|
||||
|
||||
## Thanks, team linuxserver.io
|
||||
|
||||
<!--- Coding guidelines: -->
|
||||
<!--- 1. Installed packages in the Dockerfiles should be in alphabetical order -->
|
||||
<!--- 2. Changes to Dockerfile should be replicated in Dockerfile.armhf and Dockerfile.aarch64 if applicable -->
|
||||
<!--- 3. Indentation style (tabs vs 4 spaces vs 1 space) should match the rest of the document -->
|
||||
<!--- 4. Readme is auto generated from readme-vars.yml, make your changes there -->
|
||||
|
||||
------------------------------
|
||||
|
||||
- [ ] I have read the [contributing](https://github.com/linuxserver/docker-calibre-web/blob/calibre/.github/CONTRIBUTING.md) guideline and understand that I have made the correct modifications
|
||||
|
||||
------------------------------
|
||||
|
||||
<!--- We welcome all PR’s though this doesn’t guarantee it will be accepted. -->
|
||||
|
||||
## Description:
|
||||
<!--- Describe your changes in detail -->
|
||||
|
||||
## Benefits of this PR and context:
|
||||
<!--- Please explain why we should accept this PR. If this fixes an outstanding bug, please reference the issue # -->
|
||||
|
||||
## How Has This Been Tested?
|
||||
<!--- Please describe in detail how you tested your changes. -->
|
||||
<!--- Include details of your testing environment, and the tests you ran to -->
|
||||
<!--- see how your change affects other areas of the code, etc. -->
|
||||
|
||||
|
||||
## Source / References:
|
||||
<!--- Please include any forum posts/github links relevant to the PR -->
|
||||
|
87
.github/workflows/external_trigger.yml
vendored
Executable file
87
.github/workflows/external_trigger.yml
vendored
Executable file
@ -0,0 +1,87 @@
|
||||
name: External Trigger Main
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
external-trigger-calibre:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.3
|
||||
|
||||
- name: External Trigger
|
||||
if: github.ref == 'refs/heads/calibre'
|
||||
run: |
|
||||
if [ -n "${{ secrets.PAUSE_EXTERNAL_TRIGGER_CALIBRE_WEB_CALIBRE }}" ]; then
|
||||
echo "**** Github secret PAUSE_EXTERNAL_TRIGGER_CALIBRE_WEB_CALIBRE is set; skipping trigger. ****"
|
||||
exit 0
|
||||
fi
|
||||
echo "**** External trigger running off of calibre branch. To disable this trigger, set a Github secret named \"PAUSE_EXTERNAL_TRIGGER_CALIBRE_WEB_CALIBRE\". ****"
|
||||
echo "**** Retrieving external version ****"
|
||||
EXT_RELEASE=$(curl -u "${{ secrets.CR_USER }}:${{ secrets.CR_PAT }}" -sX GET "https://api.github.com/repos/kovidgoyal/calibre/releases/latest" | jq -r '. | .tag_name')
|
||||
if [ -z "${EXT_RELEASE}" ] || [ "${EXT_RELEASE}" == "null" ]; then
|
||||
echo "**** Can't retrieve external version, exiting ****"
|
||||
FAILURE_REASON="Can't retrieve external version for calibre-web branch calibre"
|
||||
GHA_TRIGGER_URL="https://github.com/linuxserver/docker-calibre-web/actions/runs/${{ github.run_id }}"
|
||||
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 16711680,
|
||||
"description": "**Trigger Failed** \n**Reason:** '"${FAILURE_REASON}"' \n**Trigger URL:** '"${GHA_TRIGGER_URL}"' \n"}],
|
||||
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
|
||||
exit 1
|
||||
fi
|
||||
EXT_RELEASE=$(echo ${EXT_RELEASE} | sed 's/[~,%@+;:/]//g')
|
||||
echo "**** External version: ${EXT_RELEASE} ****"
|
||||
echo "**** Retrieving last pushed version ****"
|
||||
image="linuxserver/calibre-web"
|
||||
tag="calibre"
|
||||
token=$(curl -sX GET \
|
||||
"https://ghcr.io/token?scope=repository%3Alinuxserver%2Fcalibre-web%3Apull" \
|
||||
| jq -r '.token')
|
||||
digest=$(curl -s \
|
||||
--header "Accept: application/vnd.docker.distribution.manifest.v2+json" \
|
||||
--header "Authorization: Bearer ${token}" \
|
||||
"https://ghcr.io/v2/${image}/manifests/${tag}" \
|
||||
| jq -r '.config.digest')
|
||||
image_info=$(curl -sL \
|
||||
--header "Authorization: Bearer ${token}" \
|
||||
"https://ghcr.io/v2/${image}/blobs/${digest}" \
|
||||
| jq -r '.container_config')
|
||||
IMAGE_RELEASE=$(echo ${image_info} | jq -r '.Labels.build_version' | awk '{print $3}')
|
||||
IMAGE_VERSION=$(echo ${IMAGE_RELEASE} | awk -F'-ls' '{print $1}')
|
||||
if [ -z "${IMAGE_VERSION}" ]; then
|
||||
echo "**** Can't retrieve last pushed version, exiting ****"
|
||||
FAILURE_REASON="Can't retrieve last pushed version for calibre-web tag calibre"
|
||||
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 16711680,
|
||||
"description": "**Trigger Failed** \n**Reason:** '"${FAILURE_REASON}"' \n"}],
|
||||
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
|
||||
exit 1
|
||||
fi
|
||||
echo "**** Last pushed version: ${IMAGE_VERSION} ****"
|
||||
if [ "${EXT_RELEASE}" == "${IMAGE_VERSION}" ]; then
|
||||
echo "**** Version ${EXT_RELEASE} already pushed, exiting ****"
|
||||
exit 0
|
||||
elif [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-calibre-web/job/calibre/lastBuild/api/json | jq -r '.building') == "true" ]; then
|
||||
echo "**** New version ${EXT_RELEASE} found; but there already seems to be an active build on Jenkins; exiting ****"
|
||||
exit 0
|
||||
else
|
||||
echo "**** New version ${EXT_RELEASE} found; old version was ${IMAGE_VERSION}. Triggering new build ****"
|
||||
response=$(curl -iX POST \
|
||||
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-calibre-web/job/calibre/buildWithParameters?PACKAGE_CHECK=false \
|
||||
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} | grep -i location | sed "s|^[L|l]ocation: \(.*\)|\1|")
|
||||
echo "**** Jenkins job queue url: ${response%$'\r'} ****"
|
||||
echo "**** Sleeping 10 seconds until job starts ****"
|
||||
sleep 10
|
||||
buildurl=$(curl -s "${response%$'\r'}api/json" | jq -r '.executable.url')
|
||||
buildurl="${buildurl%$'\r'}"
|
||||
echo "**** Jenkins job build url: ${buildurl} ****"
|
||||
echo "**** Attempting to change the Jenkins job description ****"
|
||||
curl -iX POST \
|
||||
"${buildurl}submitDescription" \
|
||||
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} \
|
||||
--data-urlencode "description=GHA external trigger https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
|
||||
--data-urlencode "Submit=Submit"
|
||||
echo "**** Notifying Discord ****"
|
||||
TRIGGER_REASON="A version change was detected for calibre-web tag calibre. Old version:${IMAGE_VERSION} New version:${EXT_RELEASE}"
|
||||
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 9802903,
|
||||
"description": "**Build Triggered** \n**Reason:** '"${TRIGGER_REASON}"' \n**Build URL:** '"${buildurl}display/redirect"' \n"}],
|
||||
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
|
||||
fi
|
43
.github/workflows/external_trigger_scheduler.yml
vendored
Executable file
43
.github/workflows/external_trigger_scheduler.yml
vendored
Executable file
@ -0,0 +1,43 @@
|
||||
name: External Trigger Scheduler
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '55 * * * *'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
external-trigger-scheduler:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.3
|
||||
with:
|
||||
fetch-depth: '0'
|
||||
|
||||
- name: External Trigger Scheduler
|
||||
run: |
|
||||
echo "**** Branches found: ****"
|
||||
git for-each-ref --format='%(refname:short)' refs/remotes
|
||||
echo "**** Pulling the yq docker image ****"
|
||||
docker pull ghcr.io/linuxserver/yq
|
||||
for br in $(git for-each-ref --format='%(refname:short)' refs/remotes)
|
||||
do
|
||||
br=$(echo "$br" | sed 's|origin/||g')
|
||||
echo "**** Evaluating branch ${br} ****"
|
||||
ls_branch=$(curl -sX GET https://raw.githubusercontent.com/linuxserver/docker-calibre-web/${br}/jenkins-vars.yml \
|
||||
| docker run --rm -i --entrypoint yq ghcr.io/linuxserver/yq -r .ls_branch)
|
||||
if [ "$br" == "$ls_branch" ]; then
|
||||
echo "**** Branch ${br} appears to be live; checking workflow. ****"
|
||||
if curl -sfX GET https://raw.githubusercontent.com/linuxserver/docker-calibre-web/${br}/.github/workflows/external_trigger.yml > /dev/null 2>&1; then
|
||||
echo "**** Workflow exists. Triggering external trigger workflow for branch ${br} ****."
|
||||
curl -iX POST \
|
||||
-H "Authorization: token ${{ secrets.CR_PAT }}" \
|
||||
-H "Accept: application/vnd.github.v3+json" \
|
||||
-d "{\"ref\":\"refs/heads/${br}\"}" \
|
||||
https://api.github.com/repos/linuxserver/docker-calibre-web/actions/workflows/external_trigger.yml/dispatches
|
||||
else
|
||||
echo "**** Workflow doesn't exist; skipping trigger. ****"
|
||||
fi
|
||||
else
|
||||
echo "**** ${br} appears to be a dev branch; skipping trigger. ****"
|
||||
fi
|
||||
done
|
13
.github/workflows/greetings.yml
vendored
Executable file
13
.github/workflows/greetings.yml
vendored
Executable file
@ -0,0 +1,13 @@
|
||||
name: Greetings
|
||||
|
||||
on: [pull_request_target, issues]
|
||||
|
||||
jobs:
|
||||
greeting:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/first-interaction@v1
|
||||
with:
|
||||
issue-message: 'Thanks for opening your first issue here! Be sure to follow the [bug](https://github.com/linuxserver/docker-calibre-web/blob/calibre/.github/ISSUE_TEMPLATE/issue.bug.md) or [feature](https://github.com/linuxserver/docker-calibre-web/blob/calibre/.github/ISSUE_TEMPLATE/issue.feature.md) issue templates!'
|
||||
pr-message: 'Thanks for opening this pull request! Be sure to follow the [pull request template](https://github.com/linuxserver/docker-calibre-web/blob/calibre/.github/PULL_REQUEST_TEMPLATE.md)!'
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
38
.github/workflows/package_trigger.yml
vendored
Executable file
38
.github/workflows/package_trigger.yml
vendored
Executable file
@ -0,0 +1,38 @@
|
||||
name: Package Trigger Main
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
package-trigger-calibre:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.3
|
||||
|
||||
- name: Package Trigger
|
||||
if: github.ref == 'refs/heads/calibre'
|
||||
run: |
|
||||
if [ -n "${{ secrets.PAUSE_PACKAGE_TRIGGER_CALIBRE_WEB_CALIBRE }}" ]; then
|
||||
echo "**** Github secret PAUSE_PACKAGE_TRIGGER_CALIBRE_WEB_CALIBRE is set; skipping trigger. ****"
|
||||
exit 0
|
||||
fi
|
||||
if [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-calibre-web/job/calibre/lastBuild/api/json | jq -r '.building') == "true" ]; then
|
||||
echo "**** There already seems to be an active build on Jenkins; skipping package trigger ****"
|
||||
exit 0
|
||||
fi
|
||||
echo "**** Package trigger running off of calibre branch. To disable, set a Github secret named \"PAUSE_PACKAGE_TRIGGER_CALIBRE_WEB_CALIBRE\". ****"
|
||||
response=$(curl -iX POST \
|
||||
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-calibre-web/job/calibre/buildWithParameters?PACKAGE_CHECK=true \
|
||||
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} | grep -i location | sed "s|^[L|l]ocation: \(.*\)|\1|")
|
||||
echo "**** Jenkins job queue url: ${response%$'\r'} ****"
|
||||
echo "**** Sleeping 10 seconds until job starts ****"
|
||||
sleep 10
|
||||
buildurl=$(curl -s "${response%$'\r'}api/json" | jq -r '.executable.url')
|
||||
buildurl="${buildurl%$'\r'}"
|
||||
echo "**** Jenkins job build url: ${buildurl} ****"
|
||||
echo "**** Attempting to change the Jenkins job description ****"
|
||||
curl -iX POST \
|
||||
"${buildurl}submitDescription" \
|
||||
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} \
|
||||
--data-urlencode "description=GHA package trigger https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
|
||||
--data-urlencode "Submit=Submit"
|
50
.github/workflows/package_trigger_scheduler.yml
vendored
Executable file
50
.github/workflows/package_trigger_scheduler.yml
vendored
Executable file
@ -0,0 +1,50 @@
|
||||
name: Package Trigger Scheduler
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '31 9 * * 2'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
package-trigger-scheduler:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.3
|
||||
with:
|
||||
fetch-depth: '0'
|
||||
|
||||
- name: Package Trigger Scheduler
|
||||
run: |
|
||||
echo "**** Branches found: ****"
|
||||
git for-each-ref --format='%(refname:short)' refs/remotes
|
||||
echo "**** Pulling the yq docker image ****"
|
||||
docker pull ghcr.io/linuxserver/yq
|
||||
for br in $(git for-each-ref --format='%(refname:short)' refs/remotes)
|
||||
do
|
||||
br=$(echo "$br" | sed 's|origin/||g')
|
||||
echo "**** Evaluating branch ${br} ****"
|
||||
ls_branch=$(curl -sX GET https://raw.githubusercontent.com/linuxserver/docker-calibre-web/${br}/jenkins-vars.yml \
|
||||
| docker run --rm -i --entrypoint yq ghcr.io/linuxserver/yq -r .ls_branch)
|
||||
if [ "${br}" == "${ls_branch}" ]; then
|
||||
echo "**** Branch ${br} appears to be live; checking workflow. ****"
|
||||
if curl -sfX GET https://raw.githubusercontent.com/linuxserver/docker-calibre-web/${br}/.github/workflows/package_trigger.yml > /dev/null 2>&1; then
|
||||
echo "**** Workflow exists. Triggering package trigger workflow for branch ${br}. ****"
|
||||
triggered_branches="${triggered_branches}${br} "
|
||||
curl -iX POST \
|
||||
-H "Authorization: token ${{ secrets.CR_PAT }}" \
|
||||
-H "Accept: application/vnd.github.v3+json" \
|
||||
-d "{\"ref\":\"refs/heads/${br}\"}" \
|
||||
https://api.github.com/repos/linuxserver/docker-calibre-web/actions/workflows/package_trigger.yml/dispatches
|
||||
sleep 30
|
||||
else
|
||||
echo "**** Workflow doesn't exist; skipping trigger. ****"
|
||||
fi
|
||||
else
|
||||
echo "**** ${br} appears to be a dev branch; skipping trigger. ****"
|
||||
fi
|
||||
done
|
||||
echo "**** Package check build(s) triggered for branch(es): ${triggered_branches} ****"
|
||||
echo "**** Notifying Discord ****"
|
||||
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 9802903,
|
||||
"description": "**Package Check Build(s) Triggered for calibre-web** \n**Branch(es):** '"${triggered_branches}"' \n**Build URL:** '"https://ci.linuxserver.io/blue/organizations/jenkins/Docker-Pipeline-Builders%2Fdocker-calibre-web/activity/"' \n"}],
|
||||
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
|
23
.github/workflows/stale.yml
vendored
Executable file
23
.github/workflows/stale.yml
vendored
Executable file
@ -0,0 +1,23 @@
|
||||
name: Mark stale issues and pull requests
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "30 1 * * *"
|
||||
|
||||
jobs:
|
||||
stale:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/stale@v3
|
||||
with:
|
||||
stale-issue-message: "This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions."
|
||||
stale-pr-message: "This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions."
|
||||
stale-issue-label: 'no-issue-activity'
|
||||
stale-pr-label: 'no-pr-activity'
|
||||
days-before-stale: 30
|
||||
days-before-close: 365
|
||||
exempt-issue-labels: 'awaiting-approval,work-in-progress'
|
||||
exempt-pr-labels: 'awaiting-approval,work-in-progress'
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -41,3 +41,4 @@ $RECYCLE.BIN/
|
||||
Network Trash Folder
|
||||
Temporary Items
|
||||
.apdisk
|
||||
.jenkins-external
|
||||
|
60
Dockerfile
60
Dockerfile
@ -1,53 +1,37 @@
|
||||
FROM lsiobase/ubuntu:bionic
|
||||
## Buildstage ##
|
||||
FROM ghcr.io/linuxserver/baseimage-ubuntu:focal as buildstage
|
||||
|
||||
# set version label
|
||||
ARG BUILD_DATE
|
||||
ARG VERSION
|
||||
ARG CALIBREWEB_RELEASE
|
||||
ARG CALIBRE_RELEASE
|
||||
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
|
||||
LABEL maintainer="chbmb"
|
||||
|
||||
RUN \
|
||||
echo "**** install build packages ****" && \
|
||||
echo "**** Install packages ****" && \
|
||||
apt-get update && \
|
||||
apt-get install -y \
|
||||
git \
|
||||
python-pip && \
|
||||
echo "**** install runtime packages ****" && \
|
||||
apt-get install -y \
|
||||
imagemagick \
|
||||
python-minimal && \
|
||||
echo "**** install calibre-web ****" && \
|
||||
if [ -z ${CALIBREWEB_RELEASE+x} ]; then \
|
||||
CALIBREWEB_RELEASE=$(curl -sX GET "https://api.github.com/repos/janeczku/calibre-web/releases/latest" \
|
||||
xz-utils && \
|
||||
echo "**** Fetch calibre bin ****" && \
|
||||
if [ -z ${CALIBRE_RELEASE+x} ]; then \
|
||||
CALIBRE_RELEASE=$(curl -sX GET "https://api.github.com/repos/kovidgoyal/calibre/releases/latest" \
|
||||
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
|
||||
fi && \
|
||||
curl -o \
|
||||
/tmp/calibre-web.tar.gz -L \
|
||||
https://github.com/janeczku/calibre-web/archive/${CALIBREWEB_RELEASE}.tar.gz && \
|
||||
CALIBRE_RELEASE=$(echo "${CALIBRE_RELEASE}" | sed 's/^v//g' ) && \
|
||||
mkdir -p \
|
||||
/app/calibre-web && \
|
||||
/root-layer/app/calibre && \
|
||||
curl -o \
|
||||
/tmp/calibre.txz -L \
|
||||
"https://download.calibre-ebook.com/${CALIBRE_RELEASE}/calibre-${CALIBRE_RELEASE}-x86_64.txz" && \
|
||||
tar xf \
|
||||
/tmp/calibre-web.tar.gz -C \
|
||||
/app/calibre-web --strip-components=1 && \
|
||||
cd /app/calibre-web && \
|
||||
pip install --no-cache-dir -U -r \
|
||||
requirements.txt && \
|
||||
pip install --no-cache-dir -U -r \
|
||||
optional-requirements.txt && \
|
||||
echo "**** cleanup ****" && \
|
||||
apt-get -y purge \
|
||||
git \
|
||||
python-pip && \
|
||||
apt-get -y autoremove && \
|
||||
rm -rf \
|
||||
/tmp/* \
|
||||
/var/lib/apt/lists/* \
|
||||
/var/tmp/*
|
||||
/tmp/calibre.txz \
|
||||
-C /root-layer/app/calibre
|
||||
|
||||
# add local files
|
||||
COPY root/ /
|
||||
# copy local files
|
||||
COPY root/ /root-layer/
|
||||
|
||||
# ports and volumes
|
||||
EXPOSE 8083
|
||||
VOLUME /books /config
|
||||
## Single layer deployed image ##
|
||||
FROM scratch
|
||||
|
||||
# Add files from buildstage
|
||||
COPY --from=buildstage /root-layer/ /
|
||||
|
@ -1,67 +0,0 @@
|
||||
FROM lsiobase/ubuntu:arm64v8-bionic
|
||||
|
||||
# set version label
|
||||
ARG BUILD_DATE
|
||||
ARG VERSION
|
||||
ARG CALIBREWEB_RELEASE
|
||||
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
|
||||
LABEL maintainer="chbmb"
|
||||
|
||||
RUN \
|
||||
echo "**** install build packages ****" && \
|
||||
apt-get update && \
|
||||
apt-get install -y \
|
||||
g++ \
|
||||
gcc \
|
||||
git \
|
||||
libffi-dev \
|
||||
libjpeg-dev \
|
||||
libxml2-dev \
|
||||
libxslt1-dev \
|
||||
python-pip \
|
||||
zlib1g-dev && \
|
||||
echo "**** install runtime packages ****" && \
|
||||
apt-get install -y \
|
||||
imagemagick \
|
||||
python-minimal && \
|
||||
echo "**** install calibre-web ****" && \
|
||||
if [ -z ${CALIBREWEB_RELEASE+x} ]; then \
|
||||
CALIBREWEB_RELEASE=$(curl -sX GET "https://api.github.com/repos/janeczku/calibre-web/releases/latest" \
|
||||
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
|
||||
fi && \
|
||||
curl -o \
|
||||
/tmp/calibre-web.tar.gz -L \
|
||||
https://github.com/janeczku/calibre-web/archive/${CALIBREWEB_RELEASE}.tar.gz && \
|
||||
mkdir -p \
|
||||
/app/calibre-web && \
|
||||
tar xf \
|
||||
/tmp/calibre-web.tar.gz -C \
|
||||
/app/calibre-web --strip-components=1 && \
|
||||
cd /app/calibre-web && \
|
||||
pip install --no-cache-dir -U -r \
|
||||
requirements.txt && \
|
||||
pip install --no-cache-dir -U -r \
|
||||
optional-requirements.txt && \
|
||||
echo "**** cleanup ****" && \
|
||||
apt-get -y purge \
|
||||
g++ \
|
||||
gcc \
|
||||
git \
|
||||
libffi-dev \
|
||||
libjpeg-dev \
|
||||
libxml2-dev \
|
||||
libxslt1-dev \
|
||||
python-pip \
|
||||
zlib1g-dev && \
|
||||
apt-get -y autoremove && \
|
||||
rm -rf \
|
||||
/tmp/* \
|
||||
/var/lib/apt/lists/* \
|
||||
/var/tmp/*
|
||||
|
||||
# add local files
|
||||
COPY root/ /
|
||||
|
||||
# ports and volumes
|
||||
EXPOSE 8083
|
||||
VOLUME /books /config
|
@ -1,67 +0,0 @@
|
||||
FROM lsiobase/ubuntu:arm32v7-bionic
|
||||
|
||||
# set version label
|
||||
ARG BUILD_DATE
|
||||
ARG VERSION
|
||||
ARG CALIBREWEB_RELEASE
|
||||
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
|
||||
LABEL maintainer="chbmb"
|
||||
|
||||
RUN \
|
||||
echo "**** install build packages ****" && \
|
||||
apt-get update && \
|
||||
apt-get install -y \
|
||||
g++ \
|
||||
gcc \
|
||||
git \
|
||||
libffi-dev \
|
||||
libjpeg-dev \
|
||||
libxml2-dev \
|
||||
libxslt1-dev \
|
||||
python-pip \
|
||||
zlib1g-dev && \
|
||||
echo "**** install runtime packages ****" && \
|
||||
apt-get install -y \
|
||||
imagemagick \
|
||||
python-minimal && \
|
||||
echo "**** install calibre-web ****" && \
|
||||
if [ -z ${CALIBREWEB_RELEASE+x} ]; then \
|
||||
CALIBREWEB_RELEASE=$(curl -sX GET "https://api.github.com/repos/janeczku/calibre-web/releases/latest" \
|
||||
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
|
||||
fi && \
|
||||
curl -o \
|
||||
/tmp/calibre-web.tar.gz -L \
|
||||
https://github.com/janeczku/calibre-web/archive/${CALIBREWEB_RELEASE}.tar.gz && \
|
||||
mkdir -p \
|
||||
/app/calibre-web && \
|
||||
tar xf \
|
||||
/tmp/calibre-web.tar.gz -C \
|
||||
/app/calibre-web --strip-components=1 && \
|
||||
cd /app/calibre-web && \
|
||||
pip install --no-cache-dir -U -r \
|
||||
requirements.txt && \
|
||||
pip install --no-cache-dir -U -r \
|
||||
optional-requirements.txt && \
|
||||
echo "**** cleanup ****" && \
|
||||
apt-get -y purge \
|
||||
g++ \
|
||||
gcc \
|
||||
git \
|
||||
libffi-dev \
|
||||
libjpeg-dev \
|
||||
libxml2-dev \
|
||||
libxslt1-dev \
|
||||
python-pip \
|
||||
zlib1g-dev && \
|
||||
apt-get -y autoremove && \
|
||||
rm -rf \
|
||||
/tmp/* \
|
||||
/var/lib/apt/lists/* \
|
||||
/var/tmp/*
|
||||
|
||||
# add local files
|
||||
COPY root/ /
|
||||
|
||||
# ports and volumes
|
||||
EXPOSE 8083
|
||||
VOLUME /books /config
|
703
Jenkinsfile
vendored
703
Jenkinsfile
vendored
@ -2,6 +2,10 @@ pipeline {
|
||||
agent {
|
||||
label 'X86-64-MULTI'
|
||||
}
|
||||
options {
|
||||
buildDiscarder(logRotator(numToKeepStr: '10', daysToKeepStr: '60'))
|
||||
parallelsAlwaysFailFast()
|
||||
}
|
||||
// Input to determine if this is a package check
|
||||
parameters {
|
||||
string(defaultValue: 'false', description: 'package check run', name: 'PACKAGE_CHECK')
|
||||
@ -10,10 +14,13 @@ pipeline {
|
||||
environment {
|
||||
BUILDS_DISCORD=credentials('build_webhook_url')
|
||||
GITHUB_TOKEN=credentials('498b4638-2d02-4ce5-832d-8a57d01d97ab')
|
||||
GITLAB_TOKEN=credentials('b6f0f1dd-6952-4cf6-95d1-9c06380283f0')
|
||||
GITLAB_NAMESPACE=credentials('gitlab-namespace-id')
|
||||
SCARF_TOKEN=credentials('scarf_api_key')
|
||||
EXT_GIT_BRANCH = 'master'
|
||||
EXT_USER = 'janeczku'
|
||||
EXT_REPO = 'calibre-web'
|
||||
BUILD_VERSION_ARG = 'CALIBREWEB_RELEASE'
|
||||
EXT_USER = 'kovidgoyal'
|
||||
EXT_REPO = 'calibre'
|
||||
BUILD_VERSION_ARG = 'CALIBRE_RELEASE'
|
||||
LS_USER = 'linuxserver'
|
||||
LS_REPO = 'docker-calibre-web'
|
||||
CONTAINER_NAME = 'calibre-web'
|
||||
@ -21,15 +28,8 @@ pipeline {
|
||||
DEV_DOCKERHUB_IMAGE = 'lsiodev/calibre-web'
|
||||
PR_DOCKERHUB_IMAGE = 'lspipepr/calibre-web'
|
||||
DIST_IMAGE = 'ubuntu'
|
||||
MULTIARCH='true'
|
||||
CI='true'
|
||||
CI_WEB='true'
|
||||
CI_PORT='8083'
|
||||
CI_SSL='false'
|
||||
CI_DELAY='120'
|
||||
CI_DOCKERENV='TZ=US/Pacific'
|
||||
CI_AUTH='user:password'
|
||||
CI_WEBPATH=''
|
||||
MULTIARCH = 'false'
|
||||
CI = 'false'
|
||||
}
|
||||
stages {
|
||||
// Setup all the basic environment variables needed for the build
|
||||
@ -38,7 +38,7 @@ pipeline {
|
||||
script{
|
||||
env.EXIT_STATUS = ''
|
||||
env.LS_RELEASE = sh(
|
||||
script: '''docker run --rm alexeiled/skopeo sh -c 'skopeo inspect docker://docker.io/'${DOCKERHUB_IMAGE}':latest 2>/dev/null' | jq -r '.Labels.build_version' | awk '{print $3}' | grep '\\-ls' || : ''',
|
||||
script: '''docker run --rm ghcr.io/linuxserver/alexeiled-skopeo sh -c 'skopeo inspect docker://docker.io/'${DOCKERHUB_IMAGE}':calibre 2>/dev/null' | jq -r '.Labels.build_version' | awk '{print $3}' | grep '\\-ls' || : ''',
|
||||
returnStdout: true).trim()
|
||||
env.LS_RELEASE_NOTES = sh(
|
||||
script: '''cat readme-vars.yml | awk -F \\" '/date: "[0-9][0-9].[0-9][0-9].[0-9][0-9]:/ {print $4;exit;}' | sed -E ':a;N;$!ba;s/\\r{0,1}\\n/\\\\n/g' ''',
|
||||
@ -52,14 +52,7 @@ pipeline {
|
||||
env.CODE_URL = 'https://github.com/' + env.LS_USER + '/' + env.LS_REPO + '/commit/' + env.GIT_COMMIT
|
||||
env.DOCKERHUB_LINK = 'https://hub.docker.com/r/' + env.DOCKERHUB_IMAGE + '/tags/'
|
||||
env.PULL_REQUEST = env.CHANGE_ID
|
||||
env.LICENSE_TAG = sh(
|
||||
script: '''#!/bin/bash
|
||||
if [ -e LICENSE ] ; then
|
||||
cat LICENSE | md5sum | cut -c1-8
|
||||
else
|
||||
echo none
|
||||
fi''',
|
||||
returnStdout: true).trim()
|
||||
env.TEMPLATED_FILES = 'Jenkinsfile README.md LICENSE .editorconfig ./.github/CONTRIBUTING.md ./.github/FUNDING.yml ./.github/ISSUE_TEMPLATE/config.yml ./.github/ISSUE_TEMPLATE/issue.bug.md ./.github/ISSUE_TEMPLATE/issue.feature.md ./.github/PULL_REQUEST_TEMPLATE.md ./.github/workflows/external_trigger_scheduler.yml ./.github/workflows/greetings.yml ./.github/workflows/package_trigger_scheduler.yml ./.github/workflows/stale.yml ./.github/workflows/external_trigger.yml ./.github/workflows/package_trigger.yml'
|
||||
}
|
||||
script{
|
||||
env.LS_RELEASE_NUMBER = sh(
|
||||
@ -107,7 +100,7 @@ pipeline {
|
||||
steps{
|
||||
script{
|
||||
env.EXT_RELEASE = sh(
|
||||
script: '''curl -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases/latest | jq -r '. | .tag_name' ''',
|
||||
script: '''curl -H "Authorization: token ${GITHUB_TOKEN}" -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases/latest | jq -r '. | .tag_name' ''',
|
||||
returnStdout: true).trim()
|
||||
}
|
||||
}
|
||||
@ -127,42 +120,76 @@ pipeline {
|
||||
env.EXT_RELEASE_CLEAN = sh(
|
||||
script: '''echo ${EXT_RELEASE} | sed 's/[~,%@+;:/]//g' ''',
|
||||
returnStdout: true).trim()
|
||||
|
||||
def semver = env.EXT_RELEASE_CLEAN =~ /(\d+)\.(\d+)\.(\d+)/
|
||||
if (semver.find()) {
|
||||
env.SEMVER = "${semver[0][1]}.${semver[0][2]}.${semver[0][3]}"
|
||||
} else {
|
||||
semver = env.EXT_RELEASE_CLEAN =~ /(\d+)\.(\d+)(?:\.(\d+))?(.*)/
|
||||
if (semver.find()) {
|
||||
if (semver[0][3]) {
|
||||
env.SEMVER = "${semver[0][1]}.${semver[0][2]}.${semver[0][3]}"
|
||||
} else if (!semver[0][3] && !semver[0][4]) {
|
||||
env.SEMVER = "${semver[0][1]}.${semver[0][2]}.${(new Date()).format('YYYYMMdd')}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (env.SEMVER != null) {
|
||||
if (BRANCH_NAME != "master" && BRANCH_NAME != "main") {
|
||||
env.SEMVER = "${env.SEMVER}-${BRANCH_NAME}"
|
||||
}
|
||||
println("SEMVER: ${env.SEMVER}")
|
||||
} else {
|
||||
println("No SEMVER detected")
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
// If this is a master build use live docker endpoints
|
||||
// If this is a calibre build use live docker endpoints
|
||||
stage("Set ENV live build"){
|
||||
when {
|
||||
branch "master"
|
||||
branch "calibre"
|
||||
environment name: 'CHANGE_ID', value: ''
|
||||
}
|
||||
steps {
|
||||
script{
|
||||
env.IMAGE = env.DOCKERHUB_IMAGE
|
||||
env.GITHUBIMAGE = 'ghcr.io/' + env.LS_USER + '/' + env.CONTAINER_NAME
|
||||
env.GITLABIMAGE = 'registry.gitlab.com/linuxserver.io/' + env.LS_REPO + '/' + env.CONTAINER_NAME
|
||||
env.QUAYIMAGE = 'quay.io/linuxserver.io/' + env.CONTAINER_NAME
|
||||
if (env.MULTIARCH == 'true') {
|
||||
env.CI_TAGS = 'amd64-' + env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER + '|arm32v7-' + env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER + '|arm64v8-' + env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER
|
||||
env.CI_TAGS = 'amd64-calibre-' + env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER + '|arm32v7-calibre-' + env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER + '|arm64v8-calibre-' + env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER
|
||||
} else {
|
||||
env.CI_TAGS = env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER
|
||||
env.CI_TAGS = 'calibre-' + env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER
|
||||
}
|
||||
env.META_TAG = env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER
|
||||
env.VERSION_TAG = env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER
|
||||
env.META_TAG = 'calibre-' + env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER
|
||||
env.EXT_RELEASE_TAG = 'calibre-version-' + env.EXT_RELEASE_CLEAN
|
||||
}
|
||||
}
|
||||
}
|
||||
// If this is a dev build use dev docker endpoints
|
||||
stage("Set ENV dev build"){
|
||||
when {
|
||||
not {branch "master"}
|
||||
not {branch "calibre"}
|
||||
environment name: 'CHANGE_ID', value: ''
|
||||
}
|
||||
steps {
|
||||
script{
|
||||
env.IMAGE = env.DEV_DOCKERHUB_IMAGE
|
||||
env.GITHUBIMAGE = 'ghcr.io/' + env.LS_USER + '/lsiodev-' + env.CONTAINER_NAME
|
||||
env.GITLABIMAGE = 'registry.gitlab.com/linuxserver.io/' + env.LS_REPO + '/lsiodev-' + env.CONTAINER_NAME
|
||||
env.QUAYIMAGE = 'quay.io/linuxserver.io/lsiodev-' + env.CONTAINER_NAME
|
||||
if (env.MULTIARCH == 'true') {
|
||||
env.CI_TAGS = 'amd64-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA + '|arm32v7-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA + '|arm64v8-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA
|
||||
env.CI_TAGS = 'amd64-calibre-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA + '|arm32v7-calibre-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA + '|arm64v8-calibre-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA
|
||||
} else {
|
||||
env.CI_TAGS = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA
|
||||
env.CI_TAGS = 'calibre-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA
|
||||
}
|
||||
env.META_TAG = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA
|
||||
env.VERSION_TAG = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA
|
||||
env.META_TAG = 'calibre-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA
|
||||
env.EXT_RELEASE_TAG = 'calibre-version-' + env.EXT_RELEASE_CLEAN
|
||||
env.DOCKERHUB_LINK = 'https://hub.docker.com/r/' + env.DEV_DOCKERHUB_IMAGE + '/tags/'
|
||||
}
|
||||
}
|
||||
@ -175,12 +202,17 @@ pipeline {
|
||||
steps {
|
||||
script{
|
||||
env.IMAGE = env.PR_DOCKERHUB_IMAGE
|
||||
env.GITHUBIMAGE = 'ghcr.io/' + env.LS_USER + '/lspipepr-' + env.CONTAINER_NAME
|
||||
env.GITLABIMAGE = 'registry.gitlab.com/linuxserver.io/' + env.LS_REPO + '/lspipepr-' + env.CONTAINER_NAME
|
||||
env.QUAYIMAGE = 'quay.io/linuxserver.io/lspipepr-' + env.CONTAINER_NAME
|
||||
if (env.MULTIARCH == 'true') {
|
||||
env.CI_TAGS = 'amd64-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST + '|arm32v7-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST + '|arm64v8-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST
|
||||
env.CI_TAGS = 'amd64-calibre-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST + '|arm32v7-calibre-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST + '|arm64v8-calibre-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST
|
||||
} else {
|
||||
env.CI_TAGS = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST
|
||||
env.CI_TAGS = 'calibre-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST
|
||||
}
|
||||
env.META_TAG = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST
|
||||
env.VERSION_TAG = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST
|
||||
env.META_TAG = 'calibre-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST
|
||||
env.EXT_RELEASE_TAG = 'calibre-version-' + env.EXT_RELEASE_CLEAN
|
||||
env.CODE_URL = 'https://github.com/' + env.LS_USER + '/' + env.LS_REPO + '/pull/' + env.PULL_REQUEST
|
||||
env.DOCKERHUB_LINK = 'https://hub.docker.com/r/' + env.PR_DOCKERHUB_IMAGE + '/tags/'
|
||||
}
|
||||
@ -193,24 +225,24 @@ pipeline {
|
||||
}
|
||||
steps {
|
||||
withCredentials([
|
||||
string(credentialsId: 'spaces-key', variable: 'DO_KEY'),
|
||||
string(credentialsId: 'spaces-secret', variable: 'DO_SECRET')
|
||||
string(credentialsId: 'ci-tests-s3-key-id', variable: 'S3_KEY'),
|
||||
string(credentialsId: 'ci-tests-s3-secret-access-key', variable: 'S3_SECRET')
|
||||
]) {
|
||||
script{
|
||||
env.SHELLCHECK_URL = 'https://lsio-ci.ams3.digitaloceanspaces.com/' + env.IMAGE + '/' + env.META_TAG + '/shellcheck-result.xml'
|
||||
env.SHELLCHECK_URL = 'https://ci-tests.linuxserver.io/' + env.IMAGE + '/' + env.META_TAG + '/shellcheck-result.xml'
|
||||
}
|
||||
sh '''curl -sL https://raw.githubusercontent.com/linuxserver/docker-shellcheck/master/checkrun.sh | /bin/bash'''
|
||||
sh '''#! /bin/bash
|
||||
set -e
|
||||
docker pull lsiodev/spaces-file-upload:latest
|
||||
docker pull ghcr.io/linuxserver/lsiodev-spaces-file-upload:latest
|
||||
docker run --rm \
|
||||
-e DESTINATION=\"${IMAGE}/${META_TAG}/shellcheck-result.xml\" \
|
||||
-e FILE_NAME="shellcheck-result.xml" \
|
||||
-e MIMETYPE="text/xml" \
|
||||
-v ${WORKSPACE}:/mnt \
|
||||
-e SECRET_KEY=\"${DO_SECRET}\" \
|
||||
-e ACCESS_KEY=\"${DO_KEY}\" \
|
||||
-t lsiodev/spaces-file-upload:latest \
|
||||
-e SECRET_KEY=\"${S3_SECRET}\" \
|
||||
-e ACCESS_KEY=\"${S3_KEY}\" \
|
||||
-t ghcr.io/linuxserver/lsiodev-spaces-file-upload:latest \
|
||||
python /upload.py'''
|
||||
}
|
||||
}
|
||||
@ -218,7 +250,7 @@ pipeline {
|
||||
// Use helper containers to render templated files
|
||||
stage('Update-Templates') {
|
||||
when {
|
||||
branch "master"
|
||||
branch "calibre"
|
||||
environment name: 'CHANGE_ID', value: ''
|
||||
expression {
|
||||
env.CONTAINER_NAME != null
|
||||
@ -228,34 +260,81 @@ pipeline {
|
||||
sh '''#! /bin/bash
|
||||
set -e
|
||||
TEMPDIR=$(mktemp -d)
|
||||
docker pull linuxserver/jenkins-builder:latest
|
||||
docker run --rm -e CONTAINER_NAME=${CONTAINER_NAME} -e GITHUB_BRANCH=master -v ${TEMPDIR}:/ansible/jenkins linuxserver/jenkins-builder:latest
|
||||
docker pull linuxserver/doc-builder:latest
|
||||
docker run --rm -e CONTAINER_NAME=${CONTAINER_NAME} -e GITHUB_BRANCH=master -v ${TEMPDIR}:/ansible/readme linuxserver/doc-builder:latest
|
||||
if [ "$(md5sum ${TEMPDIR}/${LS_REPO}/Jenkinsfile | awk '{ print $1 }')" != "$(md5sum Jenkinsfile | awk '{ print $1 }')" ] || \
|
||||
[ "$(md5sum ${TEMPDIR}/${CONTAINER_NAME}/README.md | awk '{ print $1 }')" != "$(md5sum README.md | awk '{ print $1 }')" ] || \
|
||||
[ "$(cat ${TEMPDIR}/${LS_REPO}/LICENSE | md5sum | cut -c1-8)" != "${LICENSE_TAG}" ]; then
|
||||
docker pull ghcr.io/linuxserver/jenkins-builder:latest
|
||||
docker run --rm -e CONTAINER_NAME=${CONTAINER_NAME} -e GITHUB_BRANCH=calibre -v ${TEMPDIR}:/ansible/jenkins ghcr.io/linuxserver/jenkins-builder:latest
|
||||
# Stage 1 - Jenkinsfile update
|
||||
if [[ "$(md5sum Jenkinsfile | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/docker-${CONTAINER_NAME}/Jenkinsfile | awk '{ print $1 }')" ]]; then
|
||||
mkdir -p ${TEMPDIR}/repo
|
||||
git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_REPO}
|
||||
git --git-dir ${TEMPDIR}/repo/${LS_REPO}/.git checkout -f master
|
||||
cp ${TEMPDIR}/${CONTAINER_NAME}/README.md ${TEMPDIR}/repo/${LS_REPO}/
|
||||
cd ${TEMPDIR}/repo/${LS_REPO}
|
||||
git checkout -f calibre
|
||||
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/Jenkinsfile ${TEMPDIR}/repo/${LS_REPO}/
|
||||
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/LICENSE ${TEMPDIR}/repo/${LS_REPO}/
|
||||
git add Jenkinsfile
|
||||
git commit -m 'Bot Updating Templated Files'
|
||||
git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git --all
|
||||
echo "true" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER}
|
||||
echo "Updating Jenkinsfile"
|
||||
rm -Rf ${TEMPDIR}
|
||||
exit 0
|
||||
else
|
||||
echo "Jenkinsfile is up to date."
|
||||
fi
|
||||
# Stage 2 - Delete old templates
|
||||
OLD_TEMPLATES=".github/ISSUE_TEMPLATE.md"
|
||||
for i in ${OLD_TEMPLATES}; do
|
||||
if [[ -f "${i}" ]]; then
|
||||
TEMPLATES_TO_DELETE="${i} ${TEMPLATES_TO_DELETE}"
|
||||
fi
|
||||
done
|
||||
if [[ -n "${TEMPLATES_TO_DELETE}" ]]; then
|
||||
mkdir -p ${TEMPDIR}/repo
|
||||
git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_REPO}
|
||||
cd ${TEMPDIR}/repo/${LS_REPO}
|
||||
git checkout -f calibre
|
||||
for i in ${TEMPLATES_TO_DELETE}; do
|
||||
git rm "${i}"
|
||||
done
|
||||
git commit -m 'Bot Updating Templated Files'
|
||||
git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git --all
|
||||
echo "true" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER}
|
||||
echo "Deleting old templates"
|
||||
rm -Rf ${TEMPDIR}
|
||||
exit 0
|
||||
else
|
||||
echo "No templates to delete"
|
||||
fi
|
||||
# Stage 3 - Update templates
|
||||
CURRENTHASH=$(grep -hs ^ ${TEMPLATED_FILES} | md5sum | cut -c1-8)
|
||||
cd ${TEMPDIR}/docker-${CONTAINER_NAME}
|
||||
NEWHASH=$(grep -hs ^ ${TEMPLATED_FILES} | md5sum | cut -c1-8)
|
||||
if [[ "${CURRENTHASH}" != "${NEWHASH}" ]] || ! grep -q '.jenkins-external' "${WORKSPACE}/.gitignore" 2>/dev/null; then
|
||||
mkdir -p ${TEMPDIR}/repo
|
||||
git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_REPO}
|
||||
cd ${TEMPDIR}/repo/${LS_REPO}
|
||||
git checkout -f calibre
|
||||
cd ${TEMPDIR}/docker-${CONTAINER_NAME}
|
||||
mkdir -p ${TEMPDIR}/repo/${LS_REPO}/.github/workflows
|
||||
mkdir -p ${TEMPDIR}/repo/${LS_REPO}/.github/ISSUE_TEMPLATE
|
||||
cp --parents ${TEMPLATED_FILES} ${TEMPDIR}/repo/${LS_REPO}/ || :
|
||||
cd ${TEMPDIR}/repo/${LS_REPO}/
|
||||
git --git-dir ${TEMPDIR}/repo/${LS_REPO}/.git add Jenkinsfile README.md LICENSE
|
||||
git --git-dir ${TEMPDIR}/repo/${LS_REPO}/.git commit -m 'Bot Updating Templated Files'
|
||||
git --git-dir ${TEMPDIR}/repo/${LS_REPO}/.git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git --all
|
||||
if ! grep -q '.jenkins-external' .gitignore 2>/dev/null; then
|
||||
echo ".jenkins-external" >> .gitignore
|
||||
git add .gitignore
|
||||
fi
|
||||
git add ${TEMPLATED_FILES}
|
||||
git commit -m 'Bot Updating Templated Files'
|
||||
git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git --all
|
||||
echo "true" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER}
|
||||
else
|
||||
echo "false" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER}
|
||||
fi
|
||||
mkdir -p ${TEMPDIR}/gitbook
|
||||
git clone https://github.com/linuxserver/docker-documentation.git ${TEMPDIR}/gitbook/docker-documentation
|
||||
if [[ "${BRANCH_NAME}" == "master" ]] && [[ (! -f ${TEMPDIR}/gitbook/docker-documentation/images/docker-${CONTAINER_NAME}.md) || ("$(md5sum ${TEMPDIR}/gitbook/docker-documentation/images/docker-${CONTAINER_NAME}.md | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/${CONTAINER_NAME}/docker-${CONTAINER_NAME}.md | awk '{ print $1 }')") ]]; then
|
||||
cp ${TEMPDIR}/${CONTAINER_NAME}/docker-${CONTAINER_NAME}.md ${TEMPDIR}/gitbook/docker-documentation/images/
|
||||
if [[ ("${BRANCH_NAME}" == "master") || ("${BRANCH_NAME}" == "main") ]] && [[ (! -f ${TEMPDIR}/gitbook/docker-documentation/images/docker-${CONTAINER_NAME}.md) || ("$(md5sum ${TEMPDIR}/gitbook/docker-documentation/images/docker-${CONTAINER_NAME}.md | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/docker-${CONTAINER_NAME}.md | awk '{ print $1 }')") ]]; then
|
||||
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/docker-${CONTAINER_NAME}.md ${TEMPDIR}/gitbook/docker-documentation/images/
|
||||
cd ${TEMPDIR}/gitbook/docker-documentation/
|
||||
git add images/docker-${CONTAINER_NAME}.md
|
||||
git commit -m 'Bot Updating Templated Files'
|
||||
git commit -m 'Bot Updating Documentation'
|
||||
git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/docker-documentation.git --all
|
||||
fi
|
||||
rm -Rf ${TEMPDIR}'''
|
||||
@ -269,7 +348,7 @@ pipeline {
|
||||
// Exit the build if the Templated files were just updated
|
||||
stage('Template-exit') {
|
||||
when {
|
||||
branch "master"
|
||||
branch "calibre"
|
||||
environment name: 'CHANGE_ID', value: ''
|
||||
environment name: 'FILES_UPDATED', value: 'true'
|
||||
expression {
|
||||
@ -282,31 +361,114 @@ pipeline {
|
||||
}
|
||||
}
|
||||
}
|
||||
/* #######################
|
||||
GitLab Mirroring
|
||||
####################### */
|
||||
// Ping into Gitlab to mirror this repo and have a registry endpoint
|
||||
stage("GitLab Mirror"){
|
||||
when {
|
||||
environment name: 'EXIT_STATUS', value: ''
|
||||
}
|
||||
steps{
|
||||
sh '''curl -H "Content-Type: application/json" -H "Private-Token: ${GITLAB_TOKEN}" -X POST https://gitlab.com/api/v4/projects \
|
||||
-d '{"namespace_id":'${GITLAB_NAMESPACE}',\
|
||||
"name":"'${LS_REPO}'",
|
||||
"mirror":true,\
|
||||
"import_url":"https://github.com/linuxserver/'${LS_REPO}'.git",\
|
||||
"issues_access_level":"disabled",\
|
||||
"merge_requests_access_level":"disabled",\
|
||||
"repository_access_level":"enabled",\
|
||||
"visibility":"public"}' '''
|
||||
}
|
||||
}
|
||||
/* #######################
|
||||
Scarf.sh package registry
|
||||
####################### */
|
||||
// Add package to Scarf.sh and set permissions
|
||||
stage("Scarf.sh package registry"){
|
||||
when {
|
||||
branch "calibre"
|
||||
environment name: 'EXIT_STATUS', value: ''
|
||||
}
|
||||
steps{
|
||||
sh '''#! /bin/bash
|
||||
set -e
|
||||
PACKAGE_UUID=$(curl -X GET -H "Authorization: Bearer ${SCARF_TOKEN}" https://scarf.sh/api/v1/organizations/linuxserver-ci/packages | jq -r '.[] | select(.name=="linuxserver/calibre-web") | .uuid')
|
||||
if [ -z "${PACKAGE_UUID}" ]; then
|
||||
echo "Adding package to Scarf.sh"
|
||||
curl -sX POST https://scarf.sh/api/v1/organizations/linuxserver-ci/packages \
|
||||
-H "Authorization: Bearer ${SCARF_TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"name":"linuxserver/calibre-web",\
|
||||
"shortDescription":"example description",\
|
||||
"libraryType":"docker",\
|
||||
"website":"https://github.com/linuxserver/docker-calibre-web",\
|
||||
"backendUrl":"https://ghcr.io/linuxserver/calibre-web",\
|
||||
"publicUrl":"https://lscr.io/linuxserver/calibre-web"}' || :
|
||||
else
|
||||
echo "Package already exists on Scarf.sh"
|
||||
fi
|
||||
'''
|
||||
}
|
||||
}
|
||||
/* ###############
|
||||
Build Container
|
||||
############### */
|
||||
// Build Docker container for push to LS Repo
|
||||
stage('Build-Single') {
|
||||
when {
|
||||
environment name: 'MULTIARCH', value: 'false'
|
||||
expression {
|
||||
env.MULTIARCH == 'false' || params.PACKAGE_CHECK == 'true'
|
||||
}
|
||||
environment name: 'EXIT_STATUS', value: ''
|
||||
}
|
||||
steps {
|
||||
sh "docker build --no-cache --pull -t ${IMAGE}:${META_TAG} \
|
||||
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${META_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
|
||||
echo "Running on node: ${NODE_NAME}"
|
||||
sh "docker build \
|
||||
--label \"org.opencontainers.image.created=${GITHUB_DATE}\" \
|
||||
--label \"org.opencontainers.image.authors=linuxserver.io\" \
|
||||
--label \"org.opencontainers.image.url=https://github.com/linuxserver/docker-calibre-web/packages\" \
|
||||
--label \"org.opencontainers.image.documentation=https://docs.linuxserver.io/images/docker-calibre-web\" \
|
||||
--label \"org.opencontainers.image.source=https://github.com/linuxserver/docker-calibre-web\" \
|
||||
--label \"org.opencontainers.image.version=${EXT_RELEASE_CLEAN}-ls${LS_TAG_NUMBER}\" \
|
||||
--label \"org.opencontainers.image.revision=${COMMIT_SHA}\" \
|
||||
--label \"org.opencontainers.image.vendor=linuxserver.io\" \
|
||||
--label \"org.opencontainers.image.licenses=GPL-3.0-only\" \
|
||||
--label \"org.opencontainers.image.ref.name=${COMMIT_SHA}\" \
|
||||
--label \"org.opencontainers.image.title=Calibre-web\" \
|
||||
--label \"org.opencontainers.image.description=calibre-web image by linuxserver.io\" \
|
||||
--no-cache --pull -t ${IMAGE}:${META_TAG} \
|
||||
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
|
||||
}
|
||||
}
|
||||
// Build MultiArch Docker containers for push to LS Repo
|
||||
stage('Build-Multi') {
|
||||
when {
|
||||
environment name: 'MULTIARCH', value: 'true'
|
||||
allOf {
|
||||
environment name: 'MULTIARCH', value: 'true'
|
||||
expression { params.PACKAGE_CHECK == 'false' }
|
||||
}
|
||||
environment name: 'EXIT_STATUS', value: ''
|
||||
}
|
||||
parallel {
|
||||
stage('Build X86') {
|
||||
steps {
|
||||
sh "docker build --no-cache --pull -t ${IMAGE}:amd64-${META_TAG} \
|
||||
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${META_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
|
||||
echo "Running on node: ${NODE_NAME}"
|
||||
sh "docker build \
|
||||
--label \"org.opencontainers.image.created=${GITHUB_DATE}\" \
|
||||
--label \"org.opencontainers.image.authors=linuxserver.io\" \
|
||||
--label \"org.opencontainers.image.url=https://github.com/linuxserver/docker-calibre-web/packages\" \
|
||||
--label \"org.opencontainers.image.documentation=https://docs.linuxserver.io/images/docker-calibre-web\" \
|
||||
--label \"org.opencontainers.image.source=https://github.com/linuxserver/docker-calibre-web\" \
|
||||
--label \"org.opencontainers.image.version=${EXT_RELEASE_CLEAN}-ls${LS_TAG_NUMBER}\" \
|
||||
--label \"org.opencontainers.image.revision=${COMMIT_SHA}\" \
|
||||
--label \"org.opencontainers.image.vendor=linuxserver.io\" \
|
||||
--label \"org.opencontainers.image.licenses=GPL-3.0-only\" \
|
||||
--label \"org.opencontainers.image.ref.name=${COMMIT_SHA}\" \
|
||||
--label \"org.opencontainers.image.title=Calibre-web\" \
|
||||
--label \"org.opencontainers.image.description=calibre-web image by linuxserver.io\" \
|
||||
--no-cache --pull -t ${IMAGE}:amd64-${META_TAG} \
|
||||
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
|
||||
}
|
||||
}
|
||||
stage('Build ARMHF') {
|
||||
@ -314,26 +476,33 @@ pipeline {
|
||||
label 'ARMHF'
|
||||
}
|
||||
steps {
|
||||
withCredentials([
|
||||
[
|
||||
$class: 'UsernamePasswordMultiBinding',
|
||||
credentialsId: '3f9ba4d5-100d-45b0-a3c4-633fd6061207',
|
||||
usernameVariable: 'DOCKERUSER',
|
||||
passwordVariable: 'DOCKERPASS'
|
||||
]
|
||||
]) {
|
||||
echo 'Logging into DockerHub'
|
||||
sh '''#! /bin/bash
|
||||
echo $DOCKERPASS | docker login -u $DOCKERUSER --password-stdin
|
||||
'''
|
||||
sh "docker build --no-cache --pull -f Dockerfile.armhf -t ${IMAGE}:arm32v7-${META_TAG} \
|
||||
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${META_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
|
||||
sh "docker tag ${IMAGE}:arm32v7-${META_TAG} lsiodev/buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER}"
|
||||
sh "docker push lsiodev/buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER}"
|
||||
sh '''docker rmi \
|
||||
${IMAGE}:arm32v7-${META_TAG} \
|
||||
lsiodev/buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER} || :'''
|
||||
echo "Running on node: ${NODE_NAME}"
|
||||
echo 'Logging into Github'
|
||||
sh '''#! /bin/bash
|
||||
echo $GITHUB_TOKEN | docker login ghcr.io -u LinuxServer-CI --password-stdin
|
||||
'''
|
||||
sh "docker build \
|
||||
--label \"org.opencontainers.image.created=${GITHUB_DATE}\" \
|
||||
--label \"org.opencontainers.image.authors=linuxserver.io\" \
|
||||
--label \"org.opencontainers.image.url=https://github.com/linuxserver/docker-calibre-web/packages\" \
|
||||
--label \"org.opencontainers.image.documentation=https://docs.linuxserver.io/images/docker-calibre-web\" \
|
||||
--label \"org.opencontainers.image.source=https://github.com/linuxserver/docker-calibre-web\" \
|
||||
--label \"org.opencontainers.image.version=${EXT_RELEASE_CLEAN}-ls${LS_TAG_NUMBER}\" \
|
||||
--label \"org.opencontainers.image.revision=${COMMIT_SHA}\" \
|
||||
--label \"org.opencontainers.image.vendor=linuxserver.io\" \
|
||||
--label \"org.opencontainers.image.licenses=GPL-3.0-only\" \
|
||||
--label \"org.opencontainers.image.ref.name=${COMMIT_SHA}\" \
|
||||
--label \"org.opencontainers.image.title=Calibre-web\" \
|
||||
--label \"org.opencontainers.image.description=calibre-web image by linuxserver.io\" \
|
||||
--no-cache --pull -f Dockerfile.armhf -t ${IMAGE}:arm32v7-${META_TAG} \
|
||||
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
|
||||
sh "docker tag ${IMAGE}:arm32v7-${META_TAG} ghcr.io/linuxserver/lsiodev-buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER}"
|
||||
retry(5) {
|
||||
sh "docker push ghcr.io/linuxserver/lsiodev-buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER}"
|
||||
}
|
||||
sh '''docker rmi \
|
||||
${IMAGE}:arm32v7-${META_TAG} \
|
||||
ghcr.io/linuxserver/lsiodev-buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER} || :'''
|
||||
}
|
||||
}
|
||||
stage('Build ARM64') {
|
||||
@ -341,113 +510,37 @@ pipeline {
|
||||
label 'ARM64'
|
||||
}
|
||||
steps {
|
||||
withCredentials([
|
||||
[
|
||||
$class: 'UsernamePasswordMultiBinding',
|
||||
credentialsId: '3f9ba4d5-100d-45b0-a3c4-633fd6061207',
|
||||
usernameVariable: 'DOCKERUSER',
|
||||
passwordVariable: 'DOCKERPASS'
|
||||
]
|
||||
]) {
|
||||
echo 'Logging into DockerHub'
|
||||
sh '''#! /bin/bash
|
||||
echo $DOCKERPASS | docker login -u $DOCKERUSER --password-stdin
|
||||
'''
|
||||
sh "docker build --no-cache --pull -f Dockerfile.aarch64 -t ${IMAGE}:arm64v8-${META_TAG} \
|
||||
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${META_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
|
||||
sh "docker tag ${IMAGE}:arm64v8-${META_TAG} lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}"
|
||||
sh "docker push lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}"
|
||||
sh '''docker rmi \
|
||||
${IMAGE}:arm64v8-${META_TAG} \
|
||||
lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} || :'''
|
||||
echo "Running on node: ${NODE_NAME}"
|
||||
echo 'Logging into Github'
|
||||
sh '''#! /bin/bash
|
||||
echo $GITHUB_TOKEN | docker login ghcr.io -u LinuxServer-CI --password-stdin
|
||||
'''
|
||||
sh "docker build \
|
||||
--label \"org.opencontainers.image.created=${GITHUB_DATE}\" \
|
||||
--label \"org.opencontainers.image.authors=linuxserver.io\" \
|
||||
--label \"org.opencontainers.image.url=https://github.com/linuxserver/docker-calibre-web/packages\" \
|
||||
--label \"org.opencontainers.image.documentation=https://docs.linuxserver.io/images/docker-calibre-web\" \
|
||||
--label \"org.opencontainers.image.source=https://github.com/linuxserver/docker-calibre-web\" \
|
||||
--label \"org.opencontainers.image.version=${EXT_RELEASE_CLEAN}-ls${LS_TAG_NUMBER}\" \
|
||||
--label \"org.opencontainers.image.revision=${COMMIT_SHA}\" \
|
||||
--label \"org.opencontainers.image.vendor=linuxserver.io\" \
|
||||
--label \"org.opencontainers.image.licenses=GPL-3.0-only\" \
|
||||
--label \"org.opencontainers.image.ref.name=${COMMIT_SHA}\" \
|
||||
--label \"org.opencontainers.image.title=Calibre-web\" \
|
||||
--label \"org.opencontainers.image.description=calibre-web image by linuxserver.io\" \
|
||||
--no-cache --pull -f Dockerfile.aarch64 -t ${IMAGE}:arm64v8-${META_TAG} \
|
||||
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
|
||||
sh "docker tag ${IMAGE}:arm64v8-${META_TAG} ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}"
|
||||
retry(5) {
|
||||
sh "docker push ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}"
|
||||
}
|
||||
sh '''docker rmi \
|
||||
${IMAGE}:arm64v8-${META_TAG} \
|
||||
ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} || :'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Take the image we just built and dump package versions for comparison
|
||||
stage('Update-packages') {
|
||||
when {
|
||||
branch "master"
|
||||
environment name: 'CHANGE_ID', value: ''
|
||||
environment name: 'EXIT_STATUS', value: ''
|
||||
}
|
||||
steps {
|
||||
sh '''#! /bin/bash
|
||||
set -e
|
||||
TEMPDIR=$(mktemp -d)
|
||||
if [ "${MULTIARCH}" == "true" ]; then
|
||||
LOCAL_CONTAINER=${IMAGE}:amd64-${META_TAG}
|
||||
else
|
||||
LOCAL_CONTAINER=${IMAGE}:${META_TAG}
|
||||
fi
|
||||
if [ "${DIST_IMAGE}" == "alpine" ]; then
|
||||
docker run --rm --entrypoint '/bin/sh' -v ${TEMPDIR}:/tmp ${LOCAL_CONTAINER} -c '\
|
||||
apk info -v > /tmp/package_versions.txt && \
|
||||
sort -o /tmp/package_versions.txt /tmp/package_versions.txt && \
|
||||
chmod 777 /tmp/package_versions.txt'
|
||||
elif [ "${DIST_IMAGE}" == "ubuntu" ]; then
|
||||
docker run --rm --entrypoint '/bin/sh' -v ${TEMPDIR}:/tmp ${LOCAL_CONTAINER} -c '\
|
||||
apt list -qq --installed | sed "s#/.*now ##g" | cut -d" " -f1 > /tmp/package_versions.txt && \
|
||||
sort -o /tmp/package_versions.txt /tmp/package_versions.txt && \
|
||||
chmod 777 /tmp/package_versions.txt'
|
||||
fi
|
||||
NEW_PACKAGE_TAG=$(md5sum ${TEMPDIR}/package_versions.txt | cut -c1-8 )
|
||||
echo "Package tag sha from current packages in buit container is ${NEW_PACKAGE_TAG} comparing to old ${PACKAGE_TAG} from github"
|
||||
if [ "${NEW_PACKAGE_TAG}" != "${PACKAGE_TAG}" ]; then
|
||||
git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/${LS_REPO}
|
||||
git --git-dir ${TEMPDIR}/${LS_REPO}/.git checkout -f master
|
||||
cp ${TEMPDIR}/package_versions.txt ${TEMPDIR}/${LS_REPO}/
|
||||
cd ${TEMPDIR}/${LS_REPO}/
|
||||
wait
|
||||
git add package_versions.txt
|
||||
git commit -m 'Bot Updating Package Versions'
|
||||
git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git --all
|
||||
echo "true" > /tmp/packages-${COMMIT_SHA}-${BUILD_NUMBER}
|
||||
echo "Package tag updated, stopping build process"
|
||||
else
|
||||
echo "false" > /tmp/packages-${COMMIT_SHA}-${BUILD_NUMBER}
|
||||
echo "Package tag is same as previous continue with build process"
|
||||
fi
|
||||
rm -Rf ${TEMPDIR}'''
|
||||
script{
|
||||
env.PACKAGE_UPDATED = sh(
|
||||
script: '''cat /tmp/packages-${COMMIT_SHA}-${BUILD_NUMBER}''',
|
||||
returnStdout: true).trim()
|
||||
}
|
||||
}
|
||||
}
|
||||
// Exit the build if the package file was just updated
|
||||
stage('PACKAGE-exit') {
|
||||
when {
|
||||
branch "master"
|
||||
environment name: 'CHANGE_ID', value: ''
|
||||
environment name: 'PACKAGE_UPDATED', value: 'true'
|
||||
environment name: 'EXIT_STATUS', value: ''
|
||||
}
|
||||
steps {
|
||||
script{
|
||||
env.EXIT_STATUS = 'ABORTED'
|
||||
}
|
||||
}
|
||||
}
|
||||
// Exit the build if this is just a package check and there are no changes to push
|
||||
stage('PACKAGECHECK-exit') {
|
||||
when {
|
||||
branch "master"
|
||||
environment name: 'CHANGE_ID', value: ''
|
||||
environment name: 'PACKAGE_UPDATED', value: 'false'
|
||||
environment name: 'EXIT_STATUS', value: ''
|
||||
expression {
|
||||
params.PACKAGE_CHECK == 'true'
|
||||
}
|
||||
}
|
||||
steps {
|
||||
script{
|
||||
env.EXIT_STATUS = 'ABORTED'
|
||||
}
|
||||
}
|
||||
}
|
||||
/* #######
|
||||
Testing
|
||||
####### */
|
||||
@ -459,20 +552,20 @@ pipeline {
|
||||
}
|
||||
steps {
|
||||
withCredentials([
|
||||
string(credentialsId: 'spaces-key', variable: 'DO_KEY'),
|
||||
string(credentialsId: 'spaces-secret', variable: 'DO_SECRET')
|
||||
string(credentialsId: 'ci-tests-s3-key-id', variable: 'S3_KEY'),
|
||||
string(credentialsId: 'ci-tests-s3-secret-access-key ', variable: 'S3_SECRET')
|
||||
]) {
|
||||
script{
|
||||
env.CI_URL = 'https://lsio-ci.ams3.digitaloceanspaces.com/' + env.IMAGE + '/' + env.META_TAG + '/index.html'
|
||||
env.CI_URL = 'https://ci-tests.linuxserver.io/' + env.IMAGE + '/' + env.META_TAG + '/index.html'
|
||||
}
|
||||
sh '''#! /bin/bash
|
||||
set -e
|
||||
docker pull lsiodev/ci:latest
|
||||
docker pull ghcr.io/linuxserver/ci:latest
|
||||
if [ "${MULTIARCH}" == "true" ]; then
|
||||
docker pull lsiodev/buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER}
|
||||
docker pull lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}
|
||||
docker tag lsiodev/buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER} ${IMAGE}:arm32v7-${META_TAG}
|
||||
docker tag lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} ${IMAGE}:arm64v8-${META_TAG}
|
||||
docker pull ghcr.io/linuxserver/lsiodev-buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER}
|
||||
docker pull ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}
|
||||
docker tag ghcr.io/linuxserver/lsiodev-buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER} ${IMAGE}:arm32v7-${META_TAG}
|
||||
docker tag ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} ${IMAGE}:arm64v8-${META_TAG}
|
||||
fi
|
||||
docker run --rm \
|
||||
--shm-size=1gb \
|
||||
@ -484,15 +577,15 @@ pipeline {
|
||||
-e PORT=\"${CI_PORT}\" \
|
||||
-e SSL=\"${CI_SSL}\" \
|
||||
-e BASE=\"${DIST_IMAGE}\" \
|
||||
-e SECRET_KEY=\"${DO_SECRET}\" \
|
||||
-e ACCESS_KEY=\"${DO_KEY}\" \
|
||||
-e SECRET_KEY=\"${S3_SECRET}\" \
|
||||
-e ACCESS_KEY=\"${S3_KEY}\" \
|
||||
-e DOCKER_ENV=\"${CI_DOCKERENV}\" \
|
||||
-e WEB_SCREENSHOT=\"${CI_WEB}\" \
|
||||
-e WEB_AUTH=\"${CI_AUTH}\" \
|
||||
-e WEB_PATH=\"${CI_WEBPATH}\" \
|
||||
-e DO_REGION="ams3" \
|
||||
-e DO_BUCKET="lsio-ci" \
|
||||
-t lsiodev/ci:latest \
|
||||
-t ghcr.io/linuxserver/ci:latest \
|
||||
python /ci/ci.py'''
|
||||
}
|
||||
}
|
||||
@ -513,19 +606,48 @@ pipeline {
|
||||
credentialsId: '3f9ba4d5-100d-45b0-a3c4-633fd6061207',
|
||||
usernameVariable: 'DOCKERUSER',
|
||||
passwordVariable: 'DOCKERPASS'
|
||||
],
|
||||
[
|
||||
$class: 'UsernamePasswordMultiBinding',
|
||||
credentialsId: 'Quay.io-Robot',
|
||||
usernameVariable: 'QUAYUSER',
|
||||
passwordVariable: 'QUAYPASS'
|
||||
]
|
||||
]) {
|
||||
echo 'Logging into DockerHub'
|
||||
retry(5) {
|
||||
sh '''#! /bin/bash
|
||||
set -e
|
||||
echo $DOCKERPASS | docker login -u $DOCKERUSER --password-stdin
|
||||
echo $GITHUB_TOKEN | docker login ghcr.io -u LinuxServer-CI --password-stdin
|
||||
echo $GITLAB_TOKEN | docker login registry.gitlab.com -u LinuxServer.io --password-stdin
|
||||
echo $QUAYPASS | docker login quay.io -u $QUAYUSER --password-stdin
|
||||
for PUSHIMAGE in "${GITHUBIMAGE}" "${GITLABIMAGE}" "${QUAYIMAGE}" "${IMAGE}"; do
|
||||
docker tag ${IMAGE}:${META_TAG} ${PUSHIMAGE}:${META_TAG}
|
||||
docker tag ${PUSHIMAGE}:${META_TAG} ${PUSHIMAGE}:calibre
|
||||
docker tag ${PUSHIMAGE}:${META_TAG} ${PUSHIMAGE}:${EXT_RELEASE_TAG}
|
||||
if [ -n "${SEMVER}" ]; then
|
||||
docker tag ${PUSHIMAGE}:${META_TAG} ${PUSHIMAGE}:${SEMVER}
|
||||
fi
|
||||
docker push ${PUSHIMAGE}:calibre
|
||||
docker push ${PUSHIMAGE}:${META_TAG}
|
||||
docker push ${PUSHIMAGE}:${EXT_RELEASE_TAG}
|
||||
if [ -n "${SEMVER}" ]; then
|
||||
docker push ${PUSHIMAGE}:${SEMVER}
|
||||
fi
|
||||
done
|
||||
'''
|
||||
}
|
||||
sh '''#! /bin/bash
|
||||
echo $DOCKERPASS | docker login -u $DOCKERUSER --password-stdin
|
||||
for DELETEIMAGE in "${GITHUBIMAGE}" "${GITLABIMAGE}" "${QUAYIMAGE}" "${IMAGE}"; do
|
||||
docker rmi \
|
||||
${DELETEIMAGE}:${META_TAG} \
|
||||
${DELETEIMAGE}:${EXT_RELEASE_TAG} \
|
||||
${DELETEIMAGE}:calibre || :
|
||||
if [ -n "${SEMVER}" ]; then
|
||||
docker rmi ${DELETEIMAGE}:${SEMVER} || :
|
||||
fi
|
||||
done
|
||||
'''
|
||||
sh "docker tag ${IMAGE}:${META_TAG} ${IMAGE}:latest"
|
||||
sh "docker push ${IMAGE}:latest"
|
||||
sh "docker push ${IMAGE}:${META_TAG}"
|
||||
sh '''docker rmi \
|
||||
${IMAGE}:${META_TAG} \
|
||||
${IMAGE}:latest || :'''
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -542,53 +664,113 @@ pipeline {
|
||||
credentialsId: '3f9ba4d5-100d-45b0-a3c4-633fd6061207',
|
||||
usernameVariable: 'DOCKERUSER',
|
||||
passwordVariable: 'DOCKERPASS'
|
||||
],
|
||||
[
|
||||
$class: 'UsernamePasswordMultiBinding',
|
||||
credentialsId: 'Quay.io-Robot',
|
||||
usernameVariable: 'QUAYUSER',
|
||||
passwordVariable: 'QUAYPASS'
|
||||
]
|
||||
]) {
|
||||
retry(5) {
|
||||
sh '''#! /bin/bash
|
||||
set -e
|
||||
echo $DOCKERPASS | docker login -u $DOCKERUSER --password-stdin
|
||||
echo $GITHUB_TOKEN | docker login ghcr.io -u LinuxServer-CI --password-stdin
|
||||
echo $GITLAB_TOKEN | docker login registry.gitlab.com -u LinuxServer.io --password-stdin
|
||||
echo $QUAYPASS | docker login quay.io -u $QUAYUSER --password-stdin
|
||||
if [ "${CI}" == "false" ]; then
|
||||
docker pull ghcr.io/linuxserver/lsiodev-buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER}
|
||||
docker pull ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}
|
||||
docker tag ghcr.io/linuxserver/lsiodev-buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER} ${IMAGE}:arm32v7-${META_TAG}
|
||||
docker tag ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} ${IMAGE}:arm64v8-${META_TAG}
|
||||
fi
|
||||
for MANIFESTIMAGE in "${IMAGE}" "${GITLABIMAGE}" "${GITHUBIMAGE}" "${QUAYIMAGE}"; do
|
||||
docker tag ${IMAGE}:amd64-${META_TAG} ${MANIFESTIMAGE}:amd64-${META_TAG}
|
||||
docker tag ${IMAGE}:arm32v7-${META_TAG} ${MANIFESTIMAGE}:arm32v7-${META_TAG}
|
||||
docker tag ${IMAGE}:arm64v8-${META_TAG} ${MANIFESTIMAGE}:arm64v8-${META_TAG}
|
||||
docker tag ${MANIFESTIMAGE}:amd64-${META_TAG} ${MANIFESTIMAGE}:amd64-calibre
|
||||
docker tag ${MANIFESTIMAGE}:arm32v7-${META_TAG} ${MANIFESTIMAGE}:arm32v7-calibre
|
||||
docker tag ${MANIFESTIMAGE}:arm64v8-${META_TAG} ${MANIFESTIMAGE}:arm64v8-calibre
|
||||
docker tag ${MANIFESTIMAGE}:amd64-${META_TAG} ${MANIFESTIMAGE}:amd64-${EXT_RELEASE_TAG}
|
||||
docker tag ${MANIFESTIMAGE}:arm32v7-${META_TAG} ${MANIFESTIMAGE}:arm32v7-${EXT_RELEASE_TAG}
|
||||
docker tag ${MANIFESTIMAGE}:arm64v8-${META_TAG} ${MANIFESTIMAGE}:arm64v8-${EXT_RELEASE_TAG}
|
||||
if [ -n "${SEMVER}" ]; then
|
||||
docker tag ${MANIFESTIMAGE}:amd64-${META_TAG} ${MANIFESTIMAGE}:amd64-${SEMVER}
|
||||
docker tag ${MANIFESTIMAGE}:arm32v7-${META_TAG} ${MANIFESTIMAGE}:arm32v7-${SEMVER}
|
||||
docker tag ${MANIFESTIMAGE}:arm64v8-${META_TAG} ${MANIFESTIMAGE}:arm64v8-${SEMVER}
|
||||
fi
|
||||
docker push ${MANIFESTIMAGE}:amd64-${META_TAG}
|
||||
docker push ${MANIFESTIMAGE}:arm32v7-${META_TAG}
|
||||
docker push ${MANIFESTIMAGE}:arm64v8-${META_TAG}
|
||||
docker push ${MANIFESTIMAGE}:amd64-calibre
|
||||
docker push ${MANIFESTIMAGE}:arm32v7-calibre
|
||||
docker push ${MANIFESTIMAGE}:arm64v8-calibre
|
||||
docker push ${MANIFESTIMAGE}:amd64-${EXT_RELEASE_TAG}
|
||||
docker push ${MANIFESTIMAGE}:arm32v7-${EXT_RELEASE_TAG}
|
||||
docker push ${MANIFESTIMAGE}:arm64v8-${EXT_RELEASE_TAG}
|
||||
if [ -n "${SEMVER}" ]; then
|
||||
docker push ${MANIFESTIMAGE}:amd64-${SEMVER}
|
||||
docker push ${MANIFESTIMAGE}:arm32v7-${SEMVER}
|
||||
docker push ${MANIFESTIMAGE}:arm64v8-${SEMVER}
|
||||
fi
|
||||
docker manifest push --purge ${MANIFESTIMAGE}:calibre || :
|
||||
docker manifest create ${MANIFESTIMAGE}:calibre ${MANIFESTIMAGE}:amd64-calibre ${MANIFESTIMAGE}:arm32v7-calibre ${MANIFESTIMAGE}:arm64v8-calibre
|
||||
docker manifest annotate ${MANIFESTIMAGE}:calibre ${MANIFESTIMAGE}:arm32v7-calibre --os linux --arch arm
|
||||
docker manifest annotate ${MANIFESTIMAGE}:calibre ${MANIFESTIMAGE}:arm64v8-calibre --os linux --arch arm64 --variant v8
|
||||
docker manifest push --purge ${MANIFESTIMAGE}:${META_TAG} || :
|
||||
docker manifest create ${MANIFESTIMAGE}:${META_TAG} ${MANIFESTIMAGE}:amd64-${META_TAG} ${MANIFESTIMAGE}:arm32v7-${META_TAG} ${MANIFESTIMAGE}:arm64v8-${META_TAG}
|
||||
docker manifest annotate ${MANIFESTIMAGE}:${META_TAG} ${MANIFESTIMAGE}:arm32v7-${META_TAG} --os linux --arch arm
|
||||
docker manifest annotate ${MANIFESTIMAGE}:${META_TAG} ${MANIFESTIMAGE}:arm64v8-${META_TAG} --os linux --arch arm64 --variant v8
|
||||
docker manifest push --purge ${MANIFESTIMAGE}:${EXT_RELEASE_TAG} || :
|
||||
docker manifest create ${MANIFESTIMAGE}:${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:amd64-${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:arm32v7-${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:arm64v8-${EXT_RELEASE_TAG}
|
||||
docker manifest annotate ${MANIFESTIMAGE}:${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:arm32v7-${EXT_RELEASE_TAG} --os linux --arch arm
|
||||
docker manifest annotate ${MANIFESTIMAGE}:${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:arm64v8-${EXT_RELEASE_TAG} --os linux --arch arm64 --variant v8
|
||||
if [ -n "${SEMVER}" ]; then
|
||||
docker manifest push --purge ${MANIFESTIMAGE}:${SEMVER} || :
|
||||
docker manifest create ${MANIFESTIMAGE}:${SEMVER} ${MANIFESTIMAGE}:amd64-${SEMVER} ${MANIFESTIMAGE}:arm32v7-${SEMVER} ${MANIFESTIMAGE}:arm64v8-${SEMVER}
|
||||
docker manifest annotate ${MANIFESTIMAGE}:${SEMVER} ${MANIFESTIMAGE}:arm32v7-${SEMVER} --os linux --arch arm
|
||||
docker manifest annotate ${MANIFESTIMAGE}:${SEMVER} ${MANIFESTIMAGE}:arm64v8-${SEMVER} --os linux --arch arm64 --variant v8
|
||||
fi
|
||||
docker manifest push --purge ${MANIFESTIMAGE}:calibre
|
||||
docker manifest push --purge ${MANIFESTIMAGE}:${META_TAG}
|
||||
docker manifest push --purge ${MANIFESTIMAGE}:${EXT_RELEASE_TAG}
|
||||
if [ -n "${SEMVER}" ]; then
|
||||
docker manifest push --purge ${MANIFESTIMAGE}:${SEMVER}
|
||||
fi
|
||||
done
|
||||
'''
|
||||
}
|
||||
sh '''#! /bin/bash
|
||||
echo $DOCKERPASS | docker login -u $DOCKERUSER --password-stdin
|
||||
for DELETEIMAGE in "${GITHUBIMAGE}" "${GITLABIMAGE}" "${QUAYIMAGE}" "${IMAGE}"; do
|
||||
docker rmi \
|
||||
${DELETEIMAGE}:amd64-${META_TAG} \
|
||||
${DELETEIMAGE}:amd64-calibre \
|
||||
${DELETEIMAGE}:amd64-${EXT_RELEASE_TAG} \
|
||||
${DELETEIMAGE}:arm32v7-${META_TAG} \
|
||||
${DELETEIMAGE}:arm32v7-calibre \
|
||||
${DELETEIMAGE}:arm32v7-${EXT_RELEASE_TAG} \
|
||||
${DELETEIMAGE}:arm64v8-${META_TAG} \
|
||||
${DELETEIMAGE}:arm64v8-calibre \
|
||||
${DELETEIMAGE}:arm64v8-${EXT_RELEASE_TAG} || :
|
||||
if [ -n "${SEMVER}" ]; then
|
||||
docker rmi \
|
||||
${DELETEIMAGE}:amd64-${SEMVER} \
|
||||
${DELETEIMAGE}:arm32v7-${SEMVER} \
|
||||
${DELETEIMAGE}:arm64v8-${SEMVER} || :
|
||||
fi
|
||||
done
|
||||
docker rmi \
|
||||
ghcr.io/linuxserver/lsiodev-buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER} \
|
||||
ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} || :
|
||||
'''
|
||||
sh '''#! /bin/bash
|
||||
if [ "${CI}" == "false" ]; then
|
||||
docker pull lsiodev/buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER}
|
||||
docker pull lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}
|
||||
docker tag lsiodev/buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER} ${IMAGE}:arm32v7-${META_TAG}
|
||||
docker tag lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} ${IMAGE}:arm64v8-${META_TAG}
|
||||
fi'''
|
||||
sh "docker tag ${IMAGE}:amd64-${META_TAG} ${IMAGE}:amd64-latest"
|
||||
sh "docker tag ${IMAGE}:arm32v7-${META_TAG} ${IMAGE}:arm32v7-latest"
|
||||
sh "docker tag ${IMAGE}:arm64v8-${META_TAG} ${IMAGE}:arm64v8-latest"
|
||||
sh "docker push ${IMAGE}:amd64-${META_TAG}"
|
||||
sh "docker push ${IMAGE}:arm32v7-${META_TAG}"
|
||||
sh "docker push ${IMAGE}:arm64v8-${META_TAG}"
|
||||
sh "docker push ${IMAGE}:amd64-latest"
|
||||
sh "docker push ${IMAGE}:arm32v7-latest"
|
||||
sh "docker push ${IMAGE}:arm64v8-latest"
|
||||
sh "docker manifest push --purge ${IMAGE}:latest || :"
|
||||
sh "docker manifest create ${IMAGE}:latest ${IMAGE}:amd64-latest ${IMAGE}:arm32v7-latest ${IMAGE}:arm64v8-latest"
|
||||
sh "docker manifest annotate ${IMAGE}:latest ${IMAGE}:arm32v7-latest --os linux --arch arm"
|
||||
sh "docker manifest annotate ${IMAGE}:latest ${IMAGE}:arm64v8-latest --os linux --arch arm64 --variant v8"
|
||||
sh "docker manifest push --purge ${IMAGE}:${META_TAG} || :"
|
||||
sh "docker manifest create ${IMAGE}:${META_TAG} ${IMAGE}:amd64-${META_TAG} ${IMAGE}:arm32v7-${META_TAG} ${IMAGE}:arm64v8-${META_TAG}"
|
||||
sh "docker manifest annotate ${IMAGE}:${META_TAG} ${IMAGE}:arm32v7-${META_TAG} --os linux --arch arm"
|
||||
sh "docker manifest annotate ${IMAGE}:${META_TAG} ${IMAGE}:arm64v8-${META_TAG} --os linux --arch arm64 --variant v8"
|
||||
sh "docker manifest push --purge ${IMAGE}:latest"
|
||||
sh "docker manifest push --purge ${IMAGE}:${META_TAG}"
|
||||
sh '''docker rmi \
|
||||
${IMAGE}:amd64-${META_TAG} \
|
||||
${IMAGE}:amd64-latest \
|
||||
${IMAGE}:arm32v7-${META_TAG} \
|
||||
${IMAGE}:arm32v7-latest \
|
||||
${IMAGE}:arm64v8-${META_TAG} \
|
||||
${IMAGE}:arm64v8-latest \
|
||||
lsiodev/buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER} \
|
||||
lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} || :'''
|
||||
}
|
||||
}
|
||||
}
|
||||
// If this is a public release tag it in the LS Github
|
||||
stage('Github-Tag-Push-Release') {
|
||||
when {
|
||||
branch "master"
|
||||
branch "calibre"
|
||||
expression {
|
||||
env.LS_RELEASE != env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER
|
||||
}
|
||||
@ -596,21 +778,21 @@ pipeline {
|
||||
environment name: 'EXIT_STATUS', value: ''
|
||||
}
|
||||
steps {
|
||||
echo "Pushing New tag for current commit ${EXT_RELEASE_CLEAN}-ls${LS_TAG_NUMBER}"
|
||||
echo "Pushing New tag for current commit ${META_TAG}"
|
||||
sh '''curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/git/tags \
|
||||
-d '{"tag":"'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\
|
||||
-d '{"tag":"'${META_TAG}'",\
|
||||
"object": "'${COMMIT_SHA}'",\
|
||||
"message": "Tagging Release '${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}' to master",\
|
||||
"message": "Tagging Release '${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}' to calibre",\
|
||||
"type": "commit",\
|
||||
"tagger": {"name": "LinuxServer Jenkins","email": "jenkins@linuxserver.io","date": "'${GITHUB_DATE}'"}}' '''
|
||||
echo "Pushing New release for Tag"
|
||||
sh '''#! /bin/bash
|
||||
curl -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases/latest | jq '. |.body' | sed 's:^.\\(.*\\).$:\\1:' > releasebody.json
|
||||
echo '{"tag_name":"'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\
|
||||
"target_commitish": "master",\
|
||||
"name": "'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\
|
||||
"body": "**LinuxServer Changes:**\\n\\n'${LS_RELEASE_NOTES}'\\n**'${EXT_REPO}' Changes:**\\n\\n' > start
|
||||
printf '","draft": false,"prerelease": false}' >> releasebody.json
|
||||
curl -H "Authorization: token ${GITHUB_TOKEN}" -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases/latest | jq '. |.body' | sed 's:^.\\(.*\\).$:\\1:' > releasebody.json
|
||||
echo '{"tag_name":"'${META_TAG}'",\
|
||||
"target_commitish": "calibre",\
|
||||
"name": "'${META_TAG}'",\
|
||||
"body": "**LinuxServer Changes:**\\n\\n'${LS_RELEASE_NOTES}'\\n\\n**'${EXT_REPO}' Changes:**\\n\\n' > start
|
||||
printf '","draft": false,"prerelease": true}' >> releasebody.json
|
||||
paste -d'\\0' start releasebody.json > releasebody.json.done
|
||||
curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/releases -d @releasebody.json.done'''
|
||||
}
|
||||
@ -631,14 +813,20 @@ pipeline {
|
||||
]
|
||||
]) {
|
||||
sh '''#! /bin/bash
|
||||
docker pull lsiodev/readme-sync
|
||||
set -e
|
||||
TEMPDIR=$(mktemp -d)
|
||||
docker pull ghcr.io/linuxserver/jenkins-builder:latest
|
||||
docker run --rm -e CONTAINER_NAME=${CONTAINER_NAME} -e GITHUB_BRANCH="${BRANCH_NAME}" -v ${TEMPDIR}:/ansible/jenkins ghcr.io/linuxserver/jenkins-builder:latest
|
||||
docker pull ghcr.io/linuxserver/readme-sync
|
||||
docker run --rm=true \
|
||||
-e DOCKERHUB_USERNAME=$DOCKERUSER \
|
||||
-e DOCKERHUB_PASSWORD=$DOCKERPASS \
|
||||
-e GIT_REPOSITORY=${LS_USER}/${LS_REPO} \
|
||||
-e DOCKER_REPOSITORY=${IMAGE} \
|
||||
-e GIT_BRANCH=master \
|
||||
lsiodev/readme-sync bash -c 'node sync' '''
|
||||
-v ${TEMPDIR}/docker-${CONTAINER_NAME}:/mnt \
|
||||
ghcr.io/linuxserver/readme-sync bash -c 'node sync'
|
||||
rm -Rf ${TEMPDIR} '''
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -665,16 +853,19 @@ pipeline {
|
||||
sh 'echo "build aborted"'
|
||||
}
|
||||
else if (currentBuild.currentResult == "SUCCESS"){
|
||||
sh ''' curl -X POST --data '{"avatar_url": "https://wiki.jenkins-ci.org/download/attachments/2916393/headshot.png","embeds": [{"color": 1681177,\
|
||||
sh ''' curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://wiki.jenkins-ci.org/download/attachments/2916393/headshot.png","embeds": [{"color": 1681177,\
|
||||
"description": "**Build:** '${BUILD_NUMBER}'\\n**CI Results:** '${CI_URL}'\\n**ShellCheck Results:** '${SHELLCHECK_URL}'\\n**Status:** Success\\n**Job:** '${RUN_DISPLAY_URL}'\\n**Change:** '${CODE_URL}'\\n**External Release:**: '${RELEASE_LINK}'\\n**DockerHub:** '${DOCKERHUB_LINK}'\\n"}],\
|
||||
"username": "Jenkins"}' ${BUILDS_DISCORD} '''
|
||||
}
|
||||
else {
|
||||
sh ''' curl -X POST --data '{"avatar_url": "https://wiki.jenkins-ci.org/download/attachments/2916393/headshot.png","embeds": [{"color": 16711680,\
|
||||
sh ''' curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://wiki.jenkins-ci.org/download/attachments/2916393/headshot.png","embeds": [{"color": 16711680,\
|
||||
"description": "**Build:** '${BUILD_NUMBER}'\\n**CI Results:** '${CI_URL}'\\n**ShellCheck Results:** '${SHELLCHECK_URL}'\\n**Status:** failure\\n**Job:** '${RUN_DISPLAY_URL}'\\n**Change:** '${CODE_URL}'\\n**External Release:**: '${RELEASE_LINK}'\\n**DockerHub:** '${DOCKERHUB_LINK}'\\n"}],\
|
||||
"username": "Jenkins"}' ${BUILDS_DISCORD} '''
|
||||
}
|
||||
}
|
||||
}
|
||||
cleanup {
|
||||
cleanWs()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
215
README.md
215
README.md
@ -1,213 +1,10 @@
|
||||
[![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)](https://linuxserver.io)
|
||||
<!-- DO NOT EDIT THIS FILE MANUALLY -->
|
||||
<!-- Please read the https://github.com/linuxserver/docker-calibre-web/blob/calibre/.github/CONTRIBUTING.md -->
|
||||
|
||||
The [LinuxServer.io](https://linuxserver.io) team brings you another container release featuring :-
|
||||
# Calibre - Docker mod for calibre-web
|
||||
|
||||
* regular and timely application updates
|
||||
* easy user mappings (PGID, PUID)
|
||||
* custom base image with s6 overlay
|
||||
* weekly base OS updates with common layers across the entire LinuxServer.io ecosystem to minimise space usage, down time and bandwidth
|
||||
* regular security updates
|
||||
This mod adds the calibre binary to calibre-web (**x86-64 only**) for ebook conversions.
|
||||
|
||||
Find us at:
|
||||
* [Discord](https://discord.gg/YWrKVTn) - realtime support / chat with the community and the team.
|
||||
* [IRC](https://irc.linuxserver.io) - on freenode at `#linuxserver.io`. Our primary support channel is Discord.
|
||||
* [Blog](https://blog.linuxserver.io) - all the things you can do with our containers including How-To guides, opinions and much more!
|
||||
In calibre-web docker arguments, set an environment variable `DOCKER_MODS=linuxserver/calibre-web:calibre` to enable.
|
||||
|
||||
# [linuxserver/calibre-web](https://github.com/linuxserver/docker-calibre-web)
|
||||
[![](https://img.shields.io/discord/354974912613449730.svg?logo=discord&label=LSIO%20Discord&style=flat-square)](https://discord.gg/YWrKVTn)
|
||||
[![](https://images.microbadger.com/badges/version/linuxserver/calibre-web.svg)](https://microbadger.com/images/linuxserver/calibre-web "Get your own version badge on microbadger.com")
|
||||
[![](https://images.microbadger.com/badges/image/linuxserver/calibre-web.svg)](https://microbadger.com/images/linuxserver/calibre-web "Get your own version badge on microbadger.com")
|
||||
![Docker Pulls](https://img.shields.io/docker/pulls/linuxserver/calibre-web.svg)
|
||||
![Docker Stars](https://img.shields.io/docker/stars/linuxserver/calibre-web.svg)
|
||||
[![Build Status](https://ci.linuxserver.io/buildStatus/icon?job=Docker-Pipeline-Builders/docker-calibre-web/master)](https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-calibre-web/job/master/)
|
||||
[![](https://lsio-ci.ams3.digitaloceanspaces.com/linuxserver/calibre-web/latest/badge.svg)](https://lsio-ci.ams3.digitaloceanspaces.com/linuxserver/calibre-web/latest/index.html)
|
||||
|
||||
[Calibre-web](https://github.com/janeczku/calibre-web) is a web app providing a clean interface for browsing, reading and downloading eBooks using an existing Calibre database. It is also possible to integrate google drive and edit metadata and your calibre library through the app itself.
|
||||
|
||||
This software is a fork of library and licensed under the GPL v3 License.
|
||||
|
||||
|
||||
[![calibre-web](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/calibre-web-icon.png)](https://github.com/janeczku/calibre-web)
|
||||
|
||||
## Supported Architectures
|
||||
|
||||
Our images support multiple architectures such as `x86-64`, `arm64` and `armhf`. We utilise the docker manifest for multi-platform awareness. More information is available from docker [here](https://github.com/docker/distribution/blob/master/docs/spec/manifest-v2-2.md#manifest-list) and our announcement [here](https://blog.linuxserver.io/2019/02/21/the-lsio-pipeline-project/).
|
||||
|
||||
Simply pulling `linuxserver/calibre-web` should retrieve the correct image for your arch, but you can also pull specific arch images via tags.
|
||||
|
||||
The architectures supported by this image are:
|
||||
|
||||
| Architecture | Tag |
|
||||
| :----: | --- |
|
||||
| x86-64 | amd64-latest |
|
||||
| arm64 | arm64v8-latest |
|
||||
| armhf | arm32v7-latest |
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
Here are some example snippets to help you get started creating a container.
|
||||
|
||||
### docker
|
||||
|
||||
```
|
||||
docker create \
|
||||
--name=calibre-web \
|
||||
-e PUID=1000 \
|
||||
-e PGID=1000 \
|
||||
-e TZ=Europe/London \
|
||||
-p 8083:8083 \
|
||||
-v <path to data>:/config \
|
||||
-v <path to calibre library>:/books \
|
||||
--restart unless-stopped \
|
||||
linuxserver/calibre-web
|
||||
```
|
||||
|
||||
|
||||
### docker-compose
|
||||
|
||||
Compatible with docker-compose v2 schemas.
|
||||
|
||||
```
|
||||
---
|
||||
version: "2"
|
||||
services:
|
||||
calibre-web:
|
||||
image: linuxserver/calibre-web
|
||||
container_name: calibre-web
|
||||
environment:
|
||||
- PUID=1000
|
||||
- PGID=1000
|
||||
- TZ=Europe/London
|
||||
volumes:
|
||||
- <path to data>:/config
|
||||
- <path to calibre library>:/books
|
||||
ports:
|
||||
- 8083:8083
|
||||
restart: unless-stopped
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
Container images are configured using parameters passed at runtime (such as those above). These parameters are separated by a colon and indicate `<external>:<internal>` respectively. For example, `-p 8080:80` would expose port `80` from inside the container to be accessible from the host's IP on port `8080` outside the container.
|
||||
|
||||
| Parameter | Function |
|
||||
| :----: | --- |
|
||||
| `-p 8083` | WebUI |
|
||||
| `-e PUID=1000` | for UserID - see below for explanation |
|
||||
| `-e PGID=1000` | for GroupID - see below for explanation |
|
||||
| `-e TZ=Europe/London` | Specify a timezone to use EG Europe/London. |
|
||||
| `-v /config` | Where calibre-web stores the internal database and config. |
|
||||
| `-v /books` | Where your calibre database is locate. |
|
||||
|
||||
## User / Group Identifiers
|
||||
|
||||
When using volumes (`-v` flags) permissions issues can arise between the host OS and the container, we avoid this issue by allowing you to specify the user `PUID` and group `PGID`.
|
||||
|
||||
Ensure any volume directories on the host are owned by the same user you specify and any permissions issues will vanish like magic.
|
||||
|
||||
In this instance `PUID=1000` and `PGID=1000`, to find yours use `id user` as below:
|
||||
|
||||
```
|
||||
$ id username
|
||||
uid=1000(dockeruser) gid=1000(dockergroup) groups=1000(dockergroup)
|
||||
```
|
||||
|
||||
|
||||
|
||||
## Application Setup
|
||||
|
||||
Webui can be found at `http://your-ip:8083`
|
||||
|
||||
On the initial setup screen, enter `/books` as your calibre library location.
|
||||
|
||||
**Default admin login:**
|
||||
*Username:* admin
|
||||
*Password:* admin123
|
||||
|
||||
To reverse proxy with our Letsencrypt docker container use the following location block:
|
||||
```
|
||||
location /calibre-web {
|
||||
proxy_pass http://<your-ip>:8083;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Scheme $scheme;
|
||||
proxy_set_header X-Script-Name /calibre-web;
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
## Support Info
|
||||
|
||||
* Shell access whilst the container is running: `docker exec -it calibre-web /bin/bash`
|
||||
* To monitor the logs of the container in realtime: `docker logs -f calibre-web`
|
||||
* container version number
|
||||
* `docker inspect -f '{{ index .Config.Labels "build_version" }}' calibre-web`
|
||||
* image version number
|
||||
* `docker inspect -f '{{ index .Config.Labels "build_version" }}' linuxserver/calibre-web`
|
||||
|
||||
## Updating Info
|
||||
|
||||
Most of our images are static, versioned, and require an image update and container recreation to update the app inside. With some exceptions (ie. nextcloud, plex), we do not recommend or support updating apps inside the container. Please consult the [Application Setup](#application-setup) section above to see if it is recommended for the image.
|
||||
|
||||
Below are the instructions for updating containers:
|
||||
|
||||
### Via Docker Run/Create
|
||||
* Update the image: `docker pull linuxserver/calibre-web`
|
||||
* Stop the running container: `docker stop calibre-web`
|
||||
* Delete the container: `docker rm calibre-web`
|
||||
* Recreate a new container with the same docker create parameters as instructed above (if mapped correctly to a host folder, your `/config` folder and settings will be preserved)
|
||||
* Start the new container: `docker start calibre-web`
|
||||
* You can also remove the old dangling images: `docker image prune`
|
||||
|
||||
### Via Docker Compose
|
||||
* Update all images: `docker-compose pull`
|
||||
* or update a single image: `docker-compose pull calibre-web`
|
||||
* Let compose update all containers as necessary: `docker-compose up -d`
|
||||
* or update a single container: `docker-compose up -d calibre-web`
|
||||
* You can also remove the old dangling images: `docker image prune`
|
||||
|
||||
### Via Watchtower auto-updater (especially useful if you don't remember the original parameters)
|
||||
* Pull the latest image at its tag and replace it with the same env variables in one run:
|
||||
```
|
||||
docker run --rm \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
containrrr/watchtower \
|
||||
--run-once calibre-web
|
||||
```
|
||||
* You can also remove the old dangling images: `docker image prune`
|
||||
|
||||
## Building locally
|
||||
|
||||
If you want to make local modifications to these images for development purposes or just to customize the logic:
|
||||
```
|
||||
git clone https://github.com/linuxserver/docker-calibre-web.git
|
||||
cd docker-calibre-web
|
||||
docker build \
|
||||
--no-cache \
|
||||
--pull \
|
||||
-t linuxserver/calibre-web:latest .
|
||||
```
|
||||
|
||||
The ARM variants can be built on x86_64 hardware using `multiarch/qemu-user-static`
|
||||
```
|
||||
docker run --rm --privileged multiarch/qemu-user-static:register --reset
|
||||
```
|
||||
|
||||
Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64`.
|
||||
|
||||
## Versions
|
||||
|
||||
* **02.06.19:** - Rebase to Ubuntu Bionic & add Gdrive support.
|
||||
* **23.03.19:** - Switching to new Base images, shift to arm32v7 tag.
|
||||
* **23.02.19:** - Rebase to alpine 3.9, use repo version of imagemagick.
|
||||
* **11.02.19:** - Add pipeline logic and multi arch.
|
||||
* **03.01.19:** - Remove guest user from default app.db.
|
||||
* **16.08.18:** - Rebase to alpine 3.8.
|
||||
* **03.07.18:** - New build pushed, all versions below `67` have [vulnerability](https://github.com/janeczku/calibre-web/issues/534).
|
||||
* **05.01.18:** - Deprecate cpu_core routine lack of scaling.
|
||||
* **06.12.17:** - Rebase to alpine 3.7.
|
||||
* **27.11.17:** - Use cpu core counting routine to speed up build time.
|
||||
* **24.07.17:** - Curl version for imagemagick.
|
||||
* **17.07.17:** - Initial release.
|
||||
If adding multiple mods, enter them in an array separated by `|`, such as `DOCKER_MODS=linuxserver/calibre-web:calibre|linuxserver/mods:other-mod`
|
||||
|
@ -3,14 +3,15 @@
|
||||
# jenkins variables
|
||||
project_name: docker-calibre-web
|
||||
external_type: github_stable
|
||||
release_type: stable
|
||||
release_tag: latest
|
||||
ls_branch: master
|
||||
release_type: prerelease
|
||||
release_tag: calibre
|
||||
ls_branch: calibre
|
||||
skip_package_check: true
|
||||
repo_vars:
|
||||
- EXT_GIT_BRANCH = 'master'
|
||||
- EXT_USER = 'janeczku'
|
||||
- EXT_REPO = 'calibre-web'
|
||||
- BUILD_VERSION_ARG = 'CALIBREWEB_RELEASE'
|
||||
- EXT_USER = 'kovidgoyal'
|
||||
- EXT_REPO = 'calibre'
|
||||
- BUILD_VERSION_ARG = 'CALIBRE_RELEASE'
|
||||
- LS_USER = 'linuxserver'
|
||||
- LS_REPO = 'docker-calibre-web'
|
||||
- CONTAINER_NAME = 'calibre-web'
|
||||
@ -18,12 +19,5 @@ repo_vars:
|
||||
- DEV_DOCKERHUB_IMAGE = 'lsiodev/calibre-web'
|
||||
- PR_DOCKERHUB_IMAGE = 'lspipepr/calibre-web'
|
||||
- DIST_IMAGE = 'ubuntu'
|
||||
- MULTIARCH='true'
|
||||
- CI='true'
|
||||
- CI_WEB='true'
|
||||
- CI_PORT='8083'
|
||||
- CI_SSL='false'
|
||||
- CI_DELAY='120'
|
||||
- CI_DOCKERENV='TZ=US/Pacific'
|
||||
- CI_AUTH='user:password'
|
||||
- CI_WEBPATH=''
|
||||
- MULTIARCH = 'false'
|
||||
- CI = 'false'
|
||||
|
@ -1,216 +0,0 @@
|
||||
adduser3.116ubuntu1
|
||||
apt1.6.10
|
||||
apt-utils1.6.10
|
||||
base-files10.1ubuntu2.4
|
||||
base-passwd3.5.44
|
||||
bash4.4.18-2ubuntu1.1
|
||||
bsdutils1:2.31.1-0.4ubuntu3.3
|
||||
bzip21.0.6-8.1
|
||||
ca-certificates20180409
|
||||
coreutils8.28-1ubuntu1
|
||||
curl7.58.0-2ubuntu3.7
|
||||
dash0.5.8-2.10
|
||||
dbus1.12.2-1ubuntu1
|
||||
debconf1.5.66ubuntu1
|
||||
debianutils4.8.4
|
||||
diffutils1:3.6-1
|
||||
dpkg1.19.0.5ubuntu2.1
|
||||
e2fsprogs1.44.1-1ubuntu1.1
|
||||
fdisk2.31.1-0.4ubuntu3.3
|
||||
file1:5.32-2ubuntu0.2
|
||||
findutils4.6.0+git+20170828-2
|
||||
fontconfig2.12.6-0ubuntu2
|
||||
fontconfig-config2.12.6-0ubuntu2
|
||||
fonts-dejavu-core2.37-1
|
||||
fonts-droid-fallback1:6.0.1r16-1.1
|
||||
fonts-noto-mono20171026-2
|
||||
gcc-8-base8.3.0-6ubuntu1~18.04
|
||||
ghostscript9.26~dfsg+0-0ubuntu0.18.04.9
|
||||
gpgv2.2.4-1ubuntu1.2
|
||||
grep3.1-2
|
||||
gsfonts1:8.11+urwcyr1.0.7~pre44-4.4
|
||||
gzip1.6-5ubuntu1
|
||||
hicolor-icon-theme0.17-2
|
||||
hostname3.20
|
||||
imagemagick-6-common8:6.9.7.4+dfsg-16ubuntu6.4
|
||||
imagemagick-6.q168:6.9.7.4+dfsg-16ubuntu6.4
|
||||
imagemagick8:6.9.7.4+dfsg-16ubuntu6.4
|
||||
init-system-helpers1.51
|
||||
krb5-locales1.16-2ubuntu0.1
|
||||
libacl12.2.52-3build1
|
||||
libapparmor12.12-4ubuntu5.1
|
||||
libapt-inst2.01.6.10
|
||||
libapt-pkg5.01.6.10
|
||||
libasn1-8-heimdal7.5.0+dfsg-1
|
||||
libattr11:2.4.47-2build1
|
||||
libaudit11:2.8.2-1ubuntu1
|
||||
libaudit-common1:2.8.2-1ubuntu1
|
||||
libavahi-client30.7-3.1ubuntu1.2
|
||||
libavahi-common30.7-3.1ubuntu1.2
|
||||
libavahi-common-data0.7-3.1ubuntu1.2
|
||||
libblkid12.31.1-0.4ubuntu3.3
|
||||
libbsd00.8.7-1
|
||||
libbz2-1.01.0.6-8.1
|
||||
libc62.27-3ubuntu1
|
||||
libcairo21.15.10-2ubuntu0.1
|
||||
libcap-ng00.7.7-3.1
|
||||
libc-bin2.27-3ubuntu1
|
||||
libcom-err21.44.1-1ubuntu1.1
|
||||
libcups22.2.7-1ubuntu2.6
|
||||
libcupsfilters11.20.2-0ubuntu3.1
|
||||
libcupsimage22.2.7-1ubuntu2.6
|
||||
libcurl47.58.0-2ubuntu3.7
|
||||
libdatrie10.2.10-7
|
||||
libdb5.35.3.28-13.1ubuntu1.1
|
||||
libdbus-1-31.12.2-1ubuntu1
|
||||
libdebconfclient00.213ubuntu1
|
||||
libdjvulibre213.5.27.1-8
|
||||
libdjvulibre-text3.5.27.1-8
|
||||
libexpat12.2.5-3
|
||||
libext2fs21.44.1-1ubuntu1.1
|
||||
libfdisk12.31.1-0.4ubuntu3.3
|
||||
libffi63.2.1-8
|
||||
libfftw3-double33.3.7-1
|
||||
libfontconfig12.12.6-0ubuntu2
|
||||
libfreetype62.8.1-2ubuntu2
|
||||
libgcc11:8.3.0-6ubuntu1~18.04
|
||||
libgcrypt201.8.1-4ubuntu1.1
|
||||
libglib2.0-02.56.4-0ubuntu0.18.04.2
|
||||
libglib2.0-data2.56.4-0ubuntu0.18.04.2
|
||||
libgmp102:6.1.2+dfsg-2
|
||||
libgnutls303.5.18-1ubuntu1.1
|
||||
libgomp18.3.0-6ubuntu1~18.04
|
||||
libgpg-error01.27-6
|
||||
libgraphite2-31.3.11-2
|
||||
libgs99.26~dfsg+0-0ubuntu0.18.04.9
|
||||
libgs9-common9.26~dfsg+0-0ubuntu0.18.04.9
|
||||
libgssapi3-heimdal7.5.0+dfsg-1
|
||||
libgssapi-krb5-21.16-2ubuntu0.1
|
||||
libharfbuzz0b1.7.2-1ubuntu1
|
||||
libhcrypto4-heimdal7.5.0+dfsg-1
|
||||
libheimbase1-heimdal7.5.0+dfsg-1
|
||||
libheimntlm0-heimdal7.5.0+dfsg-1
|
||||
libhogweed43.4-1
|
||||
libhx509-5-heimdal7.5.0+dfsg-1
|
||||
libicu6060.2-3ubuntu3
|
||||
libidn111.33-2.1ubuntu1.2
|
||||
libidn2-02.0.4-1.1build2
|
||||
libijs-0.350.35-13
|
||||
libilmbase122.2.0-11ubuntu2
|
||||
libjbig02.1-3.1build1
|
||||
libjbig2dec00.13-6
|
||||
libjpeg88c-2ubuntu8
|
||||
libjpeg-turbo81.5.2-0ubuntu5.18.04.1
|
||||
libk5crypto31.16-2ubuntu0.1
|
||||
libkeyutils11.5.9-9.2ubuntu2
|
||||
libkrb5-26-heimdal7.5.0+dfsg-1
|
||||
libkrb5-31.16-2ubuntu0.1
|
||||
libkrb5support01.16-2ubuntu0.1
|
||||
liblcms2-22.9-1ubuntu0.1
|
||||
libldap-2.4-22.4.45+dfsg-1ubuntu1.2
|
||||
libldap-common2.4.45+dfsg-1ubuntu1.2
|
||||
liblqr-1-00.4.2-2.1
|
||||
libltdl72.4.6-2
|
||||
liblz4-10.0~r131-2ubuntu3
|
||||
liblzma55.2.2-1.3
|
||||
libmagic11:5.32-2ubuntu0.2
|
||||
libmagickcore-6.q16-38:6.9.7.4+dfsg-16ubuntu6.4
|
||||
libmagickcore-6.q16-3-extra8:6.9.7.4+dfsg-16ubuntu6.4
|
||||
libmagickwand-6.q16-38:6.9.7.4+dfsg-16ubuntu6.4
|
||||
libmagic-mgc1:5.32-2ubuntu0.2
|
||||
libmount12.31.1-0.4ubuntu3.3
|
||||
libncurses56.1-1ubuntu1.18.04
|
||||
libncursesw56.1-1ubuntu1.18.04
|
||||
libnetpbm102:10.0-15.3build1
|
||||
libnettle63.4-1
|
||||
libnghttp2-141.30.0-1ubuntu1
|
||||
libopenexr222.2.0-11.1ubuntu1
|
||||
libp11-kit00.23.9-2
|
||||
libpam0g1.1.8-3.6ubuntu2.18.04.1
|
||||
libpam-modules1.1.8-3.6ubuntu2.18.04.1
|
||||
libpam-modules-bin1.1.8-3.6ubuntu2.18.04.1
|
||||
libpam-runtime1.1.8-3.6ubuntu2.18.04.1
|
||||
libpango-1.0-01.40.14-1ubuntu0.1
|
||||
libpangocairo-1.0-01.40.14-1ubuntu0.1
|
||||
libpangoft2-1.0-01.40.14-1ubuntu0.1
|
||||
libpaper11.1.24+nmu5ubuntu1
|
||||
libpaper-utils1.1.24+nmu5ubuntu1
|
||||
libpcre32:8.39-9
|
||||
libpixman-1-00.34.0-2
|
||||
libpng16-161.6.34-1ubuntu0.18.04.2
|
||||
libprocps62:3.3.12-3ubuntu1.1
|
||||
libpsl50.19.1-5build1
|
||||
libpython2.7-minimal2.7.15-4ubuntu4~18.04
|
||||
libpython2.7-stdlib2.7.15-4ubuntu4~18.04
|
||||
libpython-stdlib2.7.15~rc1-1
|
||||
libreadline77.0-3
|
||||
libroken18-heimdal7.5.0+dfsg-1
|
||||
librtmp12.4+20151223.gitfa8646d.1-1
|
||||
libsasl2-22.1.27~101-g0780600+dfsg-3ubuntu2
|
||||
libsasl2-modules2.1.27~101-g0780600+dfsg-3ubuntu2
|
||||
libsasl2-modules-db2.1.27~101-g0780600+dfsg-3ubuntu2
|
||||
libseccomp22.4.1-0ubuntu0.18.04.2
|
||||
libselinux12.7-2build2
|
||||
libsemanage12.7-2build2
|
||||
libsemanage-common2.7-2build2
|
||||
libsepol12.7-1
|
||||
libsmartcols12.31.1-0.4ubuntu3.3
|
||||
libsqlite3-03.22.0-1
|
||||
libss21.44.1-1ubuntu1.1
|
||||
libssl1.11.1.1-1ubuntu2.1~18.04.1
|
||||
libstdc++68.3.0-6ubuntu1~18.04
|
||||
libsystemd0237-3ubuntu10.21
|
||||
libtasn1-64.13-2
|
||||
libthai00.1.27-2
|
||||
libthai-data0.1.27-2
|
||||
libtiff54.0.9-5ubuntu0.2
|
||||
libtinfo56.1-1ubuntu1.18.04
|
||||
libudev1237-3ubuntu10.21
|
||||
libunistring20.9.9-0ubuntu2
|
||||
libuuid12.31.1-0.4ubuntu3.3
|
||||
libwind0-heimdal7.5.0+dfsg-1
|
||||
libwmf0.2-70.2.8.4-12
|
||||
libx11-62:1.6.4-3ubuntu0.2
|
||||
libx11-data2:1.6.4-3ubuntu0.2
|
||||
libxau61:1.0.8-1
|
||||
libxcb11.13-2~ubuntu18.04
|
||||
libxcb-render01.13-2~ubuntu18.04
|
||||
libxcb-shm01.13-2~ubuntu18.04
|
||||
libxdmcp61:1.1.2-3
|
||||
libxext62:1.3.3-1
|
||||
libxml22.9.4+dfsg1-6.1ubuntu1.2
|
||||
libxrender11:0.9.10-1
|
||||
libzstd11.3.3+dfsg-2ubuntu1
|
||||
locales2.27-3ubuntu1
|
||||
login1:4.5-1ubuntu2
|
||||
lsb-base9.20170808ubuntu1
|
||||
mawk1.3.3-17ubuntu3
|
||||
mime-support3.60ubuntu1
|
||||
mount2.31.1-0.4ubuntu3.3
|
||||
multiarch-support2.27-3ubuntu1
|
||||
ncurses-base6.1-1ubuntu1.18.04
|
||||
ncurses-bin6.1-1ubuntu1.18.04
|
||||
netpbm2:10.0-15.3build1
|
||||
openssl1.1.0g-2ubuntu4.3
|
||||
passwd1:4.5-1ubuntu2
|
||||
perl-base5.26.1-6ubuntu0.3
|
||||
poppler-data0.4.8-2
|
||||
procps2:3.3.12-3ubuntu1.1
|
||||
publicsuffix20180223.1310-1
|
||||
python2.7.15~rc1-1
|
||||
python2.72.7.15-4ubuntu4~18.04
|
||||
python2.7-minimal2.7.15-4ubuntu4~18.04
|
||||
python-minimal2.7.15~rc1-1
|
||||
readline-common7.0-3
|
||||
sed4.4-2
|
||||
sensible-utils0.0.12
|
||||
shared-mime-info1.9-2
|
||||
sysvinit-utils2.88dsf-59.10ubuntu1
|
||||
tar1.29b-2ubuntu0.1
|
||||
tzdata2019a-0ubuntu0.18.04
|
||||
ubuntu-keyring2018.09.18.1~18.04.0
|
||||
ucf3.0038
|
||||
util-linux2.31.1-0.4ubuntu3.3
|
||||
xdg-user-dirs0.17-1ubuntu1
|
||||
xz-utils5.2.2-1.3
|
||||
zlib1g1:1.2.11.dfsg-0ubuntu2
|
@ -2,75 +2,13 @@
|
||||
|
||||
# project information
|
||||
project_name: calibre-web
|
||||
project_url: "https://github.com/janeczku/calibre-web"
|
||||
project_logo: "https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/calibre-web-icon.png"
|
||||
project_lsio_github_repo_url: "https://github.com/linuxserver/docker-{{ project_name }}"
|
||||
project_blurb: |
|
||||
[{{ project_name|capitalize }}]({{ project_url }}) is a web app providing a clean interface for browsing, reading and downloading eBooks using an existing Calibre database. It is also possible to integrate google drive and edit metadata and your calibre library through the app itself.
|
||||
full_custom_readme: |
|
||||
{% raw -%}
|
||||
# Calibre - Docker mod for calibre-web
|
||||
|
||||
This software is a fork of library and licensed under the GPL v3 License.
|
||||
This mod adds the calibre binary to calibre-web (**x86-64 only**) for ebook conversions.
|
||||
|
||||
# supported architectures
|
||||
available_architectures:
|
||||
- { arch: "{{ arch_x86_64 }}", tag: "amd64-latest"}
|
||||
- { arch: "{{ arch_arm64 }}", tag: "arm64v8-latest"}
|
||||
- { arch: "{{ arch_armhf }}", tag: "arm32v7-latest"}
|
||||
In calibre-web docker arguments, set an environment variable `DOCKER_MODS=linuxserver/calibre-web:calibre` to enable.
|
||||
|
||||
# container parameters
|
||||
common_param_env_vars_enabled: true
|
||||
param_container_name: "{{ project_name }}"
|
||||
param_usage_include_env: true
|
||||
param_env_vars:
|
||||
- { env_var: "TZ", env_value: "Europe/London", desc: "Specify a timezone to use EG Europe/London." }
|
||||
param_usage_include_vols: true
|
||||
param_volumes:
|
||||
- { vol_path: "/config", vol_host_path: "<path to data>", desc: "Where calibre-web stores the internal database and config." }
|
||||
- { vol_path: "/books", vol_host_path: "<path to calibre library>", desc: "Where your calibre database is locate." }
|
||||
param_usage_include_ports: true
|
||||
param_ports:
|
||||
- { external_port: "8083", internal_port: "8083", port_desc: "WebUI" }
|
||||
|
||||
# optional container parameters
|
||||
opt_param_usage_include_env: false
|
||||
opt_param_usage_include_vols: false
|
||||
opt_param_usage_include_ports: false
|
||||
opt_param_device_map: false
|
||||
opt_cap_add_param: false
|
||||
optional_block_1: false
|
||||
|
||||
# application setup block
|
||||
app_setup_block_enabled: true
|
||||
app_setup_block: |
|
||||
Webui can be found at `http://your-ip:8083`
|
||||
|
||||
On the initial setup screen, enter `/books` as your calibre library location.
|
||||
|
||||
**Default admin login:**
|
||||
*Username:* admin
|
||||
*Password:* admin123
|
||||
|
||||
To reverse proxy with our Letsencrypt docker container use the following location block:
|
||||
```
|
||||
location /calibre-web {
|
||||
proxy_pass http://<your-ip>:8083;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Scheme $scheme;
|
||||
proxy_set_header X-Script-Name /calibre-web;
|
||||
}
|
||||
```
|
||||
|
||||
# changelog
|
||||
changelogs:
|
||||
- { date: "02.06.19:", desc: "Rebase to Ubuntu Bionic & add Gdrive support." }
|
||||
- { date: "23.03.19:", desc: "Switching to new Base images, shift to arm32v7 tag." }
|
||||
- { date: "23.02.19:", desc: "Rebase to alpine 3.9, use repo version of imagemagick." }
|
||||
- { date: "11.02.19:", desc: "Add pipeline logic and multi arch." }
|
||||
- { date: "03.01.19:", desc: "Remove guest user from default app.db." }
|
||||
- { date: "16.08.18:", desc: "Rebase to alpine 3.8." }
|
||||
- { date: "03.07.18:", desc: "New build pushed, all versions below `67` have [vulnerability](https://github.com/janeczku/calibre-web/issues/534)." }
|
||||
- { date: "05.01.18:", desc: "Deprecate cpu_core routine lack of scaling." }
|
||||
- { date: "06.12.17:", desc: "Rebase to alpine 3.7." }
|
||||
- { date: "27.11.17:", desc: "Use cpu core counting routine to speed up build time." }
|
||||
- { date: "24.07.17:", desc: "Curl version for imagemagick." }
|
||||
- { date: "17.07.17:", desc: "Initial release." }
|
||||
If adding multiple mods, enter them in an array separated by `|`, such as `DOCKER_MODS=linuxserver/calibre-web:calibre|linuxserver/mods:other-mod`
|
||||
{%- endraw %}
|
||||
|
Binary file not shown.
@ -1,38 +0,0 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
|
||||
# create symlinks for database and log
|
||||
[[ ! -f /config/app.db ]] && \
|
||||
cp /defaults/app.db /config/app.db
|
||||
[[ -f /app/calibre-web/app.db ]] && \
|
||||
rm /app/calibre-web/app.db
|
||||
[[ ! -L /app/calibre-web/app.db ]] && \
|
||||
ln -s /config/app.db /app/calibre-web/app.db
|
||||
|
||||
# create symlinks for log
|
||||
[[ ! -f /config/calibre-web.log ]] && \
|
||||
touch /config/calibre-web.log
|
||||
[[ -f /app/calibre-web/calibre-web.log ]] && \
|
||||
rm /app/calibre-web/calibre-web.log
|
||||
[[ ! -L /app/calibre-web/calibre-web.log ]] && \
|
||||
ln -s /config/calibre-web.log /app/calibre-web/calibre-web.log
|
||||
|
||||
# create Google drive client_secrets.json file
|
||||
[[ ! -f /config/client_secrets.json ]] && \
|
||||
echo "{}" > /config/client_secrets.json
|
||||
[[ -f /app/calibre-web/client_secrets.json ]] &&
|
||||
rm /app/calibre-web/client_secrets.json
|
||||
[[ ! -L /app/calibre-web/client_secrets.json ]] &&
|
||||
ln -s /config/client_secrets.json /app/calibre-web/client_secrets.json
|
||||
|
||||
# create Google drive symlinks for database
|
||||
[[ ! -f /config/gdrive.db ]] && \
|
||||
cp /app/calibre-web/gdrive.db /config/gdrive.db
|
||||
[[ -f /app/calibre-web/gdrive.db ]] && \
|
||||
rm /app/calibre-web/gdrive.db
|
||||
[[ ! -L /app/calibre-web/gdrive.db ]] && \
|
||||
ln -s /config/gdrive.db /app/calibre-web/gdrive.db
|
||||
|
||||
# permissions
|
||||
chown -R abc:abc \
|
||||
/config \
|
||||
/app/calibre-web
|
3
root/etc/cont-init.d/95-apt-get
Normal file
3
root/etc/cont-init.d/95-apt-get
Normal file
@ -0,0 +1,3 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
|
||||
apt-get update
|
14
root/etc/cont-init.d/98-calibre
Normal file
14
root/etc/cont-init.d/98-calibre
Normal file
@ -0,0 +1,14 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
|
||||
if [ ! -e /usr/bin/calibre-server ]; then
|
||||
/app/calibre/calibre_postinstall
|
||||
fi
|
||||
|
||||
if [ ! -L /usr/lib/x86_64-linux-gnu/libGL.so.1 ]; then
|
||||
apt-get install -y libgl1-mesa-glx
|
||||
fi
|
||||
|
||||
if [ ! -L /usr/lib/x86_64-linux-gnu/libxdamage.so.1 ]; then
|
||||
apt-get install -y libxdamage1
|
||||
fi
|
||||
|
@ -1,6 +0,0 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
|
||||
cd /app/calibre-web || exit
|
||||
|
||||
exec \
|
||||
s6-setuidgid abc python /app/calibre-web/cps.py
|
Loading…
Reference in New Issue
Block a user