Skip to content

Commit

Permalink
Update IPS and remove tagging section
Browse files Browse the repository at this point in the history
  • Loading branch information
agentlecisco committed Sep 23, 2021
1 parent e9a0474 commit 12d7ae2
Showing 1 changed file with 24 additions and 25 deletions.
49 changes: 24 additions & 25 deletions labs/cicd-intro/3.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,38 @@
# CI/CD - Making Changes!

## 1. Change the APP

Making a change to our application is as simple as modifying our repository and committing the changes, CI/CD will take care of the rest.
Making a change to the application is as simple as modifying the repository and committing the changes, CI/CD takes care of the rest.

From our devbox edit index.html to say something else;
From the DevBox, edit the `index.html` file to contain something else;

```
-Warm regards from the CICD Learning Lab demo app!
+The warmest regards from the CICD Learning Lab demo app!
```

Then commit those changes to our GOGS git repository;
Then commit those changes to the GOGS git repository:

```
git add index.html
git commit -m "index text changes"
git push cicd master
git push cicd letsgo
# gogs credentials are test/test
```
This kicks off a new build in drone, notice that drone includes the git commit message from the change, in my case: "index text changes"
This kicks off a new build in Drone. Notice that Drone includes the Git commit message from the change, in this case, "index text changes".

![](assets/images/cichange1.png)

(Reminder, Drone UI is at: [http://10.10.20.25/test/cicd_example_repo/]()).
(Reminder, Drone UI is at: [http://10.10.20.25/test/cicd_example_repo/](http://10.10.20.25/test/cicd_example_repo/)).
<!--
Once the build has succeeded and turned green in Drone, however, the simple pipeline configuration uses the tag `latest` for all the builds. Kubernetes will not update the deployment from `latest` to `latest` as it looks the same.
Once the build has succeeded and turned green in drone, however, our simple pipeline configuration uses the tag `latest` for all our builds. Kubernetes will not update our deployment from `latest` to `latest` as it looks the same.
To make the changes reflect in production, most people use version tags instead of `latest`.
To make our changes reflect in production, most people use version tags instead of `latest`.

Since our pipeline configuration is just another file in our code repo, we can edit our CI configuration just as easily!
Since the pipeline configuration is just another file in the code repo, we can edit the CI configuration just as easily.
## 2. Change the CICD Pipeline
On our devbox, edit the `.drone.yml` file and replace the following lines:
On the DevBox, edit the `.drone.yml` file and replace the following lines:
```
tags: latest
Expand Down Expand Up @@ -71,34 +70,34 @@ pipeline:
tag: "${DRONE_BUILD_NUMBER}"
```
This will tell drone to use the drone current build number instead of the word `latest` for each of the docker images we produce.
This will tell Drone to use the Drone current build number instead of the word `latest` for each of the Docker images we produce.
git add and commit our drone changes, just like we did with `index.html`;
Next, use Git to add and commit the drone changes, just like we did with `index.html`;
```
git add .drone.yml
git commit -m "better pipeline"
git push cicd master
git push cicd letsgo
```
Going back to the drone UI, we can see the new build. By expanding the `publish` section in the UI, we can get a live feed of the commands being run; notice when we get to the point of uploading our new container image, it now has a version tag as a number, not just `latest`:
Going back to the drone UI, we can see the new build. By expanding the `publish` section in the UI, we can get a live feed of the commands being run; notice when we get to the point of uploading the new container image, it now has a version tag as a number, not just `latest`:
![](assets/images/latest9.png)
in my case, it's build `9`;
![](assets/images/build9.png)
## SUCCESS!
Going back to our Kubernetes UI, you will see from the "workloads" page that Kubernetes has now noticed the change from deployment version `latest` to deployment version `9` (or another number in your case).

Going back to the Kubernetes UI, you will see from the "workloads" page that Kubernetes has now noticed the change from deployment version `latest` to deployment version `9` (or another number in your case).
![](assets/images/k8supdate.png)
-->

Checking our app again via curl from the Kubernetes server, shows that with the new versioning, our new app content has finally been deployed!
Checking the app again via `curl` from the Kubernetes server, shows that with the new versioning, the new app content has finally been deployed!

```
[root@devbox cicd_learninglab_demo]# ssh root@10.10.20.1
root@10.10.20.1's password:
[developer@devbox cicd_learninglab_demo]# ssh developer@10.10.20.21
developer@10.10.20.21's password:
Last login: Tue Sep 19 10:14:18 2017 from devbox.abc.inc
[root@netmaster ~]# curl http://10.100.170.97
[developer@netmaster ~]# curl http://10.100.170.97
<html>
<header><title>CICD Learning Lab Demo App</title></header>
<body>
Expand All @@ -110,16 +109,16 @@ The warmest regards from the CICD Learning Lab demo app!
[root@netmaster ~]#
```

Future app changes take effect immediately with the following process, as we have proper version numbering for our Docker images:
Future app changes take effect immediately with the following process, as we have proper version numbering for the Docker images:

```
# edit index.html
git add index.html
git commit -m "new changes"
git push cicd master
git push cicd letsgo
```

Congratulations on building your first CI/CD pipeline with Docker, Drone and Git!
Congratulations on building your first CI/CD pipeline with Docker, Drone, and Git!

# More Information.
Drone has a wide number of existing plugins for testing, packaging and deployment targets, see the documentation pages here:
Expand Down

0 comments on commit 12d7ae2

Please sign in to comment.