Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
974da8e
Add ghostunnel secrets to drone pipeline
kw-lschwarz Sep 18, 2025
7639ecd
Disable drone/docker publish for now
kw-lschwarz Sep 18, 2025
9e4a9ae
Start ghostunnel on container start
kw-lschwarz Sep 18, 2025
1a377a5
Use ghostunnel for squish license server validation
kw-lschwarz Sep 18, 2025
02fda74
Run ghostunnel before squish installation
kw-lschwarz Sep 18, 2025
73eb244
Ghostunnel inside squish function
kw-lschwarz Sep 18, 2025
22a925e
Debugging
kw-lschwarz Sep 18, 2025
6bc1169
Add env vars
kw-lschwarz Sep 18, 2025
bdf34b2
Debugging
kw-lschwarz Sep 18, 2025
92786b6
Add missing buildargs
kw-lschwarz Sep 18, 2025
2f34c64
Debugging
kw-lschwarz Sep 18, 2025
b946577
Debugging
kw-lschwarz Sep 18, 2025
6d04a29
Different approach for secrets
kw-lschwarz Sep 18, 2025
eeb8760
Fix syntax
kw-lschwarz Sep 18, 2025
5f0bf15
Bugs
kw-lschwarz Sep 18, 2025
2d7ffa7
More debugging
kw-lschwarz Sep 18, 2025
516c39c
More debugging
kw-lschwarz Sep 18, 2025
256f3b1
Try different env var names
kw-lschwarz Sep 18, 2025
062a302
Fix typo
kw-lschwarz Sep 18, 2025
7531d4f
Debugging
kw-lschwarz Sep 18, 2025
2b2b12d
Fix drone secrets
kw-lschwarz Sep 18, 2025
86968b6
Secrets into host volumes
kw-lschwarz Sep 19, 2025
89fe728
Remove volumes from drone file
kw-lschwarz Sep 22, 2025
c3b89b5
Debug secrets
kw-lschwarz Sep 22, 2025
ea4bd4e
Fix drone config
kw-lschwarz Sep 22, 2025
6c21a3d
Debug cacert secret
kw-lschwarz Sep 22, 2025
49f790b
Use buildkit secrets
kw-lschwarz Sep 22, 2025
209a213
Try with OC buildx image
kw-lschwarz Sep 22, 2025
7550c10
Escape secret syntax
kw-lschwarz Sep 22, 2025
96083dd
Escaped secrets complete
kw-lschwarz Sep 22, 2025
8417a89
Debugging ghostunnel
kw-lschwarz Sep 22, 2025
458cec8
More debugging
kw-lschwarz Sep 22, 2025
6401aba
Fix curl not downloading
kw-lschwarz Sep 22, 2025
5e6a515
Add delay to let tunnel establish connection
kw-lschwarz Sep 22, 2025
c4eaf42
Add missing ampersand
kw-lschwarz Sep 22, 2025
e4fa767
Fixed, I hope
kw-lschwarz Sep 22, 2025
ee1e725
Remove debugging stuff
kw-lschwarz Sep 22, 2025
e5ce829
Try keystore + password
kw-lschwarz Sep 23, 2025
c831b55
Copy secrets into Drone "workspace"
kw-lschwarz Sep 23, 2025
4c762d7
Debug secrets
kw-lschwarz Sep 23, 2025
26297e5
Where is the workspace
kw-lschwarz Sep 23, 2025
06a0694
Debugging
kw-lschwarz Sep 23, 2025
6c796f5
Explicitly set Drone workspace
kw-lschwarz Sep 23, 2025
1faf61f
Fix syntax
kw-lschwarz Sep 23, 2025
2984868
Move workspace directive
kw-lschwarz Sep 23, 2025
081873e
Add tmp volume
kw-lschwarz Sep 23, 2025
489fef8
Fix syntax
kw-lschwarz Sep 23, 2025
2132b50
Debug volumes
kw-lschwarz Sep 23, 2025
d593ba4
Try different syntax
kw-lschwarz Sep 24, 2025
de35008
Add missing comma
kw-lschwarz Sep 24, 2025
6cf8929
Move stuff around
kw-lschwarz Sep 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 39 additions & 6 deletions .drone.star
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
'''
This config defines the Drone CI pipelines for building and publishing Squish images for ownCloud CI.
"""
'''

versions = {
# <base_image>: <base_image_tag>
Expand All @@ -20,7 +20,16 @@ def main(ctx):
'from_secret': 'squish_download_s3secret',
},
'licensekey': {
'from_secret': 'squish_licensekey',
'from_secret': 'squish_licensekey_new',
},
'ghostunnel_ca_cert': {
'from_secret': 'ghostunnel_ca_cert',
},
'ghostunnel_client_cert': {
'from_secret': 'ghostunnel_client_cert',
},
'ghostunnel_client_key': {
'from_secret': 'ghostunnel_client_key',
},
}

Expand Down Expand Up @@ -63,6 +72,10 @@ def docker(config):
'arch': config['arch'],
},
'steps': steps(config),
'volumes': volumes(config),
'workspace':{
'path': '/drone/src',
},
'depends_on': [],
'trigger': {
'ref': [
Expand All @@ -72,6 +85,15 @@ def docker(config):
},
}


def volumes(config):
return [
{
'name': 'docker',
'temp': {},
},
]

def documentation(config):
return {
'kind': 'pipeline',
Expand Down Expand Up @@ -164,20 +186,32 @@ def notification(config):
},
}



def dryrun(config):
return [{
'name': 'dryrun',
'image': 'plugins/docker',
'image': 'docker.io/owncloudci/drone-docker-buildx:4',
'environment':{
'S3SECRET': config['s3secret'],
'LICENSEKEY': config['licensekey'],
'CACERT': config['ghostunnel_ca_cert'],
'CLIENTKEY': config['ghostunnel_client_key'],
'CLIENTCERT': config['ghostunnel_client_cert'],
},
'settings': {
'dry_run': True,
'tags': config['tags'],
'dockerfile': '%s/Dockerfile.%s' % (config['path'], config['arch']),
'repo': 'owncloudci/%s' % config['repo'],
'secrets': ['id=cacert\\\\,env=CACERT', 'id=client-cert\\\\,env=CLIENTCERT', 'id=client-key\\\\,env=CLIENTKEY'],
'context': config['path'],
'volumes': [
{
'name': 'docker',
'path': '/dockerabc',
},
],
'build_args': [
'SQUISHVERSION=%s' % config['squishversion'][config['version']],
'BASETAG=%s' % config['base_image_tag'],
Expand Down Expand Up @@ -232,6 +266,5 @@ def publish(config):
}]



def steps(config):
return dryrun(config) + publish(config)
return dryrun(config)
10 changes: 10 additions & 0 deletions fedora/Dockerfile.amd64
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,17 @@ FROM ${BASE}:${BASETAG} AS stage-build
ARG ARG_CLIENT_BRANCH
ARG ARG_CLIENT_BUILD_TARGET

RUN ls -l /
#RUN --mount=type=secret,id=cacert --mount=type=secret,id=client-key --mount=type=secret,id=client-cert cp /run/secrets/* /drone/src/
RUN --mount=type=secret,id=cacert cp /run/secrets/cacert /drone/src/

ENV OWNBUILD_DIR=/ownbuild
ENV CLIENT_BRANCH=${ARG_CLIENT_BRANCH:-master}
ENV CLIENT_BUILD_TARGET=${ARG_CLIENT_BUILD_TARGET:-linux-64-gcc-debug}

RUN dnf install -y \
ss \
telnet \
git-core \
cmake \
ninja-build \
Expand Down Expand Up @@ -38,6 +44,10 @@ RUN mkdir -p ${OWNBUILD_DIR}/${CLIENT_BRANCH} && \
find ./ -name *doc | xargs rm -rf && \
find ./ -name *man | xargs rm -rf


# Install ghostunnel for secured access to the squish license server
RUN curl -L https://github.com/ghostunnel/ghostunnel/releases/download/v1.8.4/ghostunnel-linux-amd64 -so /opt/ghostunnel && chmod +x /opt/ghostunnel

############################################
# Validate system and Squish Qt version #
############################################
Expand Down
15 changes: 14 additions & 1 deletion fedora/src/startup/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,23 @@ SQUISH_INSTALL_LOG="${HOME}/squish-installation.log"
mkdir -p "${HOME}"

function install_squish() {

# TODO nicer
# ghostunnel stuff

echo "Starting ghostunnel"
/opt/ghostunnel client \
--listen localhost:8003 \
--target "$LICENSEKEY" \
--cacert /drone/src/cacert \
--key /drone/src/client-key \
--cert /drone/src/client-cert &


echo "[SQUISH] Installing squish..."
echo "[SQUISH] Installation report: ${SQUISH_INSTALL_LOG}"

/opt/squish.run unattended=1 ide=0 doc=0 examples=0 targetdir="${SQUISH_INSTALL_DIR}" licensekey="${LICENSEKEY}" >>"${SQUISH_INSTALL_LOG}" 2>&1
/opt/squish.run unattended=1 ide=0 doc=0 examples=0 targetdir="${SQUISH_INSTALL_DIR}" licensekey="localhost:8003" >>"${SQUISH_INSTALL_LOG}" 2>&1
result=$?

if [[ $result -ne 0 ]]; then
Expand Down