Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tdt4242-base
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Åsmund Haugse
tdt4242-base
Commits
7a1d0ccc
Commit
7a1d0ccc
authored
4 years ago
by
Pernille Welle-Watne
Browse files
Options
Downloads
Patches
Plain Diff
change type
parent
dfc23a81
No related branches found
Branches containing commit
No related tags found
5 merge requests
!9
Error 1
,
!7
Boundary tests
,
!6
Task 2 coverage test
,
!5
Task 2 coverage test
,
!3
Google calendar
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+20
-17
20 additions, 17 deletions
.gitlab-ci.yml
heruko.yml
+0
-5
0 additions, 5 deletions
heruko.yml
release.sh
+11
-0
11 additions, 0 deletions
release.sh
with
31 additions
and
22 deletions
.gitlab-ci.yml
+
20
−
17
View file @
7a1d0ccc
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
This diff is collapsed.
Click to expand it.
heruko.yml
deleted
100644 → 0
+
0
−
5
View file @
dfc23a81
build
:
docker
:
web
:
Dockerfile
run
:
-
web
:
docker-compose build && docker-compose up -d
This diff is collapsed.
Click to expand it.
release.sh
0 → 100644
+
11
−
0
View file @
7a1d0ccc
#!/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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment