mirror of
https://github.com/shlinkio/shlink.git
synced 2024-11-24 09:50:17 -06:00
Added scripts and configs to build docker image on travis
This commit is contained in:
parent
65fbb1dfb3
commit
644f5be6fe
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,6 +1,6 @@
|
|||||||
.idea
|
.idea
|
||||||
build
|
build
|
||||||
!hooks/build
|
!docker/build
|
||||||
composer.lock
|
composer.lock
|
||||||
composer.phar
|
composer.phar
|
||||||
vendor/
|
vendor/
|
||||||
|
@ -45,9 +45,13 @@ after_success:
|
|||||||
# Before deploying, build dist file for current travis tag
|
# Before deploying, build dist file for current travis tag
|
||||||
before_deploy:
|
before_deploy:
|
||||||
- rm -f ocular.phar
|
- rm -f ocular.phar
|
||||||
- ./build.sh ${TRAVIS_TAG#?}
|
- if [[ ! -z $TRAVIS_TAG ]]; then ./build.sh ${TRAVIS_TAG#?} ; fi
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
|
- provider: script
|
||||||
|
script: bash ./docker/build
|
||||||
|
on:
|
||||||
|
condition: $TRAVIS_PULL_REQUEST == 'false'
|
||||||
- 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=
|
||||||
|
@ -9,7 +9,7 @@ ENV LC_ALL "C"
|
|||||||
WORKDIR /etc/shlink
|
WORKDIR /etc/shlink
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
# Install mysl and calendar
|
# Install mysql and calendar
|
||||||
docker-php-ext-install -j"$(nproc)" pdo_mysql calendar && \
|
docker-php-ext-install -j"$(nproc)" pdo_mysql calendar && \
|
||||||
# Install sqlite
|
# Install sqlite
|
||||||
apk add --no-cache sqlite-libs sqlite-dev && \
|
apk add --no-cache sqlite-libs sqlite-dev && \
|
||||||
|
15
docker/build
Executable file
15
docker/build
Executable file
@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
|
||||||
|
|
||||||
|
# If there is a tag, regardless the branch, build that docker tag and also "stable"
|
||||||
|
if [[ ! -z $TRAVIS_TAG ]]; then
|
||||||
|
docker build --build-arg VERSION=${TRAVIS_TAG#?} -t shlinkio/shlink:${TRAVIS_TAG#?} -t shlinkio/shlink:stable .
|
||||||
|
docker push shlinkio/shlink:${TRAVIS_TAG#?}
|
||||||
|
docker push shlinkio/shlink:stable
|
||||||
|
# If build branch is develop, build latest (on master, when there's no tag, do not build anything)
|
||||||
|
elif [[ "$TRAVIS_BRANCH" == 'develop' ]]; then
|
||||||
|
docker build -t shlinkio/shlink:latest .
|
||||||
|
docker push shlinkio/shlink:latest
|
||||||
|
fi
|
10
hooks/build
10
hooks/build
@ -1,10 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
set -ex
|
|
||||||
|
|
||||||
if [[ ${SOURCE_BRANCH} == 'develop' ]]; then
|
|
||||||
SHLINK_RELEASE='latest'
|
|
||||||
else
|
|
||||||
SHLINK_RELEASE=${SOURCE_BRANCH#?}
|
|
||||||
fi
|
|
||||||
|
|
||||||
docker build --build-arg SHLINK_VERSION=${SHLINK_RELEASE} -t ${IMAGE_NAME} .
|
|
Loading…
Reference in New Issue
Block a user