mirror of
https://github.com/shlinkio/shlink.git
synced 2024-12-26 00:41:35 -06:00
Merge pull request #323 from acelaya/feature/docker-build
Feature/docker build
This commit is contained in:
commit
8966cf9910
@ -41,7 +41,7 @@ before_deploy:
|
|||||||
- ./build.sh ${TRAVIS_TAG#?}
|
- ./build.sh ${TRAVIS_TAG#?}
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
provider: releases
|
- provider: releases
|
||||||
api_key:
|
api_key:
|
||||||
secure: a9dbZchocqeuOViwUeNH54bQR5Sz7rEYXx5b9WPFtnFn9LGKKUaLbA2U91UQ9QKPrcTpsALubUYbw2CnNmvCwzaY+R8lCD3gkU4ohsEnbpnw3deOeixI74sqBHJAuCH9FSaRDGILoBMtUKx2xlzIymFxkIsgIukkGbdkWHDlRWY3oTUUuw1SQ2Xk9KDsbJQtjIc1+G/O6gHaV4qv/R9W8NPmJExKTNDrAZbC1vIUnxqp4UpVo1hst8qPd1at94CndDYM5rG+7imGbdtxTxzamt819qdTO1OfvtctKawNAm7YXZrrWft6c7gI6j6SI4hxd+ZrrPBqbaRFHkZHjnNssO/yn4SaOHFFzccmu0MzvpPCf0qWZwd3sGHVYer1MnR2mHYqU84QPlW3nrHwJjkrpq3+q0JcBY6GsJs+RskHNtkMTKV05Iz6QUI5YZGwTpuXaRm036SmavjGc4IDlMaYCk/NmbB9BKpthJxLdUpczOHpnjXXHziotWD6cfEnbjU3byfD8HY5WrxSjsNT7SKmXN3hRof7bk985ewQVjGT42O3NbnfnqjQQWr/B7/zFTpLR4f526Bkq12CdCyf5lvrbq+POkLVdJ+uFfR7ds248Ue/jBQy6kM1tWmKF9QiwisFlA84eQ4CW3I93Rp97URv+AQa9zmbD0Ve3Udp+g6nF5I=
|
secure: a9dbZchocqeuOViwUeNH54bQR5Sz7rEYXx5b9WPFtnFn9LGKKUaLbA2U91UQ9QKPrcTpsALubUYbw2CnNmvCwzaY+R8lCD3gkU4ohsEnbpnw3deOeixI74sqBHJAuCH9FSaRDGILoBMtUKx2xlzIymFxkIsgIukkGbdkWHDlRWY3oTUUuw1SQ2Xk9KDsbJQtjIc1+G/O6gHaV4qv/R9W8NPmJExKTNDrAZbC1vIUnxqp4UpVo1hst8qPd1at94CndDYM5rG+7imGbdtxTxzamt819qdTO1OfvtctKawNAm7YXZrrWft6c7gI6j6SI4hxd+ZrrPBqbaRFHkZHjnNssO/yn4SaOHFFzccmu0MzvpPCf0qWZwd3sGHVYer1MnR2mHYqU84QPlW3nrHwJjkrpq3+q0JcBY6GsJs+RskHNtkMTKV05Iz6QUI5YZGwTpuXaRm036SmavjGc4IDlMaYCk/NmbB9BKpthJxLdUpczOHpnjXXHziotWD6cfEnbjU3byfD8HY5WrxSjsNT7SKmXN3hRof7bk985ewQVjGT42O3NbnfnqjQQWr/B7/zFTpLR4f526Bkq12CdCyf5lvrbq+POkLVdJ+uFfR7ds248Ue/jBQy6kM1tWmKF9QiwisFlA84eQ4CW3I93Rp97URv+AQa9zmbD0Ve3Udp+g6nF5I=
|
||||||
file: "./build/shlink_${TRAVIS_TAG#?}_dist.zip"
|
file: "./build/shlink_${TRAVIS_TAG#?}_dist.zip"
|
||||||
@ -49,3 +49,9 @@ deploy:
|
|||||||
on:
|
on:
|
||||||
tags: true
|
tags: true
|
||||||
php: 7.1
|
php: 7.1
|
||||||
|
- provider: script
|
||||||
|
script: bash data/travis/trigger_docker_build.sh
|
||||||
|
skip_cleanup: true
|
||||||
|
on:
|
||||||
|
tags: true
|
||||||
|
php: 7.1
|
||||||
|
@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file.
|
|||||||
|
|
||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org).
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org).
|
||||||
|
|
||||||
## [Unreleased]
|
## 1.15.1 - 2018-12-16
|
||||||
|
|
||||||
#### Added
|
#### Added
|
||||||
|
|
||||||
@ -15,6 +15,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|||||||
* [#312](https://github.com/shlinkio/shlink/issues/312) Now all config files both in `php` and `json` format are loaded from `config/params` folder, easing users to provided customizations to docker image.
|
* [#312](https://github.com/shlinkio/shlink/issues/312) Now all config files both in `php` and `json` format are loaded from `config/params` folder, easing users to provided customizations to docker image.
|
||||||
* [#226](https://github.com/shlinkio/shlink/issues/226) Updated how table are rendered in CLI commands, making use of new features in Symfony 4.2.
|
* [#226](https://github.com/shlinkio/shlink/issues/226) Updated how table are rendered in CLI commands, making use of new features in Symfony 4.2.
|
||||||
* [#321](https://github.com/shlinkio/shlink/issues/321) Extracted entities mappings from entities to external config files.
|
* [#321](https://github.com/shlinkio/shlink/issues/321) Extracted entities mappings from entities to external config files.
|
||||||
|
* [#308](https://github.com/shlinkio/shlink/issues/308) Automated docker image building.
|
||||||
|
|
||||||
#### Deprecated
|
#### Deprecated
|
||||||
|
|
||||||
|
5
build.sh
5
build.sh
@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
if [ "$#" -ne 1 ]; then
|
if [[ "$#" -ne 1 ]]; then
|
||||||
echo "Usage:" >&2
|
echo "Usage:" >&2
|
||||||
echo " $0 {version}" >&2
|
echo " $0 {version}" >&2
|
||||||
exit 1
|
exit 1
|
||||||
@ -10,7 +10,7 @@ fi
|
|||||||
version=$1
|
version=$1
|
||||||
builtcontent="./build/shlink_${version}_dist"
|
builtcontent="./build/shlink_${version}_dist"
|
||||||
projectdir=$(pwd)
|
projectdir=$(pwd)
|
||||||
[ -f ./composer.phar ] && composerBin='./composer.phar' || composerBin='composer'
|
[[ -f ./composer.phar ]] && composerBin='./composer.phar' || composerBin='composer'
|
||||||
|
|
||||||
# Copy project content to temp dir
|
# Copy project content to temp dir
|
||||||
echo 'Copying project files...'
|
echo 'Copying project files...'
|
||||||
@ -18,6 +18,7 @@ rm -rf "${builtcontent}"
|
|||||||
mkdir -p "${builtcontent}"
|
mkdir -p "${builtcontent}"
|
||||||
rsync -av * "${builtcontent}" \
|
rsync -av * "${builtcontent}" \
|
||||||
--exclude=data/infra \
|
--exclude=data/infra \
|
||||||
|
--exclude=data/travis \
|
||||||
--exclude=data/migrations_template.txt \
|
--exclude=data/migrations_template.txt \
|
||||||
--exclude=data/GeoLite2-City.mmdb \
|
--exclude=data/GeoLite2-City.mmdb \
|
||||||
--exclude=**/.gitignore \
|
--exclude=**/.gitignore \
|
||||||
|
20
data/travis/trigger_docker_build.sh
Normal file
20
data/travis/trigger_docker_build.sh
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Get latest commit in master, in plain text
|
||||||
|
LATEST_MASTER_COMMIT=$(curl -H "Accept: application/vnd.github.sha" -X GET https://api.github.com/repos/shlinkio/shlink-docker-image/commits/master)
|
||||||
|
|
||||||
|
# Create new tag and a ref to the tag, which will trigger image build on it
|
||||||
|
curl -u acelaya:${GITHUB_OAUTH_KEY} \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
--data "{ \"tag\": \"${TRAVIS_TAG}\", \"message\": \"${TRAVIS_TAG}\", \"object\": \"${LATEST_MASTER_COMMIT}\", \"type\": \"commit\" }" \
|
||||||
|
-X POST https://api.github.com/repos/shlinkio/shlink-docker-image/git/tags
|
||||||
|
curl -u acelaya:${GITHUB_OAUTH_KEY} \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
--data "{ \"ref\": \"refs/tags/${TRAVIS_TAG}\", \"sha\": \"${LATEST_MASTER_COMMIT}\" }" \
|
||||||
|
-X POST https://api.github.com/repos/shlinkio/shlink-docker-image/git/refs
|
||||||
|
|
||||||
|
# Trigger image build for "latest
|
||||||
|
curl -H "Content-Type: application/json" \
|
||||||
|
--data '{ "docker_tag": "latest" }' \
|
||||||
|
-X POST https://registry.hub.docker.com/u/shlinkio/shlink/trigger/${DOCKER_TRIGGER_TOKEN}/
|
Loading…
Reference in New Issue
Block a user