- Basic pipeline
- Docker
- Surveillance, Alert and Metrics
- StatusCake
- Maven cache dependencies
- When you commit a change to app, it wont download all the dependencies again, the build will go faster.
- Terraform bug fixed
- Implemented a fix where Infrastructure will fail the second time it runs. Because git is complaining due to changes to commit. This fixed in
terraform apply
interraform.sh
file
- Implemented a fix where Infrastructure will fail the second time it runs. Because git is complaining due to changes to commit. This fixed in
You need to create account on these following websites:
Follow all these steps step by step
-
Fork repositories and download them
-
Generate RSA keys
- Open terminal and enter these commands
ssh-keygen -t rsa
- Enter filename for this key ->
deploy_key_app
and leave other options blank - Do the same step again and this filename should be
deploy_key_infra
and leave other options blank - You will noe get 4 files
deploy_key_app
deploy_key_app.pub
deploy_key_infra
deploy_key_infra.pub
- Use the
*.pub
public keys for Github repos, and for the other files follow steps in item 3 below.
- Open terminal and enter these commands
-
Credentials
-
Open infrastructure repository and find the file
credentials_example.yml
and rename this file tocredentials.yml
and add following credentials to this fields:deploy_key_infra
replace with yourdeploy_key_infra
file you madedeploy_key_app
replace with yourdeploy_key_app
file you madeheroku_email
replace XXX with your email registrated at Herokuheroku_api_key
replace XXX with your Heroku api keygithub_token
replace XXX with your Github tokenheroku_app_name
replace "gotrest" with a name you choosestatuscake_api_key
your StatusCake api keyheroku_graphite_ci
leave it blank for nowheroku_graphite_staging
leave it blank for nowheroku_graphite_production
leave it blank for now
-
Now open the
variables.tf
file- replace "gotrest" with the name you choosed in
heroku_app_name
incredentials.yml
file. - replace "gotrest-pipeline" with the name you choosed in
app_prefix
, eg:yourname-pipeline
- replace "gotrest" with the name you choosed in
-
Now open
statuscake.tf
file- at provider
statuscake
replace XXX with your email registred at StatusCake without '@' and without dot. This means if your email is e.g: [email protected] , replace XXX with 'examplemailcom'
- at provider
-
Now open
provider_heroku.tf
- replace XXX with email registred on Heroku
-
Now open
pipeline.yml
file- replace "XXX" to your forked repo URI´s
-
-
Run application
- When you have made all the changes in the item number 3 above you are ready to run the application. Do these following steps step by step
- Push the new changes to your Github repo
- Open terminal and run this command from root
docker-compose up
ordocker-compose up -d
for detached mode
- Open an another terminal and navigate to your infrastructure folder, run these commands and do following
fly -t devExam login --concourse-url http://127.0.0.1:8080 -u admin -p admin
fly -t devExam sp -c concourse/pipeline.yml -p ci+terraform -l credentials.yml
- Click on the following url provided in terminal
- enter
username
andpassword
, user and password is: admin - go back to terminal and run command
fly -t devExam unpause-pipeline -p ci+terraform
- navigate back to browser
- click on
infrastructure
job and trigger build, thebuild
job will start automatically - when
infrastructure
job is finished (green box) thenheroku-set-config-vars
wil automatically start - when
build
is finished (green box) thendeploy-ci-app
will automatically start - infrastructure is build and app is deployed
- open Heroku and navigate to the pipeline which has been created by infrastructure. You will see following three apps:
ci
,staging
andproduction
- now go into each of them and click on
Hosted Graphite
addon and a new page will pop up. Click onMetrics from your code
and copy the url between "nc" and "2003". Copy all url´s from each ofci
,staging
andproduction
and paste them intocredentials.yml
file inside infrastructure folder at the bottom of the file. Be careful and addci
toheroku_graphite_ci
field. Do same with the other two. - When they are added, run this command in terminal again from infrastructure folder
fly -t devExam sp -c concourse/pipeline.yml -p ci+terraform -l credentials.yml
- go back to broswer, click on
heroku-set-config-vars
and trigger the build - After all these steps are done, you can now open the app on Heroku from
ci
app. It will not show anything because this is a rest api. But you can try all the following url below by adding it after Heroku url as shown below.
- When you have made all the changes in the item number 3 above you are ready to run the application. Do these following steps step by step
HTTP | Endpoint | Surveillance, Alert and Metrics |
---|---|---|
GET by charactername | /gotrest/api/gameofthrones?characterName={characterName}&limit=1&offset=0 e.g: Arya Stark |
Counter & Timer |
GET by search | /gotrest/api/gameofthrones?limit={int}&offset={int}&search={search} |
Counter & Timer |
GET by id | /gotrest/api/gameofthrones/{id} |
Meter |
DELETE by id | /gotrest/api/gameofthrones/{id} try on Postman |
Meter |
PUT update by id | /gotrest/api/gameofthrones/{id} make a get request, use the fields and try PUT method on Postman |
Meter |
POST by id | /gotrest/api/gameofthrones make a get request, use the fields and try POST method on Postman |
Meter |
- Try make changes on application and make a git push
- You will now see
build
job is triggered automatically, it may take a little time, be patience - Notice how fast
build
job is executed because of maven dependencies
- You will now see