-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild_full.sh
executable file
·31 lines (25 loc) · 1.11 KB
/
build_full.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
#!/bin/bash -e
os_type=`uname`
if [ "${os_type}" == 'Darwin' ] ; then
grep_option='E'
else
grep_option='P'
fi
if [ ! $1 ] ; then
FOLIANT_VERSION=`curl https://raw.githubusercontent.com/foliant-docs/foliant/master/foliant/__init__.py | grep -${grep_option}o "\d+\.\d+\.\d+"`
else
FOLIANT_VERSION=$1
fi
echo "Building and pushing the full image for Foliant ${FOLIANT_VERSION}"
DOCKER_IMAGE_TAG=foliant/foliant:full
DOCKER_IMAGE_NUMBERED_TAG=foliant/foliant:${FOLIANT_VERSION}-full
GITHUB_REGISTRY_URL=ghcr.io
ORGANIZATION=foliant-docs
docker pull $GITHUB_REGISTRY_URL/$ORGANIZATION/foliant/foliant:pandoc
docker login $GITHUB_REGISTRY_URL
docker build --no-cache -t $DOCKER_IMAGE_TAG -t $DOCKER_IMAGE_NUMBERED_TAG -f Dockerfile-full ./ 2>&1 | tee ./build.log
docker tag $DOCKER_IMAGE_TAG $GITHUB_REGISTRY_URL/$ORGANIZATION/$DOCKER_IMAGE_TAG
docker push $GITHUB_REGISTRY_URL/$ORGANIZATION/$DOCKER_IMAGE_TAG
docker tag $DOCKER_IMAGE_NUMBERED_TAG $GITHUB_REGISTRY_URL/$ORGANIZATION/$DOCKER_IMAGE_NUMBERED_TAG
docker push $GITHUB_REGISTRY_URL/$ORGANIZATION/$DOCKER_IMAGE_NUMBERED_TAG
docker logout $GITHUB_REGISTRY_URL