Compare commits

...

21 Commits

Author SHA1 Message Date
LinuxServer-CI
be138a477d Bot Updating Package Versions 2020-01-27 21:06:46 +00:00
LinuxServer-CI
e447849063 Bot Updating Package Versions 2020-01-20 16:07:18 -05:00
LinuxServer-CI
6a67965fbd Bot Updating Package Versions 2019-12-16 22:08:38 +01:00
LinuxServer-CI
35c9202c62 Bot Updating Package Versions 2019-12-09 21:06:31 +00:00
LinuxServer-CI
3e4e9c9a93 Bot Updating Templated Files 2019-12-02 21:05:48 +00:00
LinuxServer-CI
fb8ac56832 Bot Updating Package Versions 2019-11-25 16:06:16 -05:00
LinuxServer-CI
67730f209c Bot Updating Package Versions 2019-11-04 22:07:41 +01:00
LinuxServer-CI
92d78454c4 Bot Updating Templated Files 2019-11-04 22:05:48 +01:00
LinuxServer-CI
34b26c56c7 Bot Updating Package Versions 2019-10-21 16:06:33 -04:00
LinuxServer-CI
b4dc85eef0 Bot Updating Package Versions 2019-10-14 16:07:47 -04:00
LinuxServer-CI
8655d63538 Bot Updating Package Versions 2019-10-10 10:35:02 -04:00
aptalca
2fd1e8b457 fix formatting 2019-10-10 07:33:13 -07:00
aptalca
1a822f0c81 disable updates 2019-10-10 07:33:13 -07:00
LinuxServer-CI
99ba918570 Bot Updating Package Versions 2019-10-07 21:09:02 +01:00
LinuxServer-CI
f06dca6272 Bot Updating Templated Files 2019-10-07 21:07:34 +01:00
LinuxServer-CI
a629cfb790 Bot Updating Templated Files 2019-10-07 16:06:43 -04:00
chbmb
732b1ca922
Merge pull request #10 from linuxserver/telemetry
disable telemetry
2019-09-23 20:13:26 +01:00
aptalca
c1faf7ecbe disable telemetry 2019-09-23 15:06:37 -04:00
aptalca
35b8e16e5f fix arguments for v2 2019-09-22 21:47:48 -07:00
LinuxServer-CI
ed4efdca09 Bot Updating Package Versions 2019-09-18 22:32:53 +01:00
aptalca
6bf1eb5d73 create development builds 2019-09-18 14:31:19 -07:00
9 changed files with 295 additions and 171 deletions

View File

@ -1,21 +1,34 @@
<!--- Provide a general summary of the issue in the Title above -->
[linuxserverurl]: https://linuxserver.io [linuxserverurl]: https://linuxserver.io
[![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)][linuxserverurl] [![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 you have an issue with the project, please provide us with the following information --> <!--- Provide a general summary of the issue in the Title above -->
<!--- 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. -->
## Expected Behavior
<!--- Tell us what should happen -->
<!--- If you have a suggestion or fix for the project, please provide us with the following information --> ## Current Behavior
<!--- Tell us what happens instead of the expected behavior -->
<!--- What you think your suggestion brings to the project, or fixes with the project --> ## Steps to Reproduce
<!--- If it's a fix, would it be better suited as a Pull request to the repo ? --> <!--- 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.
## Thanks, team linuxserver.io ## Environment
**OS:**
**CPU architecture:** x86_64/arm32/arm64
**How docker service was installed:**
<!--- 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 code-server" -->

View File

@ -6,10 +6,34 @@
<!--- Before submitting a pull request please check the following --> <!--- 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 or documentation in 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 --> <!--- 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 --> <!--- 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 -->
------------------------------
We welcome all PRs though this doesnt 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 -->

View File

@ -14,17 +14,18 @@ RUN \
apt-get update && \ apt-get update && \
apt-get install -y \ apt-get install -y \
git \ git \
jq \
nano \ nano \
net-tools \ net-tools \
sudo && \ sudo && \
echo "**** install code-server ****" && \ echo "**** install code-server ****" && \
if [ -z ${CODE_RELEASE+x} ]; then \ if [ -z ${CODE_RELEASE+x} ]; then \
CODE_RELEASE=$(curl -sX GET "https://api.github.com/repos/cdr/code-server/releases/latest" \ CODE_RELEASE=$(curl -sX GET "https://api.github.com/repos/cdr/code-server/releases" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \ | jq -r 'first(.[] | select(.prerelease == true)) | .tag_name'); \
fi && \ fi && \
curl -o \ curl -o \
/tmp/code.tar.gz -L \ /tmp/code.tar.gz -L \
"https://github.com/cdr/code-server/releases/download/${CODE_RELEASE}/code-server${CODE_RELEASE}-linux-x64.tar.gz" && \ "https://github.com/cdr/code-server/releases/download/${CODE_RELEASE}/code-server${CODE_RELEASE}-linux-x86_64.tar.gz" && \
tar xzf /tmp/code.tar.gz -C \ tar xzf /tmp/code.tar.gz -C \
/usr/bin/ --strip-components=1 \ /usr/bin/ --strip-components=1 \
--wildcards code-server*/code-server && \ --wildcards code-server*/code-server && \

268
Jenkinsfile vendored
View File

@ -2,6 +2,10 @@ pipeline {
agent { agent {
label 'X86-64-MULTI' label 'X86-64-MULTI'
} }
options {
buildDiscarder(logRotator(numToKeepStr: '10', daysToKeepStr: '60'))
parallelsAlwaysFailFast()
}
// Input to determine if this is a package check // Input to determine if this is a package check
parameters { parameters {
string(defaultValue: 'false', description: 'package check run', name: 'PACKAGE_CHECK') string(defaultValue: 'false', description: 'package check run', name: 'PACKAGE_CHECK')
@ -10,9 +14,10 @@ pipeline {
environment { environment {
BUILDS_DISCORD=credentials('build_webhook_url') BUILDS_DISCORD=credentials('build_webhook_url')
GITHUB_TOKEN=credentials('498b4638-2d02-4ce5-832d-8a57d01d97ab') GITHUB_TOKEN=credentials('498b4638-2d02-4ce5-832d-8a57d01d97ab')
EXT_GIT_BRANCH = 'master' GITLAB_TOKEN=credentials('b6f0f1dd-6952-4cf6-95d1-9c06380283f0')
EXT_USER = 'cdr' GITLAB_NAMESPACE=credentials('gitlab-namespace-id')
EXT_REPO = 'code-server' JSON_URL = 'https://api.github.com/repos/cdr/code-server/releases'
JSON_PATH = 'first(.[] | select(.prerelease == true)) | .tag_name'
CONTAINER_NAME = 'code-server' CONTAINER_NAME = 'code-server'
BUILD_VERSION_ARG = 'CODE_RELEASE' BUILD_VERSION_ARG = 'CODE_RELEASE'
LS_USER = 'linuxserver' LS_USER = 'linuxserver'
@ -38,7 +43,7 @@ pipeline {
script{ script{
env.EXIT_STATUS = '' env.EXIT_STATUS = ''
env.LS_RELEASE = sh( 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 alexeiled/skopeo sh -c 'skopeo inspect docker://docker.io/'${DOCKERHUB_IMAGE}':development 2>/dev/null' | jq -r '.Labels.build_version' | awk '{print $3}' | grep '\\-ls' || : ''',
returnStdout: true).trim() returnStdout: true).trim()
env.LS_RELEASE_NOTES = sh( 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' ''', 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,22 +57,7 @@ pipeline {
env.CODE_URL = 'https://github.com/' + env.LS_USER + '/' + env.LS_REPO + '/commit/' + env.GIT_COMMIT 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.DOCKERHUB_LINK = 'https://hub.docker.com/r/' + env.DOCKERHUB_IMAGE + '/tags/'
env.PULL_REQUEST = env.CHANGE_ID env.PULL_REQUEST = env.CHANGE_ID
env.LICENSE_TAG = sh( env.TEMPLATED_FILES = 'Jenkinsfile README.md LICENSE ./.github/FUNDING.yml ./.github/ISSUE_TEMPLATE.md ./.github/PULL_REQUEST_TEMPLATE.md'
script: '''#!/bin/bash
if [ -e LICENSE ] ; then
cat LICENSE | md5sum | cut -c1-8
else
echo none
fi''',
returnStdout: true).trim()
env.FUNDING_TAG = sh(
script: '''#!/bin/bash
if [ -e ./.github/FUNDING.yml ] ; then
cat ./.github/FUNDING.yml | md5sum | cut -c1-8
else
echo none
fi''',
returnStdout: true).trim()
} }
script{ script{
env.LS_RELEASE_NUMBER = sh( env.LS_RELEASE_NUMBER = sh(
@ -110,21 +100,14 @@ pipeline {
/* ######################## /* ########################
External Release Tagging External Release Tagging
######################## */ ######################## */
// If this is a stable github release use the latest endpoint from github to determine the ext tag // If this is a custom json endpoint parse the return to get external tag
stage("Set ENV github_stable"){ stage("Set ENV custom_json"){
steps{ steps{
script{ script{
env.EXT_RELEASE = sh( env.EXT_RELEASE = sh(
script: '''curl -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases/latest | jq -r '. | .tag_name' ''', script: '''curl -s ${JSON_URL} | jq -r ". | ${JSON_PATH}" ''',
returnStdout: true).trim() returnStdout: true).trim()
} env.RELEASE_LINK = env.JSON_URL
}
}
// If this is a stable or devel github release generate the link for the build message
stage("Set ENV github_link"){
steps{
script{
env.RELEASE_LINK = 'https://github.com/' + env.EXT_USER + '/' + env.EXT_REPO + '/releases/tag/' + env.EXT_RELEASE
} }
} }
} }
@ -138,15 +121,18 @@ pipeline {
} }
} }
} }
// If this is a master build use live docker endpoints // If this is a development build use live docker endpoints
stage("Set ENV live build"){ stage("Set ENV live build"){
when { when {
branch "master" branch "development"
environment name: 'CHANGE_ID', value: '' environment name: 'CHANGE_ID', value: ''
} }
steps { steps {
script{ script{
env.IMAGE = env.DOCKERHUB_IMAGE env.IMAGE = env.DOCKERHUB_IMAGE
env.QUAYIMAGE = 'quay.io/linuxserver.io/' + env.CONTAINER_NAME
env.GITHUBIMAGE = 'docker.pkg.github.com/' + env.LS_USER + '/' + env.LS_REPO + '/' + env.CONTAINER_NAME
env.GITLABIMAGE = 'registry.gitlab.com/linuxserver.io/' + env.LS_REPO + '/' + env.CONTAINER_NAME
if (env.MULTIARCH == 'true') { 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-' + 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
} else { } else {
@ -159,12 +145,15 @@ pipeline {
// If this is a dev build use dev docker endpoints // If this is a dev build use dev docker endpoints
stage("Set ENV dev build"){ stage("Set ENV dev build"){
when { when {
not {branch "master"} not {branch "development"}
environment name: 'CHANGE_ID', value: '' environment name: 'CHANGE_ID', value: ''
} }
steps { steps {
script{ script{
env.IMAGE = env.DEV_DOCKERHUB_IMAGE env.IMAGE = env.DEV_DOCKERHUB_IMAGE
env.QUAYIMAGE = 'quay.io/linuxserver.io/lsiodev-' + env.CONTAINER_NAME
env.GITHUBIMAGE = 'docker.pkg.github.com/' + env.LS_USER + '/' + env.LS_REPO + '/lsiodev-' + env.CONTAINER_NAME
env.GITLABIMAGE = 'registry.gitlab.com/linuxserver.io/' + env.LS_REPO + '/lsiodev-' + env.CONTAINER_NAME
if (env.MULTIARCH == 'true') { 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-' + 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
} else { } else {
@ -183,6 +172,9 @@ pipeline {
steps { steps {
script{ script{
env.IMAGE = env.PR_DOCKERHUB_IMAGE env.IMAGE = env.PR_DOCKERHUB_IMAGE
env.QUAYIMAGE = 'quay.io/linuxserver.io/lspipepr-' + env.CONTAINER_NAME
env.GITHUBIMAGE = 'docker.pkg.github.com/' + env.LS_USER + '/' + env.LS_REPO + '/lspipepr-' + env.CONTAINER_NAME
env.GITLABIMAGE = 'registry.gitlab.com/linuxserver.io/' + env.LS_REPO + '/lspipepr-' + env.CONTAINER_NAME
if (env.MULTIARCH == 'true') { 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-' + 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
} else { } else {
@ -226,7 +218,7 @@ pipeline {
// Use helper containers to render templated files // Use helper containers to render templated files
stage('Update-Templates') { stage('Update-Templates') {
when { when {
branch "master" branch "development"
environment name: 'CHANGE_ID', value: '' environment name: 'CHANGE_ID', value: ''
expression { expression {
env.CONTAINER_NAME != null env.CONTAINER_NAME != null
@ -237,36 +229,33 @@ pipeline {
set -e set -e
TEMPDIR=$(mktemp -d) TEMPDIR=$(mktemp -d)
docker pull linuxserver/jenkins-builder:latest 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 run --rm -e CONTAINER_NAME=${CONTAINER_NAME} -e GITHUB_BRANCH=development -v ${TEMPDIR}:/ansible/jenkins linuxserver/jenkins-builder:latest
docker pull linuxserver/doc-builder:latest CURRENTHASH=$(grep -hs ^ ${TEMPLATED_FILES} | md5sum | cut -c1-8)
docker run --rm -e CONTAINER_NAME=${CONTAINER_NAME} -e GITHUB_BRANCH=master -v ${TEMPDIR}:/ansible/readme linuxserver/doc-builder:latest cd ${TEMPDIR}/docker-${CONTAINER_NAME}
if [ "$(md5sum ${TEMPDIR}/${LS_REPO}/Jenkinsfile | awk '{ print $1 }')" != "$(md5sum Jenkinsfile | awk '{ print $1 }')" ] || \ NEWHASH=$(grep -hs ^ ${TEMPLATED_FILES} | md5sum | cut -c1-8)
[ "$(md5sum ${TEMPDIR}/${CONTAINER_NAME}/README.md | awk '{ print $1 }')" != "$(md5sum README.md | awk '{ print $1 }')" ] || \ if [[ "${CURRENTHASH}" != "${NEWHASH}" ]]; then
[ "$(cat ${TEMPDIR}/${LS_REPO}/LICENSE | md5sum | cut -c1-8)" != "${LICENSE_TAG}" ] || \
[ "$(cat ${TEMPDIR}/${LS_REPO}/.github/FUNDING.yml | md5sum | cut -c1-8)" != "${FUNDING_TAG}" ]; then
mkdir -p ${TEMPDIR}/repo mkdir -p ${TEMPDIR}/repo
git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_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 cd ${TEMPDIR}/repo/${LS_REPO}
cp ${TEMPDIR}/${CONTAINER_NAME}/README.md ${TEMPDIR}/repo/${LS_REPO}/ git checkout -f development
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/Jenkinsfile ${TEMPDIR}/repo/${LS_REPO}/ cd ${TEMPDIR}/docker-${CONTAINER_NAME}
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/LICENSE ${TEMPDIR}/repo/${LS_REPO}/
mkdir -p ${TEMPDIR}/repo/${LS_REPO}/.github mkdir -p ${TEMPDIR}/repo/${LS_REPO}/.github
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.github/FUNDING.yml ${TEMPDIR}/repo/${LS_REPO}/.github/FUNDING.yml cp --parents ${TEMPLATED_FILES} ${TEMPDIR}/repo/${LS_REPO}/
cd ${TEMPDIR}/repo/${LS_REPO}/ cd ${TEMPDIR}/repo/${LS_REPO}/
git --git-dir ${TEMPDIR}/repo/${LS_REPO}/.git add Jenkinsfile README.md LICENSE ./.github/FUNDING.yml git add ${TEMPLATED_FILES}
git --git-dir ${TEMPDIR}/repo/${LS_REPO}/.git commit -m 'Bot Updating Templated Files' 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 git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git --all
echo "true" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER} echo "true" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER}
else else
echo "false" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER} echo "false" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER}
fi fi
mkdir -p ${TEMPDIR}/gitbook mkdir -p ${TEMPDIR}/gitbook
git clone https://github.com/linuxserver/docker-documentation.git ${TEMPDIR}/gitbook/docker-documentation 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 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}/docker-${CONTAINER_NAME}/docker-${CONTAINER_NAME}.md | awk '{ print $1 }')") ]]; then
cp ${TEMPDIR}/${CONTAINER_NAME}/docker-${CONTAINER_NAME}.md ${TEMPDIR}/gitbook/docker-documentation/images/ cp ${TEMPDIR}/docker-${CONTAINER_NAME}/docker-${CONTAINER_NAME}.md ${TEMPDIR}/gitbook/docker-documentation/images/
cd ${TEMPDIR}/gitbook/docker-documentation/ cd ${TEMPDIR}/gitbook/docker-documentation/
git add images/docker-${CONTAINER_NAME}.md 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 git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/docker-documentation.git --all
fi fi
rm -Rf ${TEMPDIR}''' rm -Rf ${TEMPDIR}'''
@ -280,7 +269,7 @@ pipeline {
// Exit the build if the Templated files were just updated // Exit the build if the Templated files were just updated
stage('Template-exit') { stage('Template-exit') {
when { when {
branch "master" branch "development"
environment name: 'CHANGE_ID', value: '' environment name: 'CHANGE_ID', value: ''
environment name: 'FILES_UPDATED', value: 'true' environment name: 'FILES_UPDATED', value: 'true'
expression { expression {
@ -293,6 +282,26 @@ 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"}' '''
}
}
/* ############### /* ###############
Build Container Build Container
############### */ ############### */
@ -379,7 +388,7 @@ pipeline {
// Take the image we just built and dump package versions for comparison // Take the image we just built and dump package versions for comparison
stage('Update-packages') { stage('Update-packages') {
when { when {
branch "master" branch "development"
environment name: 'CHANGE_ID', value: '' environment name: 'CHANGE_ID', value: ''
environment name: 'EXIT_STATUS', value: '' environment name: 'EXIT_STATUS', value: ''
} }
@ -407,7 +416,7 @@ pipeline {
echo "Package tag sha from current packages in buit container is ${NEW_PACKAGE_TAG} comparing to old ${PACKAGE_TAG} from github" 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 if [ "${NEW_PACKAGE_TAG}" != "${PACKAGE_TAG}" ]; then
git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/${LS_REPO} git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/${LS_REPO}
git --git-dir ${TEMPDIR}/${LS_REPO}/.git checkout -f master git --git-dir ${TEMPDIR}/${LS_REPO}/.git checkout -f development
cp ${TEMPDIR}/package_versions.txt ${TEMPDIR}/${LS_REPO}/ cp ${TEMPDIR}/package_versions.txt ${TEMPDIR}/${LS_REPO}/
cd ${TEMPDIR}/${LS_REPO}/ cd ${TEMPDIR}/${LS_REPO}/
wait wait
@ -431,7 +440,7 @@ pipeline {
// Exit the build if the package file was just updated // Exit the build if the package file was just updated
stage('PACKAGE-exit') { stage('PACKAGE-exit') {
when { when {
branch "master" branch "development"
environment name: 'CHANGE_ID', value: '' environment name: 'CHANGE_ID', value: ''
environment name: 'PACKAGE_UPDATED', value: 'true' environment name: 'PACKAGE_UPDATED', value: 'true'
environment name: 'EXIT_STATUS', value: '' environment name: 'EXIT_STATUS', value: ''
@ -445,7 +454,7 @@ pipeline {
// Exit the build if this is just a package check and there are no changes to push // Exit the build if this is just a package check and there are no changes to push
stage('PACKAGECHECK-exit') { stage('PACKAGECHECK-exit') {
when { when {
branch "master" branch "development"
environment name: 'CHANGE_ID', value: '' environment name: 'CHANGE_ID', value: ''
environment name: 'PACKAGE_UPDATED', value: 'false' environment name: 'PACKAGE_UPDATED', value: 'false'
environment name: 'EXIT_STATUS', value: '' environment name: 'EXIT_STATUS', value: ''
@ -524,19 +533,32 @@ pipeline {
credentialsId: '3f9ba4d5-100d-45b0-a3c4-633fd6061207', credentialsId: '3f9ba4d5-100d-45b0-a3c4-633fd6061207',
usernameVariable: 'DOCKERUSER', usernameVariable: 'DOCKERUSER',
passwordVariable: 'DOCKERPASS' passwordVariable: 'DOCKERPASS'
],
[
$class: 'UsernamePasswordMultiBinding',
credentialsId: 'Quay.io-Robot',
usernameVariable: 'QUAYUSER',
passwordVariable: 'QUAYPASS'
] ]
]) { ]) {
echo 'Logging into DockerHub'
sh '''#! /bin/bash sh '''#! /bin/bash
set -e
echo $QUAYPASS | docker login quay.io -u $QUAYUSER --password-stdin
echo $DOCKERPASS | docker login -u $DOCKERUSER --password-stdin echo $DOCKERPASS | docker login -u $DOCKERUSER --password-stdin
echo $GITHUB_TOKEN | docker login docker.pkg.github.com -u LinuxServer-CI --password-stdin
echo $GITLAB_TOKEN | docker login registry.gitlab.com -u LinuxServer.io --password-stdin
for PUSHIMAGE in "${QUAYIMAGE}" "${GITHUBIMAGE}" "${GITLABIMAGE}" "${IMAGE}"; do
docker tag ${IMAGE}:${META_TAG} ${PUSHIMAGE}:${META_TAG}
docker tag ${PUSHIMAGE}:${META_TAG} ${PUSHIMAGE}:development
docker push ${PUSHIMAGE}:development
docker push ${PUSHIMAGE}:${META_TAG}
done
for DELETEIMAGE in "${QUAYIMAGE}" "${GITHUBIMAGE}" "{GITLABIMAGE}" "${IMAGE}"; do
docker rmi \
${DELETEIMAGE}:${META_TAG} \
${DELETEIMAGE}:development || :
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 || :'''
} }
} }
} }
@ -553,53 +575,88 @@ pipeline {
credentialsId: '3f9ba4d5-100d-45b0-a3c4-633fd6061207', credentialsId: '3f9ba4d5-100d-45b0-a3c4-633fd6061207',
usernameVariable: 'DOCKERUSER', usernameVariable: 'DOCKERUSER',
passwordVariable: 'DOCKERPASS' passwordVariable: 'DOCKERPASS'
],
[
$class: 'UsernamePasswordMultiBinding',
credentialsId: 'Quay.io-Robot',
usernameVariable: 'QUAYUSER',
passwordVariable: 'QUAYPASS'
] ]
]) { ]) {
sh '''#! /bin/bash sh '''#! /bin/bash
set -e
echo $QUAYPASS | docker login quay.io -u $QUAYUSER --password-stdin
echo $DOCKERPASS | docker login -u $DOCKERUSER --password-stdin echo $DOCKERPASS | docker login -u $DOCKERUSER --password-stdin
''' echo $GITHUB_TOKEN | docker login docker.pkg.github.com -u LinuxServer-CI --password-stdin
sh '''#! /bin/bash echo $GITLAB_TOKEN | docker login registry.gitlab.com -u LinuxServer.io --password-stdin
if [ "${CI}" == "false" ]; then if [ "${CI}" == "false" ]; then
docker pull lsiodev/buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER} docker pull lsiodev/buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER}
docker pull lsiodev/buildcache:arm64v8-${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:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER} ${IMAGE}:arm32v7-${META_TAG}
docker tag lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} ${IMAGE}:arm64v8-${META_TAG} docker tag lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} ${IMAGE}:arm64v8-${META_TAG}
fi''' fi
sh "docker tag ${IMAGE}:amd64-${META_TAG} ${IMAGE}:amd64-latest" for MANIFESTIMAGE in "${IMAGE}" "${GITLABIMAGE}"; do
sh "docker tag ${IMAGE}:arm32v7-${META_TAG} ${IMAGE}:arm32v7-latest" docker tag ${IMAGE}:amd64-${META_TAG} ${MANIFESTIMAGE}:amd64-${META_TAG}
sh "docker tag ${IMAGE}:arm64v8-${META_TAG} ${IMAGE}:arm64v8-latest" docker tag ${IMAGE}:arm32v7-${META_TAG} ${MANIFESTIMAGE}:arm32v7-${META_TAG}
sh "docker push ${IMAGE}:amd64-${META_TAG}" docker tag ${IMAGE}:arm64v8-${META_TAG} ${MANIFESTIMAGE}:arm64v8-${META_TAG}
sh "docker push ${IMAGE}:arm32v7-${META_TAG}" docker tag ${MANIFESTIMAGE}:amd64-${META_TAG} ${MANIFESTIMAGE}:amd64-development
sh "docker push ${IMAGE}:arm64v8-${META_TAG}" docker tag ${MANIFESTIMAGE}:arm32v7-${META_TAG} ${MANIFESTIMAGE}:arm32v7-development
sh "docker push ${IMAGE}:amd64-latest" docker tag ${MANIFESTIMAGE}:arm64v8-${META_TAG} ${MANIFESTIMAGE}:arm64v8-development
sh "docker push ${IMAGE}:arm32v7-latest" docker push ${MANIFESTIMAGE}:amd64-${META_TAG}
sh "docker push ${IMAGE}:arm64v8-latest" docker push ${MANIFESTIMAGE}:arm32v7-${META_TAG}
sh "docker manifest push --purge ${IMAGE}:latest || :" docker push ${MANIFESTIMAGE}:arm64v8-${META_TAG}
sh "docker manifest create ${IMAGE}:latest ${IMAGE}:amd64-latest ${IMAGE}:arm32v7-latest ${IMAGE}:arm64v8-latest" docker push ${MANIFESTIMAGE}:amd64-development
sh "docker manifest annotate ${IMAGE}:latest ${IMAGE}:arm32v7-latest --os linux --arch arm" docker push ${MANIFESTIMAGE}:arm32v7-development
sh "docker manifest annotate ${IMAGE}:latest ${IMAGE}:arm64v8-latest --os linux --arch arm64 --variant v8" docker push ${MANIFESTIMAGE}:arm64v8-development
sh "docker manifest push --purge ${IMAGE}:${META_TAG} || :" docker manifest push --purge ${MANIFESTIMAGE}:development || :
sh "docker manifest create ${IMAGE}:${META_TAG} ${IMAGE}:amd64-${META_TAG} ${IMAGE}:arm32v7-${META_TAG} ${IMAGE}:arm64v8-${META_TAG}" docker manifest create ${MANIFESTIMAGE}:development ${MANIFESTIMAGE}:amd64-development ${MANIFESTIMAGE}:arm32v7-development ${MANIFESTIMAGE}:arm64v8-development
sh "docker manifest annotate ${IMAGE}:${META_TAG} ${IMAGE}:arm32v7-${META_TAG} --os linux --arch arm" docker manifest annotate ${MANIFESTIMAGE}:development ${MANIFESTIMAGE}:arm32v7-development --os linux --arch arm
sh "docker manifest annotate ${IMAGE}:${META_TAG} ${IMAGE}:arm64v8-${META_TAG} --os linux --arch arm64 --variant v8" docker manifest annotate ${MANIFESTIMAGE}:development ${MANIFESTIMAGE}:arm64v8-development --os linux --arch arm64 --variant v8
sh "docker manifest push --purge ${IMAGE}:latest" docker manifest push --purge ${MANIFESTIMAGE}:${META_TAG} || :
sh "docker manifest push --purge ${IMAGE}:${META_TAG}" docker manifest create ${MANIFESTIMAGE}:${META_TAG} ${MANIFESTIMAGE}:amd64-${META_TAG} ${MANIFESTIMAGE}:arm32v7-${META_TAG} ${MANIFESTIMAGE}:arm64v8-${META_TAG}
sh '''docker rmi \ docker manifest annotate ${MANIFESTIMAGE}:${META_TAG} ${MANIFESTIMAGE}:arm32v7-${META_TAG} --os linux --arch arm
${IMAGE}:amd64-${META_TAG} \ docker manifest annotate ${MANIFESTIMAGE}:${META_TAG} ${MANIFESTIMAGE}:arm64v8-${META_TAG} --os linux --arch arm64 --variant v8
${IMAGE}:amd64-latest \ docker manifest push --purge ${MANIFESTIMAGE}:development
${IMAGE}:arm32v7-${META_TAG} \ docker manifest push --purge ${MANIFESTIMAGE}:${META_TAG}
${IMAGE}:arm32v7-latest \ done
${IMAGE}:arm64v8-${META_TAG} \ for LEGACYIMAGE in "${GITHUBIMAGE}" "${QUAYIMAGE}"; do
${IMAGE}:arm64v8-latest \ docker tag ${IMAGE}:amd64-${META_TAG} ${LEGACYIMAGE}:amd64-${META_TAG}
docker tag ${IMAGE}:arm32v7-${META_TAG} ${LEGACYIMAGE}:arm32v7-${META_TAG}
docker tag ${IMAGE}:arm64v8-${META_TAG} ${LEGACYIMAGE}:arm64v8-${META_TAG}
docker tag ${LEGACYIMAGE}:amd64-${META_TAG} ${LEGACYIMAGE}:development
docker tag ${LEGACYIMAGE}:amd64-${META_TAG} ${LEGACYIMAGE}:${META_TAG}
docker tag ${LEGACYIMAGE}:arm32v7-${META_TAG} ${LEGACYIMAGE}:arm32v7-development
docker tag ${LEGACYIMAGE}:arm64v8-${META_TAG} ${LEGACYIMAGE}:arm64v8-development
docker push ${LEGACYIMAGE}:amd64-${META_TAG}
docker push ${LEGACYIMAGE}:arm32v7-${META_TAG}
docker push ${LEGACYIMAGE}:arm64v8-${META_TAG}
docker push ${LEGACYIMAGE}:development
docker push ${LEGACYIMAGE}:${META_TAG}
docker push ${LEGACYIMAGE}:arm32v7-development
docker push ${LEGACYIMAGE}:arm64v8-development
done
'''
sh '''#! /bin/bash
for DELETEIMAGE in "${QUAYIMAGE}" "${GITHUBIMAGE}" "${GITLABIMAGE}" "${IMAGE}"; do
docker rmi \
${DELETEIMAGE}:amd64-${META_TAG} \
${DELETEIMAGE}:amd64-development \
${DELETEIMAGE}:arm32v7-${META_TAG} \
${DELETEIMAGE}:arm32v7-development \
${DELETEIMAGE}:arm64v8-${META_TAG} \
${DELETEIMAGE}:arm64v8-development || :
done
docker rmi \
lsiodev/buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER} \ lsiodev/buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER} \
lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} || :''' lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} || :
'''
} }
} }
} }
// If this is a public release tag it in the LS Github // If this is a public release tag it in the LS Github
stage('Github-Tag-Push-Release') { stage('Github-Tag-Push-Release') {
when { when {
branch "master" branch "development"
expression { expression {
env.LS_RELEASE != env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER env.LS_RELEASE != env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER
} }
@ -611,17 +668,17 @@ pipeline {
sh '''curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/git/tags \ 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":"'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\
"object": "'${COMMIT_SHA}'",\ "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 development",\
"type": "commit",\ "type": "commit",\
"tagger": {"name": "LinuxServer Jenkins","email": "jenkins@linuxserver.io","date": "'${GITHUB_DATE}'"}}' ''' "tagger": {"name": "LinuxServer Jenkins","email": "jenkins@linuxserver.io","date": "'${GITHUB_DATE}'"}}' '''
echo "Pushing New release for Tag" echo "Pushing New release for Tag"
sh '''#! /bin/bash sh '''#! /bin/bash
curl -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases/latest | jq '. |.body' | sed 's:^.\\(.*\\).$:\\1:' > releasebody.json echo "Data change at JSON endpoint ${JSON_URL}" > releasebody.json
echo '{"tag_name":"'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\ echo '{"tag_name":"'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\
"target_commitish": "master",\ "target_commitish": "development",\
"name": "'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\ "name": "'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\
"body": "**LinuxServer Changes:**\\n\\n'${LS_RELEASE_NOTES}'\\n**'${EXT_REPO}' Changes:**\\n\\n' > start "body": "**LinuxServer Changes:**\\n\\n'${LS_RELEASE_NOTES}'\\n**Remote Changes:**\\n\\n' > start
printf '","draft": false,"prerelease": false}' >> releasebody.json printf '","draft": false,"prerelease": true}' >> releasebody.json
paste -d'\\0' start releasebody.json > releasebody.json.done 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''' curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/releases -d @releasebody.json.done'''
} }
@ -676,16 +733,19 @@ pipeline {
sh 'echo "build aborted"' sh 'echo "build aborted"'
} }
else if (currentBuild.currentResult == "SUCCESS"){ 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"}],\ "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} ''' "username": "Jenkins"}' ${BUILDS_DISCORD} '''
} }
else { 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"}],\ "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} ''' "username": "Jenkins"}' ${BUILDS_DISCORD} '''
} }
} }
} }
cleanup {
cleanWs()
}
} }
} }

View File

@ -4,8 +4,8 @@
[![Discord](https://img.shields.io/discord/354974912613449730.svg?style=flat-square&color=E68523&label=Discord&logo=discord&logoColor=FFFFFF)](https://discord.gg/YWrKVTn "realtime support / chat with the community and the team.") [![Discord](https://img.shields.io/discord/354974912613449730.svg?style=flat-square&color=E68523&label=Discord&logo=discord&logoColor=FFFFFF)](https://discord.gg/YWrKVTn "realtime support / chat with the community and the team.")
[![Discourse](https://img.shields.io/discourse/https/discourse.linuxserver.io/topics.svg?style=flat-square&color=E68523&logo=discourse&logoColor=FFFFFF)](https://discourse.linuxserver.io "post on our community forum.") [![Discourse](https://img.shields.io/discourse/https/discourse.linuxserver.io/topics.svg?style=flat-square&color=E68523&logo=discourse&logoColor=FFFFFF)](https://discourse.linuxserver.io "post on our community forum.")
[![Fleet](https://img.shields.io/static/v1.svg?style=flat-square&color=E68523&label=linuxserver.io&message=Fleet)](https://fleet.linuxserver.io "an online web interface which displays all of our maintained images.") [![Fleet](https://img.shields.io/static/v1.svg?style=flat-square&color=E68523&label=linuxserver.io&message=Fleet)](https://fleet.linuxserver.io "an online web interface which displays all of our maintained images.")
[![Podcast](https://img.shields.io/static/v1.svg?style=flat-square&color=E68523&label=linuxserver.io&message=Podcast)](https://anchor.fm/linuxserverio "on hiatus. Coming back soon (late 2018).") [![GitHub](https://img.shields.io/static/v1.svg?style=flat-square&color=E68523&label=linuxserver.io&message=GitHub&logo=github&logoColor=FFFFFF)](https://github.com/linuxserver "view the source for all of our repositories.")
[![Open Collective](https://img.shields.io/opencollective/all/linuxserver.svg?style=flat-square&color=E68523&label=Open%20Collective%20Supporters)](https://opencollective.com/linuxserver "please consider helping us by either donating or contributing to our budget") [![Open Collective](https://img.shields.io/opencollective/all/linuxserver.svg?style=flat-square&color=E68523&label=Supporters&logo=open%20collective&logoColor=FFFFFF)](https://opencollective.com/linuxserver "please consider helping us by either donating or contributing to our budget")
The [LinuxServer.io](https://linuxserver.io) team brings you another container release featuring :- The [LinuxServer.io](https://linuxserver.io) team brings you another container release featuring :-
@ -20,15 +20,19 @@ Find us at:
* [Discord](https://discord.gg/YWrKVTn) - realtime support / chat with the community and the team. * [Discord](https://discord.gg/YWrKVTn) - realtime support / chat with the community and the team.
* [Discourse](https://discourse.linuxserver.io) - post on our community forum. * [Discourse](https://discourse.linuxserver.io) - post on our community forum.
* [Fleet](https://fleet.linuxserver.io) - an online web interface which displays all of our maintained images. * [Fleet](https://fleet.linuxserver.io) - an online web interface which displays all of our maintained images.
* [Podcast](https://anchor.fm/linuxserverio) - on hiatus. Coming back soon (late 2018). * [GitHub](https://github.com/linuxserver) - view the source for all of our repositories.
* [Open Collective](https://opencollective.com/linuxserver) - please consider helping us by either donating or contributing to our budget * [Open Collective](https://opencollective.com/linuxserver) - please consider helping us by either donating or contributing to our budget
# [linuxserver/code-server](https://github.com/linuxserver/docker-code-server) # [linuxserver/code-server](https://github.com/linuxserver/docker-code-server)
[![GitHub Release](https://img.shields.io/github/release/linuxserver/docker-code-server.svg?style=flat-square&color=E68523)](https://github.com/linuxserver/docker-code-server/releases)
[![GitHub Stars](https://img.shields.io/github/stars/linuxserver/docker-code-server.svg?style=flat-square&color=E68523&logo=github&logoColor=FFFFFF)](https://github.com/linuxserver/docker-code-server)
[![GitHub Release](https://img.shields.io/github/release/linuxserver/docker-code-server.svg?style=flat-square&color=E68523&logo=github&logoColor=FFFFFF)](https://github.com/linuxserver/docker-code-server/releases)
[![GitHub Package Repository](https://img.shields.io/static/v1.svg?style=flat-square&color=E68523&label=linuxserver.io&message=GitHub%20Package&logo=github&logoColor=FFFFFF)](https://github.com/linuxserver/docker-code-server/packages)
[![GitLab Container Registry](https://img.shields.io/static/v1.svg?style=flat-square&color=E68523&label=linuxserver.io&message=GitLab%20Registry&logo=gitlab&logoColor=FFFFFF)](https://gitlab.com/Linuxserver.io/docker-code-server/container_registry)
[![Quay.io](https://img.shields.io/static/v1.svg?style=flat-square&color=E68523&label=linuxserver.io&message=Quay.io)](https://quay.io/repository/linuxserver.io/code-server)
[![MicroBadger Layers](https://img.shields.io/microbadger/layers/linuxserver/code-server.svg?style=flat-square&color=E68523)](https://microbadger.com/images/linuxserver/code-server "Get your own version badge on microbadger.com") [![MicroBadger Layers](https://img.shields.io/microbadger/layers/linuxserver/code-server.svg?style=flat-square&color=E68523)](https://microbadger.com/images/linuxserver/code-server "Get your own version badge on microbadger.com")
[![MicroBadger Size](https://img.shields.io/microbadger/image-size/linuxserver/code-server.svg?style=flat-square&color=E68523)](https://microbadger.com/images/linuxserver/code-server "Get your own version badge on microbadger.com") [![Docker Pulls](https://img.shields.io/docker/pulls/linuxserver/code-server.svg?style=flat-square&color=E68523&label=pulls&logo=docker&logoColor=FFFFFF)](https://hub.docker.com/r/linuxserver/code-server)
[![Docker Pulls](https://img.shields.io/docker/pulls/linuxserver/code-server.svg?style=flat-square&color=E68523)](https://hub.docker.com/r/linuxserver/code-server) [![Docker Stars](https://img.shields.io/docker/stars/linuxserver/code-server.svg?style=flat-square&color=E68523&label=stars&logo=docker&logoColor=FFFFFF)](https://hub.docker.com/r/linuxserver/code-server)
[![Docker Stars](https://img.shields.io/docker/stars/linuxserver/code-server.svg?style=flat-square&color=E68523)](https://hub.docker.com/r/linuxserver/code-server)
[![Build Status](https://ci.linuxserver.io/view/all/job/Docker-Pipeline-Builders/job/docker-code-server/job/master/badge/icon?style=flat-square)](https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-code-server/job/master/) [![Build Status](https://ci.linuxserver.io/view/all/job/Docker-Pipeline-Builders/job/docker-code-server/job/master/badge/icon?style=flat-square)](https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-code-server/job/master/)
[![](https://lsio-ci.ams3.digitaloceanspaces.com/linuxserver/code-server/latest/badge.svg)](https://lsio-ci.ams3.digitaloceanspaces.com/linuxserver/code-server/latest/index.html) [![](https://lsio-ci.ams3.digitaloceanspaces.com/linuxserver/code-server/latest/badge.svg)](https://lsio-ci.ams3.digitaloceanspaces.com/linuxserver/code-server/latest/index.html)
@ -54,6 +58,14 @@ The architectures supported by this image are:
| :----: | --- | | :----: | --- |
| x86-64 | amd64-latest | | x86-64 | amd64-latest |
## Version Tags
This image provides various versions that are available via tags. `latest` tag usually provides the latest stable version. Others are considered under development and caution must be exercised when using them.
| Tag | Description |
| :----: | --- |
| latest | Stable releases |
| development | Prereleases from their GitHub |
## Usage ## Usage
@ -114,6 +126,18 @@ Container images are configured using parameters passed at runtime (such as thos
| `-e SUDO_PASSWORD=password` | If this optional variable is set, user will have sudo access in the code-server terminal with the specified password. | | `-e SUDO_PASSWORD=password` | If this optional variable is set, user will have sudo access in the code-server terminal with the specified password. |
| `-v /config` | Contains all relevant configuration files. | | `-v /config` | Contains all relevant configuration files. |
## Environment variables from files (Docker secrets)
You can set any environment variable from a file by using a special prepend `FILE__`.
As an example:
```
-e FILE__PASSWORD=/run/secrets/mysecretpassword
```
Will set the environment variable `PASSWORD` based on the contents of the `/run/secrets/mysecretpassword` file.
## User / Group Identifiers ## 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`. 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`.

View File

@ -2,14 +2,13 @@
# jenkins variables # jenkins variables
project_name: docker-code-server project_name: docker-code-server
external_type: github_stable external_type: custom_json
release_type: stable release_type: prerelease
release_tag: latest release_tag: development
ls_branch: master ls_branch: development
repo_vars: repo_vars:
- EXT_GIT_BRANCH = 'master' - JSON_URL = 'https://api.github.com/repos/cdr/code-server/releases'
- EXT_USER = 'cdr' - JSON_PATH = 'first(.[] | select(.prerelease == true)) | .tag_name'
- EXT_REPO = 'code-server'
- CONTAINER_NAME = 'code-server' - CONTAINER_NAME = 'code-server'
- BUILD_VERSION_ARG = 'CODE_RELEASE' - BUILD_VERSION_ARG = 'CODE_RELEASE'
- LS_USER = 'linuxserver' - LS_USER = 'linuxserver'

View File

@ -1,7 +1,7 @@
adduser3.116ubuntu1 adduser3.116ubuntu1
apt1.6.11 apt1.6.12
apt-utils1.6.11 apt-utils1.6.12
base-files10.1ubuntu2.6 base-files10.1ubuntu2.7
base-passwd3.5.44 base-passwd3.5.44
bash4.4.18-2ubuntu1.2 bash4.4.18-2ubuntu1.2
bsdutils1:2.31.1-0.4ubuntu3.4 bsdutils1:2.31.1-0.4ubuntu3.4
@ -13,34 +13,35 @@ dash0.5.8-2.10
debconf1.5.66ubuntu1 debconf1.5.66ubuntu1
debianutils4.8.4 debianutils4.8.4
diffutils1:3.6-1 diffutils1:3.6-1
dpkg1.19.0.5ubuntu2.2 dpkg1.19.0.5ubuntu2.3
e2fsprogs1.44.1-1ubuntu1.1 e2fsprogs1.44.1-1ubuntu1.2
fdisk2.31.1-0.4ubuntu3.4 fdisk2.31.1-0.4ubuntu3.4
findutils4.6.0+git+20170828-2 findutils4.6.0+git+20170828-2
gcc-8-base8.3.0-6ubuntu1~18.04.1 gcc-8-base8.3.0-6ubuntu1~18.04.1
git1:2.17.1-1ubuntu0.4 git1:2.17.1-1ubuntu0.5
git-man1:2.17.1-1ubuntu0.4 git-man1:2.17.1-1ubuntu0.5
gpgv2.2.4-1ubuntu1.2 gpgv2.2.4-1ubuntu1.2
grep3.1-2 grep3.1-2build1
gzip1.6-5ubuntu1 gzip1.6-5ubuntu1
hostname3.20 hostname3.20
init-system-helpers1.51 init-system-helpers1.51
jq1.5+dfsg-2
krb5-locales1.16-2ubuntu0.1 krb5-locales1.16-2ubuntu0.1
less487-0.1 less487-0.1
libacl12.2.52-3build1 libacl12.2.52-3build1
libapt-inst2.01.6.11 libapt-inst2.01.6.12
libapt-pkg5.01.6.11 libapt-pkg5.01.6.12
libasn1-8-heimdal7.5.0+dfsg-1 libasn1-8-heimdal7.5.0+dfsg-1
libattr11:2.4.47-2build1 libattr11:2.4.47-2build1
libaudit11:2.8.2-1ubuntu1 libaudit11:2.8.2-1ubuntu1
libaudit-common1:2.8.2-1ubuntu1 libaudit-common1:2.8.2-1ubuntu1
libblkid12.31.1-0.4ubuntu3.4 libblkid12.31.1-0.4ubuntu3.4
libbsd00.8.7-1 libbsd00.8.7-1ubuntu0.1
libbz2-1.01.0.6-8.1ubuntu0.2 libbz2-1.01.0.6-8.1ubuntu0.2
libc62.27-3ubuntu1 libc62.27-3ubuntu1
libcap-ng00.7.7-3.1 libcap-ng00.7.7-3.1
libc-bin2.27-3ubuntu1 libc-bin2.27-3ubuntu1
libcom-err21.44.1-1ubuntu1.1 libcom-err21.44.1-1ubuntu1.2
libcurl3-gnutls7.58.0-2ubuntu3.8 libcurl3-gnutls7.58.0-2ubuntu3.8
libcurl47.58.0-2ubuntu3.8 libcurl47.58.0-2ubuntu3.8
libdb5.35.3.28-13.1ubuntu1.1 libdb5.35.3.28-13.1ubuntu1.1
@ -48,15 +49,15 @@ libdebconfclient00.213ubuntu1
libedit23.1-20170329-1 libedit23.1-20170329-1
liberror-perl0.17025-1 liberror-perl0.17025-1
libexpat12.2.5-3ubuntu0.2 libexpat12.2.5-3ubuntu0.2
libext2fs21.44.1-1ubuntu1.1 libext2fs21.44.1-1ubuntu1.2
libfdisk12.31.1-0.4ubuntu3.4 libfdisk12.31.1-0.4ubuntu3.4
libffi63.2.1-8 libffi63.2.1-8
libgcc11:8.3.0-6ubuntu1~18.04.1 libgcc11:8.3.0-6ubuntu1~18.04.1
libgcrypt201.8.1-4ubuntu1.1 libgcrypt201.8.1-4ubuntu1.2
libgdbm51.14.1-6 libgdbm51.14.1-6
libgdbm-compat41.14.1-6 libgdbm-compat41.14.1-6
libgmp102:6.1.2+dfsg-2 libgmp102:6.1.2+dfsg-2
libgnutls303.5.18-1ubuntu1.1 libgnutls303.5.18-1ubuntu1.2
libgpg-error01.27-6 libgpg-error01.27-6
libgssapi3-heimdal7.5.0+dfsg-1 libgssapi3-heimdal7.5.0+dfsg-1
libgssapi-krb5-21.16-2ubuntu0.1 libgssapi-krb5-21.16-2ubuntu0.1
@ -65,7 +66,8 @@ libheimbase1-heimdal7.5.0+dfsg-1
libheimntlm0-heimdal7.5.0+dfsg-1 libheimntlm0-heimdal7.5.0+dfsg-1
libhogweed43.4-1 libhogweed43.4-1
libhx509-5-heimdal7.5.0+dfsg-1 libhx509-5-heimdal7.5.0+dfsg-1
libidn2-02.0.4-1.1build2 libidn2-02.0.4-1.1ubuntu0.2
libjq11.5+dfsg-2
libk5crypto31.16-2ubuntu0.1 libk5crypto31.16-2ubuntu0.1
libkeyutils11.5.9-9.2ubuntu2 libkeyutils11.5.9-9.2ubuntu2
libkrb5-26-heimdal7.5.0+dfsg-1 libkrb5-26-heimdal7.5.0+dfsg-1
@ -80,6 +82,7 @@ libncurses56.1-1ubuntu1.18.04
libncursesw56.1-1ubuntu1.18.04 libncursesw56.1-1ubuntu1.18.04
libnettle63.4-1 libnettle63.4-1
libnghttp2-141.30.0-1ubuntu1 libnghttp2-141.30.0-1ubuntu1
libonig46.7.0-1
libp11-kit00.23.9-2 libp11-kit00.23.9-2
libpam0g1.1.8-3.6ubuntu2.18.04.1 libpam0g1.1.8-3.6ubuntu2.18.04.1
libpam-modules1.1.8-3.6ubuntu2.18.04.1 libpam-modules1.1.8-3.6ubuntu2.18.04.1
@ -100,15 +103,15 @@ libsemanage12.7-2build2
libsemanage-common2.7-2build2 libsemanage-common2.7-2build2
libsepol12.7-1 libsepol12.7-1
libsmartcols12.31.1-0.4ubuntu3.4 libsmartcols12.31.1-0.4ubuntu3.4
libsqlite3-03.22.0-1ubuntu0.1 libsqlite3-03.22.0-1ubuntu0.2
libss21.44.1-1ubuntu1.1 libss21.44.1-1ubuntu1.2
libssl1.0.01.0.2n-1ubuntu5.3 libssl1.0.01.0.2n-1ubuntu5.3
libssl1.11.1.1-1ubuntu2.1~18.04.4 libssl1.11.1.1-1ubuntu2.1~18.04.5
libstdc++68.3.0-6ubuntu1~18.04.1 libstdc++68.3.0-6ubuntu1~18.04.1
libsystemd0237-3ubuntu10.28 libsystemd0237-3ubuntu10.33
libtasn1-64.13-2 libtasn1-64.13-2
libtinfo56.1-1ubuntu1.18.04 libtinfo56.1-1ubuntu1.18.04
libudev1237-3ubuntu10.28 libudev1237-3ubuntu10.33
libunistring20.9.9-0ubuntu2 libunistring20.9.9-0ubuntu2
libuuid12.31.1-0.4ubuntu3.4 libuuid12.31.1-0.4ubuntu3.4
libwind0-heimdal7.5.0+dfsg-1 libwind0-heimdal7.5.0+dfsg-1
@ -132,7 +135,7 @@ ncurses-bin6.1-1ubuntu1.18.04
netbase5.4 netbase5.4
net-tools1.60+git20161116.90da8a0-1ubuntu1 net-tools1.60+git20161116.90da8a0-1ubuntu1
openssh-client1:7.6p1-4ubuntu0.3 openssh-client1:7.6p1-4ubuntu0.3
openssl1.1.1-1ubuntu2.1~18.04.4 openssl1.1.1-1ubuntu2.1~18.04.5
passwd1:4.5-1ubuntu2 passwd1:4.5-1ubuntu2
patch2.7.6-2ubuntu1.1 patch2.7.6-2ubuntu1.1
perl5.26.1-6ubuntu0.3 perl5.26.1-6ubuntu0.3
@ -142,10 +145,10 @@ procps2:3.3.12-3ubuntu1.2
publicsuffix20180223.1310-1 publicsuffix20180223.1310-1
sed4.4-2 sed4.4-2
sensible-utils0.0.12 sensible-utils0.0.12
sudo1.8.21p2-3ubuntu1 sudo1.8.21p2-3ubuntu1.1
sysvinit-utils2.88dsf-59.10ubuntu1 sysvinit-utils2.88dsf-59.10ubuntu1
tar1.29b-2ubuntu0.1 tar1.29b-2ubuntu0.1
tzdata2019b-0ubuntu0.18.04 tzdata2019c-0ubuntu0.18.04
ubuntu-keyring2018.09.18.1~18.04.0 ubuntu-keyring2018.09.18.1~18.04.0
util-linux2.31.1-0.4ubuntu3.4 util-linux2.31.1-0.4ubuntu3.4
xauth1:1.0.10-1 xauth1:1.0.10-1

View File

@ -24,10 +24,10 @@ available_architectures:
- { arch: "{{ arch_x86_64 }}", tag: "amd64-latest"} - { arch: "{{ arch_x86_64 }}", tag: "amd64-latest"}
# development version # development version
development_versions: false development_versions: true
development_versions_items: development_versions_items:
- { tag: "latest", desc: "Stable releases" } - { tag: "latest", desc: "Stable releases" }
- { tag: "development", desc: "Releases from the `develop` branch" } - { tag: "development", desc: "Prereleases from their GitHub" }
# container parameters # container parameters
common_param_env_vars_enabled: true common_param_env_vars_enabled: true

View File

@ -1,18 +1,18 @@
#!/usr/bin/with-contenv bash #!/usr/bin/with-contenv bash
if [ -n "${PASSWORD}" ]; then if [ -n "${PASSWORD}" ]; then
PASSARG="-P ${PASSWORD}" AUTH="--auth password"
else else
PASSARG="-N"
echo "starting with no password" echo "starting with no password"
fi fi
exec \ exec \
s6-setuidgid abc \ s6-setuidgid abc \
/usr/bin/code-server \ /usr/bin/code-server \
-H \ --port 8443 \
${PASSARG} \ --user-data-dir /config/data \
-d /config/data \ --extensions-dir /config/extensions \
-e /config/extensions \
--disable-telemetry \ --disable-telemetry \
--disable-updates \
${AUTH} \
/config/workspace /config/workspace