forked from FromDoppler/Doppler-UI-System
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-n-publish-w-docker.sh
33 lines (26 loc) · 1.09 KB
/
build-n-publish-w-docker.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env bash
pkgName="doppler-ui-library"
pkgVersion=${1:-"v0.0.0-build0"}
cdnBaseUrl=${2:-"//cdn.fromdoppler.com/$pkgName"}
# Exit immediately if a command exits with a non-zero status.
set -e
# Lines added to get the script running in the script path shell context
# reference: http://www.ostricher.com/2014/10/the-right-way-to-get-the-directory-of-a-bash-script/
cd $(dirname $0)
# To avoid issues with MINGW y Git Bash, see:
# https://github.com/docker/toolbox/issues/673
# https://gist.github.com/borekb/cb1536a3685ca6fc0ad9a028e6a959e3
export MSYS_NO_PATHCONV=1
export MSYS2_ARG_CONV_EXCL="*"
sh ./build-w-docker.sh $pkgVersion $cdnBaseUrl
# Force pull the latest image version due to the cache not always is pruned immediately after an update is uploaded to docker hub
docker pull dopplerrelay/doppler-relay-akamai-publish
docker run --rm \
-e AKAMAI_CDN_HOSTNAME \
-e AKAMAI_CDN_USERNAME \
-e AKAMAI_CDN_PASSWORD \
-e AKAMAI_CDN_CPCODE \
-e "PROJECT_NAME=$pkgName" \
-e "VERSION_NAME=$pkgVersion" \
-v `pwd`/dist:/source \
dopplerrelay/doppler-relay-akamai-publish