[TASK] Init
This commit is contained in:
commit
f3b4cdf08e
116
pipeline.yml
Normal file
116
pipeline.yml
Normal file
@ -0,0 +1,116 @@
|
||||
---
|
||||
resource_types:
|
||||
- name: aptly-resource
|
||||
type: docker-image
|
||||
source:
|
||||
repository: docker.datentonne.net/concourse/aptly-resource
|
||||
tag: latest
|
||||
resources:
|
||||
- name: roundcubemail
|
||||
type: github-release
|
||||
source:
|
||||
owner: roundcube
|
||||
repository: roundcubemail
|
||||
access_token: ((github.access_token))
|
||||
- name: roundcubemail-deb
|
||||
type: aptly-resource
|
||||
source:
|
||||
api_uri: https://apt-api.datentonne.net/
|
||||
repo_uri: https://apt.datentonne.net/
|
||||
repo: datentonne
|
||||
distribution: debian
|
||||
component: main
|
||||
architecture: amd64
|
||||
package: roundcubemail-docker
|
||||
username: ((aptly.username))
|
||||
password: ((aptly.password))
|
||||
timeout: 1801
|
||||
keep_versions: 5
|
||||
jobs:
|
||||
- name: build
|
||||
plan:
|
||||
- get: roundcubemail
|
||||
params:
|
||||
globs:
|
||||
- dummy-*-linux-amd64
|
||||
- task: build
|
||||
config:
|
||||
platform: linux
|
||||
image_resource:
|
||||
type: registry-image
|
||||
source: { repository: ruby }
|
||||
inputs:
|
||||
- name: roundcubemail
|
||||
outputs:
|
||||
- name: deb
|
||||
run:
|
||||
path: /bin/bash
|
||||
args:
|
||||
- -c
|
||||
- |
|
||||
export VERSION="$(cat roundcubemail/version)"
|
||||
export VERSION_OUT="$(cat roundcubemail/version)-$(date +%s)"
|
||||
gem install fpm
|
||||
cd roundcubemail
|
||||
mkdir -p etc/roundcubemail
|
||||
mkdir -p opt/roundcubemail
|
||||
cat <<- EOF > roundcubemail.service
|
||||
[Unit]
|
||||
Description=roundcubemail service with docker compose
|
||||
Requires=docker.service
|
||||
After=docker.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=true
|
||||
WorkingDirectory=/opt/roundcubemail
|
||||
ExecStart=/usr/local/bin/docker-compose up -d --remove-orphans
|
||||
ExecStop=/usr/local/bin/docker-compose down
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
cat <<- EOF > etc/roundcubemail/config.inc.php
|
||||
<?php
|
||||
// Empty config
|
||||
$config = [];
|
||||
EOF
|
||||
cat <<- EOF > after-install
|
||||
mkdir -p /opt/vaultwarden/data/
|
||||
EOF
|
||||
chmod +x after-install
|
||||
cat <<- EOF > opt/roundcubemail/env
|
||||
TAG=${VERSION}
|
||||
EOF
|
||||
ln -s env opt/roundcubemail/.env
|
||||
mkdir -p opt
|
||||
cat <<- EOF > opt/roundcubemail/docker-compose.yml
|
||||
version: "3"
|
||||
services:
|
||||
app:
|
||||
image: roundcube/roundcubemail:\${TAG}
|
||||
container_name: roundcubemail
|
||||
volumes:
|
||||
- /etc/roundcubemail/config.inc.php:/var/www/html/config/config.inc.php
|
||||
ports:
|
||||
- "8000:80"
|
||||
EOF
|
||||
fpm \
|
||||
--verbose \
|
||||
-f \
|
||||
-n roundcubemail-docker \
|
||||
-s dir \
|
||||
-t deb \
|
||||
-v $VERSION_OUT \
|
||||
--after-install after-install \
|
||||
--config-files opt/roundcubemail/docker-compose.yml \
|
||||
--config-files etc/roundcubemail/config.inc.php \
|
||||
--deb-systemd roundcubemail.service \
|
||||
opt/roundcubemail/=/opt/roundcubemail/
|
||||
dpkg-deb -c roundcubemail-docker_*.deb
|
||||
cd ..
|
||||
mv -v roundcubemail/roundcubemail-docker_${VERSION_OUT}_amd64.deb deb/
|
||||
echo "deb/roundcubemail-docker_${VERSION_OUT}_amd64.deb" > deb/filename
|
||||
- put: roundcubemail-deb
|
||||
params:
|
||||
archive_file: deb/filename
|
Loading…
x
Reference in New Issue
Block a user