Skip to content

Commit

Permalink
add arg -w0 to base64, fix make deploy error (#799)
Browse files Browse the repository at this point in the history
* add arg -w0 to base64, fix make deploy error

* make deploy support in both Linux and MacOS

* fix unbound variable error in MacOS
  • Loading branch information
C0reFast authored and caicloud-bot committed Feb 27, 2019
1 parent a1f7bd5 commit 727342f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions manifests/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,15 @@ if [ -z ${AUTH+x} ]; then echo -e "$RED_COL Please provide auth with --auth=<aut
if [ -z ${VERSION+x} ]; then echo -e "$RED_COL Please provide version with --version=<version> $NORMAL_COL"; exit 1; fi
if [ -z ${PVC+x} ]; then echo -e "$RED_COL Please provide PVC with --pvc=<pvc> $NORMAL_COL"; exit 1; fi

if [[ "$OSTYPE" == "linux-gnu" ]]; then
BASE64_ARGS="-w0"
fi

DOCKER_CONFIG=$(cat <<-END
{
"auths": {
"${REGISTRY%/*}": {
"auth": "$(echo -n $AUTH | base64)"
"auth": "$(echo -n $AUTH | base64 ${BASE64_ARGS:-})"
}
}
}
Expand All @@ -64,7 +68,7 @@ if [ ! -e ./.generated ]; then
mkdir ./.generated
fi
sed -e "s/__REGISTRY__/${REGISTRY/\//\\/}/g" \
-e "s/__REGISTRY_AUTH__/$(echo $DOCKER_CONFIG | base64)/g" \
-e "s/__REGISTRY_AUTH__/$(echo $DOCKER_CONFIG | base64 ${BASE64_ARGS:-})/g" \
-e "s/__PVC__/${PVC}/g" \
-e "s/__VERSION__/${VERSION}/g" \
./cyclone.yaml.template > ./.generated/cyclone.yaml

0 comments on commit 727342f

Please sign in to comment.