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: variables:
HEROKU_APP_NAME: tdt4242-base HEROKU_APP_NAME: tdt4242-base
HEROKU_REGISTRY_IMAGE: registry.heroku.com/${HEROKU_APP_NAME}/web
image: python:3
test: test:
image: python:3
script: script:
# this configures Django application to use attached postgres database that is run on `postgres` host # this configures Django application to use attached postgres database that is run on `postgres` host
- cd backend/secfit - cd backend/secfit
...@@ -10,22 +11,24 @@ test: ...@@ -10,22 +11,24 @@ test:
- pip install -r requirements.txt - pip install -r requirements.txt
- python manage.py test - python manage.py test
staging: image: docker:stable
stage: staging services:
script: - docker:dind
- echo “Deploying the app”
- pip install docker-compose
- docker-compose build
- docker-compose up -d
stages:
- build_and_deploy
development: build_and_deploy:
type: deploy stage: build_and_deploy
image: ruby
script: script:
- apt-get update -qy - apk add --no-cache curl
- apt-get install -y ruby-dev - docker login -u _ -p $HEROKU_AUTH_TOKEN registry.heroku.com
- gem install dpl - docker pull $HEROKU_REGISTRY_IMAGE || true
- dpl --provider=heroku --app=$HEROKU_APP_NAME --api-key=$HEROKU_AUTH_TOKEN - docker build
only: --cache-from $HEROKU_REGISTRY_IMAGE
- master --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