Skip to content
Snippets Groups Projects
Commit 7a1d0ccc authored by Pernille Welle-Watne's avatar Pernille Welle-Watne
Browse files

change type

parent dfc23a81
No related branches found
No related tags found
5 merge requests!9Error 1,!7Boundary tests,!6Task 2 coverage test,!5Task 2 coverage test,!3Google calendar
variables:
HEROKU_APP_NAME: tdt4242-base
HEROKU_REGISTRY_IMAGE: registry.heroku.com/${HEROKU_APP_NAME}/web
image: python:3
test:
image: python:3
script:
# this configures Django application to use attached postgres database that is run on `postgres` host
- cd backend/secfit
......@@ -10,22 +11,24 @@ test:
- pip install -r requirements.txt
- python manage.py test
staging:
stage: staging
script:
- echo “Deploying the app”
- pip install docker-compose
- docker-compose build
- docker-compose up -d
image: docker:stable
services:
- docker:dind
stages:
- build_and_deploy
development:
type: deploy
image: ruby
build_and_deploy:
stage: build_and_deploy
script:
- apt-get update -qy
- apt-get install -y ruby-dev
- gem install dpl
- dpl --provider=heroku --app=$HEROKU_APP_NAME --api-key=$HEROKU_AUTH_TOKEN
only:
- master
- apk add --no-cache curl
- docker login -u _ -p $HEROKU_AUTH_TOKEN registry.heroku.com
- docker pull $HEROKU_REGISTRY_IMAGE || true
- docker build
--cache-from $HEROKU_REGISTRY_IMAGE
--tag $HEROKU_REGISTRY_IMAGE
--file ./Dockerfile
"."
- docker push $HEROKU_REGISTRY_IMAGE
- chmod +x ./release.sh
- ./release.sh
\ No newline at end of file
build:
docker:
web: Dockerfile
run:
- web: docker-compose build && docker-compose up -d
#!/bin/sh
IMAGE_ID=$(docker inspect ${HEROKU_REGISTRY_IMAGE} --format={{.Id}})
PAYLOAD='{"updates": [{"type": "web", "docker_image": "'"$IMAGE_ID"'"}]}'
curl -n -X PATCH https://api.heroku.com/apps/$HEROKU_APP_NAME/formation \
-d "${PAYLOAD}" \
-H "Content-Type: application/json" \
-H "Accept: application/vnd.heroku+json; version=3.docker-releases" \
-H "Authorization: Bearer ${HEROKU_AUTH_TOKEN}"
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment