|
74 | 74 | PROCFILE="{}" |
75 | 75 | fi |
76 | 76 |
|
77 | | -if [[ ! -f /var/run/secrets/object/store/access-key-id ]]; then |
| 77 | +if [[ ! -f /var/run/secrets/object/store/access-key-id ]]; then |
78 | 78 | if $USING_DOCKERFILE ; then |
79 | 79 | l1=`grep -n "object-store" /etc/deis-dockerbuilder.yaml | head -n1 |cut -d ":" -f1` |
80 | 80 | l2=$(($l1+3)) |
|
97 | 97 |
|
98 | 98 | git archive --format=tar.gz ${GIT_SHA} > ${APP_NAME}.tar.gz |
99 | 99 |
|
| 100 | +HTTP_PREFIX="http" |
100 | 101 | # if minio is in the cluster, use it. otherwise use fetcher |
101 | 102 | # TODO: figure out something for using S3 also |
102 | 103 | if [[ -n "$DEIS_MINIO_SERVICE_HOST" && -n "$DEIS_MINIO_SERVICE_PORT" ]]; then |
103 | 104 | S3EP=${DEIS_MINIO_SERVICE_HOST}:${DEIS_MINIO_SERVICE_PORT} |
| 105 | +elif [[ -n "$DEIS_OUTSIDE_STORAGE_HOST" && -n "$DEIS_OUTSIDE_STORAGE_HOST" ]]; then |
| 106 | + HTTP_PREFIX="https" |
| 107 | + S3EP=${DEIS_OUTSIDE_STORAGE_HOST}:${DEIS_OUTSIDE_STORAGE_HOST} |
104 | 108 | elif [ -z "$S3EP" ]; then |
105 | 109 | S3EP=${HOST}:3000 |
106 | 110 | fi |
107 | 111 |
|
108 | | -TAR_URL=http://$S3EP/git/home/${SLUG_NAME}/tar |
109 | | -PUSH_URL=http://$S3EP/git/home/${SLUG_NAME}/push |
| 112 | +TAR_URL=$HTTP_PREFIX://$S3EP/git/home/${SLUG_NAME}/tar |
| 113 | +PUSH_URL=$HTTP_PREFIX://$S3EP/git/home/${SLUG_NAME}/push |
110 | 114 |
|
111 | 115 | sed -i -- "s#repo_name#$META_NAME#g" /etc/${SLUG_NAME}.yaml |
112 | 116 | sed -i -- "s#puturl#$PUSH_URL#g" /etc/${SLUG_NAME}.yaml |
113 | 117 | sed -i -- "s#tar-url#$TAR_URL#g" /etc/${SLUG_NAME}.yaml |
114 | 118 |
|
115 | 119 | ACCESS_KEY=`cat /var/run/secrets/object/store/access-key-id` |
116 | 120 | ACCESS_SECRET=`cat /var/run/secrets/object/store/access-secret-key` |
| 121 | +# copy the self signed cert into the CA directory for alpine. |
| 122 | +# note: we're not running minio with SSL at all right now, so no need for this. |
| 123 | +# future SSL rollouts for in-cluster storage may not need it either if we set up an intermediate CA |
| 124 | +# CERT_FILE="/var/run/secrets/object/ssl/access-cert" |
| 125 | +# cp $CERT_FILE /etc/ssl/certs/deis-minio-self-signed-cert.crt |
117 | 126 | mkdir -p /var/minio-conf |
118 | 127 | CONFIG_DIR=/var/minio-conf |
119 | | -echo "mc -C $CONFIG_DIR config host add "http://$S3EP" $ACCESS_KEY $ACCESS_SECRET" |
120 | | -mc -C $CONFIG_DIR --quiet config host add "http://$S3EP" $ACCESS_KEY $ACCESS_SECRET |
121 | | -mc -C $CONFIG_DIR --quiet mb "${S3EP}/git" |
122 | | -mc -C $CONFIG_DIR --quiet cp ${APP_NAME}.tar.gz $TAR_URL |
| 128 | +MC_PREFIX="mc -C $CONFIG_DIR --quiet" |
| 129 | +$MC_PREFIX config host all "$HTTP_PREFIX://$S3EP" $ACCESS_KEY $ACCESS_SECRET |
| 130 | +$MC_PREFIX mb "$HTTP_PREFIX://${S3EP}/git" |
| 131 | +$MC_PREFIX cp ${APP_NAME}.tar.gz $TAR_URL |
123 | 132 | echo "stored tarfile in $TAR_URL" |
124 | 133 |
|
125 | 134 | kubectl create -f /etc/${SLUG_NAME}.yaml |
|
0 commit comments