2
0
Fork 0
mirror of https://github.com/friendica/docker synced 2024-05-27 04:06:58 +02:00

Merge pull request #41 from nupplaphil/autobuild

Autobuild
This commit is contained in:
Hypolite Petovan 2018-12-13 15:42:46 -05:00 committed by GitHub
commit 842226a4e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 26 additions and 1 deletions

1
.bashbrew/flags Normal file
View file

@ -0,0 +1 @@
Namespace: friendica

View file

@ -13,6 +13,9 @@ stages:
# full test for master
- name: test images (full)
if: branch = master
# build and push for master
- name: deploy
if: branch = master
install:
- git clone https://github.com/docker-library/official-images.git ~/official-images
@ -83,3 +86,10 @@ jobs:
- env: VERSION=2018.12-rc VARIANT=fpm ARCH=i386
- env: VERSION=2018.12-rc VARIANT=apache ARCH=amd64
- env: VERSION=2018.12-rc VARIANT=apache ARCH=i386
- stage: deploy
env: SCRIPT=build_and_push.sh
script: skip
deploy:
provider: script
script: ./build_and_push.sh

7
build_and_push.sh Executable file
View file

@ -0,0 +1,7 @@
#!/bin/bash
set -e
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
./generate-stackbrew-library.sh > server
bashbrew --config .bashbrew/ --library ./ build server
bashbrew --config .bashbrew/ --library ./ push server

View file

@ -12,7 +12,13 @@ cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
# Get the most recent commit which modified any of "$@".
fileCommit() {
git log -1 --format='format:%H' HEAD -- "$@"
commit="$(git log -1 --format='format:%H' HEAD -- "$@")"
if [ -z "$commit" ]; then
# return some valid sha1 hash to make bashbrew happy
echo '0000000000000000000000000000000000000000'
else
echo "$commit"
fi
}
# Get the most recent commit which modified "$1/Dockerfile" or any file that
@ -50,6 +56,7 @@ getArches 'friendica'
# Header.
cat <<-EOH
# This file is generated via https://github.com/friendica/docker/blob/$(fileCommit "$self")/$self
Maintainers: Friendica <info@friendi.ca> (@friendica), Philipp Holzer <admin@philipp.info> (@nupplaphil)
GitRepo: https://github.com/friendica/docker.git
EOH