Fixes again

This commit is contained in:
Abdelhadi Khiati 2018-08-15 00:43:38 +01:00
parent 12219660c3
commit d984c4880c
2 changed files with 11 additions and 13 deletions

View file

@ -46,7 +46,7 @@ spec:
- companion
topologyKey: kubernetes.io/hostname
containers:
- image: docker.io/transloadit/uppy-companion:latest
- image: docker.io/kiloreux/uppy-companion:latest
imagePullPolicy: Always
name: companion
resources:
@ -56,7 +56,7 @@ spec:
memory: 2Gi
envFrom:
- configMapRef:
name: companion-env
name: uppy-companion-env
ports:
- containerPort: 3020
volumeMounts:

View file

@ -11,28 +11,26 @@ __companion="$(dirname "$(dirname "${__kube}")")"
# Install kubectl
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
mv ./kubectl ${HOME}/.local/bin/
# Store the new image in docker hub
docker build --quiet -t transloadit/companion:latest -t transloadit/companion:$TRAVIS_COMMIT .;
docker build --quiet -t kiloreux/uppy-companion:latest -t kiloreux/uppy-companion:$TRAVIS_COMMIT .;
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
docker push transloadit/companion:$TRAVIS_COMMIT;
docker push transloadit/companion:latest;
docker push kiloreux/uppy-companion:$TRAVIS_COMMIT;
docker push kiloreux/uppy-companion:latest;
echo $KUBECONFIG | base64 --decode -i > ${HOME}/.kube/config
# Should be already removed. Using it temporarily.
rm -f "${__kube}/companion/uppy-env.yaml"
echo $UPPY_ENV | base64 --decode > "${__kube}/companion/uppy-env.yaml"
rm -f "${__kube}/companion/companion-env.yaml"
echo $COMPANION_ENV | base64 --decode > "${__kube}/companion/companion-env.yaml"
kubectl config current-context
kubectl apply -f "${__kube}/companion/uppy-env.yaml"
kubectl apply -f "${__kube}/companion/companion-env.yaml"
sleep 10s # This cost me some precious debugging time.
kubectl apply -f "${__kube}/companion/companion-kube.yaml"
kubectl apply -f "${__kube}/companion/companion-redis.yaml"
kubectl set image statefulset companion --namespace=uppy companion=docker.io/transloadit/companion:$TRAVIS_COMMIT
kubectl set image statefulset companion --namespace=uppy companion=docker.io/kiloreux/uppy-companion:$TRAVIS_COMMIT
sleep 10s
kubectl get pods --namespace=uppy
@ -41,7 +39,7 @@ kubectl get deployment --namespace=uppy
function cleanup {
printf "Cleaning up...\n"
rm -vf "${__kube}/companion/uppy-env.yaml"
rm -vf "${__kube}/companion/companion-env.yaml"
printf "Cleaning done."
}