File tree 4 files changed +53
-0
lines changed
4 files changed +53
-0
lines changed Original file line number Diff line number Diff line change 21
21
22
22
- DEVEL_COVER_OPTIONS="-ignore,^local/"
23
23
- PERL_CARTON_PATH=$HOME/local
24
+
25
+ - DOCKER_IMAGE_NAME=metacpan-api
24
26
matrix :
25
27
- CPAN_RESOLVER=metadb PERL_CARTON_PATH=$HOME/no-snapshot HARNESS_VERBOSE=1
26
28
- CPAN_RESOLVER=snapshot
@@ -83,6 +85,19 @@ after_success:
83
85
services :
84
86
- docker
85
87
88
+ # # Build and push a docker image in production
89
+ deploy :
90
+ - provider : script
91
+ script :
92
+ - deploy/build.sh
93
+ on :
94
+ branch : master
95
+ - provider : script
96
+ script :
97
+ - deploy/push.sh
98
+ on :
99
+ branch : master
100
+
86
101
# caching /local should save about 5 minutes in module install time
87
102
cache :
88
103
directories :
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ DEPLOY_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " > /dev/null 2>&1 && pwd ) "
4
+
5
+ source " ${DEPLOY_DIR} /vars.sh"
6
+
7
+ # ## Go to where the docker file is
8
+ cd " ${DEPLOY_DIR} /.."
9
+
10
+ # # Pull the latest docker file from docker hub if there is one
11
+ docker pull " $DOCKER_HUB_NAME " || true
12
+
13
+ # # Issue the build command, adding tags (from CONFIG.sh)
14
+ docker build --pull --cache-from " $DOCKER_HUB_NAME " --tag $DOCKER_HUB_NAME --tag $VERSION_TAG .
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ DEPLOY_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " > /dev/null 2>&1 && pwd ) "
4
+
5
+ source " ${DEPLOY_DIR} /vars.sh"
6
+
7
+ cd " ${DEPLOY_DIR} /.."
8
+
9
+ docker login -u " $DOCKER_HUB_USER " -p " $DOCKER_HUB_PASSWD "
10
+
11
+ docker push " $DOCKER_HUB_NAME "
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # # Edit this
4
+ if [ -z $DOCKER_IMAGE_NAME ]; then
5
+ echo " DOCKER_IMAGE_NAME is not defined"
6
+ exit 1;
7
+ fi
8
+
9
+ # # Should not need to edit this
10
+ export DOCKER_HUB_NAME=" metacpan/${DOCKER_IMAGE_NAME} "
11
+ export VERSION=" ${TRAVIS_BUILD_NUMBER:- UNKNOWN-BUILD-NUMBER} "
12
+ export VERSION_TAG=" ${DOCKER_HUB_NAME} :${VERSION} "
13
+
You can’t perform that action at this time.
0 commit comments