- 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 applyinterraform.shfile
- 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_appand leave other options blank - Do the same step again and this filename should be
deploy_key_infraand leave other options blank - You will noe get 4 files
deploy_key_appdeploy_key_app.pubdeploy_key_infradeploy_key_infra.pub
- Use the
*.pubpublic 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.ymland rename this file tocredentials.ymland add following credentials to this fields:deploy_key_infrareplace with yourdeploy_key_infrafile you madedeploy_key_appreplace with yourdeploy_key_appfile you madeheroku_emailreplace XXX with your email registrated at Herokuheroku_api_keyreplace XXX with your Heroku api keygithub_tokenreplace XXX with your Github tokenheroku_app_namereplace "gotrest" with a name you choosestatuscake_api_keyyour StatusCake api keyheroku_graphite_cileave it blank for nowheroku_graphite_stagingleave it blank for nowheroku_graphite_productionleave it blank for now
-
Now open the
variables.tffile- replace "gotrest" with the name you choosed in
heroku_app_nameincredentials.ymlfile. - 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.tffile- at provider
statuscakereplace XXX with your email registred at StatusCake without '@' and without dot. This means if your email is e.g: example@mail.com , replace XXX with 'examplemailcom'
- at provider
-
Now open
provider_heroku.tf- replace XXX with email registred on Heroku
-
Now open
pipeline.ymlfile- 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 upordocker-compose up -dfor 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 adminfly -t devExam sp -c concourse/pipeline.yml -p ci+terraform -l credentials.yml- Click on the following url provided in terminal
- enter
usernameandpassword, 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
infrastructurejob and trigger build, thebuildjob will start automatically - when
infrastructurejob is finished (green box) thenheroku-set-config-varswil automatically start - when
buildis finished (green box) thendeploy-ci-appwill 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,stagingandproduction - now go into each of them and click on
Hosted Graphiteaddon and a new page will pop up. Click onMetrics from your codeand copy the url between "nc" and "2003". Copy all url´s from each ofci,stagingandproductionand paste them intocredentials.ymlfile inside infrastructure folder at the bottom of the file. Be careful and addcitoheroku_graphite_cifield. 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-varsand trigger the build - After all these steps are done, you can now open the app on Heroku from
ciapp. 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
buildjob is triggered automatically, it may take a little time, be patience - Notice how fast
buildjob is executed because of maven dependencies
- You will now see
