Skip to content
This repository has been archived by the owner on Oct 10, 2022. It is now read-only.

Commit

Permalink
change to pulling compiled bins from a tag for rebuilds and using an …
Browse files Browse the repository at this point in the history
…OS tag based on package versions
  • Loading branch information
thelamer committed May 27, 2019
1 parent df41139 commit 4186019
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 125 deletions.
34 changes: 1 addition & 33 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,36 +1,4 @@
FROM lsiobase/ubuntu:bionic as builder

ARG DEBIAN_FRONTEND="noninteractive"
ARG NPM_CONFIG_UNSAFE_PERM=true

RUN \
echo "**** install build packages ****" && \
apt-get update && \
apt-get install -y \
g++ \
gcc \
git \
make \
python && \
echo "**** Compile Cloud9 from source ****" && \
git clone --depth 1 \
https://github.com/c9/core.git c9sdk && \
cd c9sdk && \
mkdir -p /c9bins && \
HOME=/c9bins scripts/install-sdk.sh && \
echo "**** Restructure files for copy ****" && \
mkdir -p \
/buildout && \
rm -Rf \
/c9bins/.c9/tmp && \
mv \
/c9bins \
/buildout/c9bins && \
mv \
/c9sdk \
/buildout/

# runtime stage
FROM lsiobase/cloud9:files as builder
FROM lsiobase/ubuntu:bionic

# set version label
Expand Down
34 changes: 1 addition & 33 deletions Dockerfile.aarch64
Original file line number Diff line number Diff line change
@@ -1,36 +1,4 @@
FROM lsiobase/ubuntu:arm64v8-bionic as builder

ARG DEBIAN_FRONTEND="noninteractive"
ARG NPM_CONFIG_UNSAFE_PERM=true

RUN \
echo "**** install build packages ****" && \
apt-get update && \
apt-get install -y \
g++ \
gcc \
git \
make \
python && \
echo "**** Compile Cloud9 from source ****" && \
git clone --depth 1 \
https://github.com/c9/core.git c9sdk && \
cd c9sdk && \
mkdir -p /c9bins && \
HOME=/c9bins scripts/install-sdk.sh && \
echo "**** Restructure files for copy ****" && \
mkdir -p \
/buildout && \
rm -Rf \
/c9bins/.c9/tmp && \
mv \
/c9bins \
/buildout/c9bins && \
mv \
/c9sdk \
/buildout/

# runtime stage
FROM lsiobase/cloud9:arm64v8-files as builder
FROM lsiobase/ubuntu:arm64v8-bionic

# set version label
Expand Down
34 changes: 1 addition & 33 deletions Dockerfile.armhf
Original file line number Diff line number Diff line change
@@ -1,36 +1,4 @@
FROM lsiobase/ubuntu:arm32v7-bionic as builder

ARG DEBIAN_FRONTEND="noninteractive"
ARG NPM_CONFIG_UNSAFE_PERM=true

RUN \
echo "**** install build packages ****" && \
apt-get update && \
apt-get install -y \
g++ \
gcc \
git \
make \
python && \
echo "**** Compile Cloud9 from source ****" && \
git clone --depth 1 \
https://github.com/c9/core.git c9sdk && \
cd c9sdk && \
mkdir -p /c9bins && \
HOME=/c9bins scripts/install-sdk.sh && \
echo "**** Restructure files for copy ****" && \
mkdir -p \
/buildout && \
rm -Rf \
/c9bins/.c9/tmp && \
mv \
/c9bins \
/buildout/c9bins && \
mv \
/c9sdk \
/buildout/

# runtime stage
FROM lsiobase/cloud9:arm32v7-files as builder
FROM lsiobase/ubuntu:arm32v7-bionic

# set version label
Expand Down
32 changes: 10 additions & 22 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ pipeline {
environment {
BUILDS_DISCORD=credentials('build_webhook_url')
GITHUB_TOKEN=credentials('498b4638-2d02-4ce5-832d-8a57d01d97ab')
EXT_GIT_BRANCH = 'master'
EXT_USER = 'c9'
EXT_REPO = 'core'
BUILD_VERSION_ARG = 'CLOUD9_VERSION'
LS_USER = 'linuxserver'
LS_REPO = 'docker-baseimage-cloud9'
Expand Down Expand Up @@ -102,23 +99,14 @@ pipeline {
/* ########################
External Release Tagging
######################## */
// If this is a github commit trigger determine the current commit at head
stage("Set ENV github_commit"){
steps{
script{
env.EXT_RELEASE = sh(
script: '''curl -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/commits/${EXT_GIT_BRANCH} | jq -r '. | .sha' | cut -c1-8 ''',
returnStdout: true).trim()
}
}
}
// If this is a github commit trigger Set the external release link
stage("Set ENV commit_link"){
steps{
script{
env.RELEASE_LINK = 'https://github.com/' + env.EXT_USER + '/' + env.EXT_REPO + '/commit/' + env.EXT_RELEASE
}
}
// If this is an os release set release type to none to indicate no external release
stage("Set ENV os"){
steps{
script{
env.EXT_RELEASE = env.PACKAGE_TAG
env.RELEASE_LINK = 'none'
}
}
}
// Sanitize the release tag and strip illegal docker or github characters
stage("Sanitize tag"){
Expand Down Expand Up @@ -595,11 +583,11 @@ pipeline {
"tagger": {"name": "LinuxServer Jenkins","email": "[email protected]","date": "'${GITHUB_DATE}'"}}' '''
echo "Pushing New release for Tag"
sh '''#! /bin/bash
curl -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/commits/${EXT_GIT_BRANCH} | jq '. | .commit.message' | sed 's:^.\\(.*\\).$:\\1:' > releasebody.json
echo "Updating base packages to ${PACKAGE_TAG}" > 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
"body": "**LinuxServer Changes:**\\n\\n'${LS_RELEASE_NOTES}'\\n**OS Changes:**\\n\\n' > start
printf '","draft": false,"prerelease": false}' >> 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'''
Expand Down
5 changes: 1 addition & 4 deletions jenkins-vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@

# jenkins variables
project_name: docker-baseimage-cloud9
external_type: github_commit
external_type: os
release_type: stable
release_tag: latest
ls_branch: master
repo_vars:
- EXT_GIT_BRANCH = 'master'
- EXT_USER = 'c9'
- EXT_REPO = 'core'
- BUILD_VERSION_ARG = 'CLOUD9_VERSION'
- LS_USER = 'linuxserver'
- LS_REPO = 'docker-baseimage-cloud9'
Expand Down

0 comments on commit 4186019

Please sign in to comment.