--- resource_types: - name: aptly-resource type: docker-image source: repository: docker.datentonne.net/concourse/aptly-resource tag: latest - name: concourse-git-semver-tag type: docker-image source: repository: laurentverbruggen/concourse-git-semver-tag-resource resources: - name: roundcubemail type: concourse-git-semver-tag source: uri: https://github.com/roundcube/roundcubemail-docker.git branch: master - 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 - 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/number)" export VERSION_OUT="$(cat roundcubemail/number)-$(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 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