Skip to content

Commit 84176ff

Browse files
authored
Merge pull request #105544 from TomArcherMsft/jenkins-task-380-aks
Move Jenkins files to Jenkins dir for repo migration (aks)
2 parents eae2c17 + dd13101 commit 84176ff

12 files changed

+34
-61
lines changed

.openpublishing.redirection.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48931,6 +48931,11 @@
4893148931
"source_path": "articles/container-instances/container-instances-jenkins.md",
4893248932
"redirect_url": "/azure/jenkins/container-instances-jenkins",
4893348933
"redirect_document_id": false
48934+
},
48935+
{
48936+
"source_path": "articles/aks/jenkins-continuous-deployment.md",
48937+
"redirect_url": "/azure/jenkins/jenkins-continuous-deployment",
48938+
"redirect_document_id": false
4893448939
}
4893548940
]
4893648941
}

articles/jenkins/index.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ landingContent:
6666
- linkListType: tutorial
6767
links:
6868
- text: Deploy from GitHub to AKS
69-
url: /azure/aks/jenkins-continuous-deployment?toc=/azure/jenkinstoc.json&bc=/azure/bread/toc.json
69+
url: jenkins-continuous-deployment.md
7070
- text: Deploy to AKS using blue/green pattern
7171
url: jenkins-aks-blue-green-deployment.md
7272
- text: Deploy using the Azure Dev Spaces plug-in

articles/aks/jenkins-continuous-deployment.md renamed to articles/jenkins/jenkins-continuous-deployment.md

Lines changed: 25 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -33,26 +33,26 @@ To complete this tutorial, you need these items:
3333

3434
- Basic understanding of Kubernetes, Git, CI/CD, and container images
3535

36-
- An [AKS cluster][aks-quickstart] and `kubectl` configured with the
37-
[AKS cluster credentials][aks-credentials]
36+
- An [AKS cluster](../aks/kubernetes-walkthrough.md) and `kubectl` configured with the
37+
[AKS cluster credentials](/cli/azure/aks#az-aks-get-credentials).
3838

39-
- An [Azure Container Registry (ACR) registry][acr-quickstart],
39+
- An [Azure Container Registry (ACR) registry](../container-registry/container-registry-get-started-azure-cli.md),
4040
the ACR login server name, and the AKS cluster configured to
41-
[authenticate with the ACR registry][acr-authentication]
41+
[authenticate with the ACR registry](../aks/cluster-container-registry-integration.md).
4242

4343
- The Azure CLI version 2.0.46 or later installed and configured.
4444
Run `az --version` to find the version. If you need to install or upgrade,
45-
see [Install Azure CLI][install-azure-cli].
45+
see [Install Azure CLI](/cli/azure/install-azure-cli).
4646

47-
- [Docker installed][docker-install] on your development system
47+
- [Docker installed](https://docs.docker.com/install/) on your development system
4848

49-
- A GitHub account, [GitHub personal access token][git-access-token],
49+
- A GitHub account, [GitHub personal access token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/),
5050
and Git client installed on your development system
5151

5252
- If you provide your own Jenkins instance rather
5353
than this sample scripted way to deploy Jenkins,
54-
your Jenkins instance needs [Docker installed and configured][docker-install]
55-
and [kubectl][kubectl-install].
54+
your Jenkins instance needs [Docker installed and configured](https://docs.docker.com/install/)
55+
and [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/).
5656

5757
## Prepare your app
5858

@@ -81,7 +81,7 @@ To create the container images needed for the sample application, use the *docke
8181
docker-compose up -d
8282
```
8383

84-
The required base images are pulled and the application containers built. You can then use the [docker images][docker-images] command to see the created image. Three images have been downloaded or created. The `azure-vote-front` image contains the application and uses the `nginx-flask` image as a base. The `redis` image is used to start a Redis instance:
84+
The required base images are pulled and the application containers built. You can then use the [docker images](https://docs.docker.com/engine/reference/commandline/images/) command to see the created image. Three images have been downloaded or created. The `azure-vote-front` image contains the application and uses the `nginx-flask` image as a base. The `redis` image is used to start a Redis instance:
8585

8686
```
8787
$ docker images
@@ -92,13 +92,13 @@ redis latest a1b99da73d05 7 days ago
9292
tiangolo/uwsgi-nginx-flask flask 788ca94b2313 9 months ago 694MB
9393
```
9494

95-
Before you can push the *azure-vote-front* container image to ACR, get your ACR login server with the [az acr list][az-acr-list] command. The following example gets the ACR login server address for a registry in the resource group named *myResourceGroup*:
95+
Before you can push the *azure-vote-front* container image to ACR, get your ACR login server with the [az acr list](/cli/azure/acr#az-acr-list) command. The following example gets the ACR login server address for a registry in the resource group named *myResourceGroup*:
9696

9797
```azurecli
9898
az acr list --resource-group myResourceGroup --query "[].{acrLoginServer:loginServer}" --output table
9999
```
100100

101-
Use the [docker tag][docker-tag] command to tag the image with the ACR login server name and a version number of `v1`. Provide your own `<acrLoginServer>` name obtained in the previous step:
101+
Use the [docker tag](https://docs.docker.com/engine/reference/commandline/tag/) command to tag the image with the ACR login server name and a version number of `v1`. Provide your own `<acrLoginServer>` name obtained in the previous step:
102102

103103
```console
104104
docker tag azure-vote-front <acrLoginServer>/azure-vote-front:v1
@@ -120,13 +120,13 @@ containers:
120120
image: microsoft/azure-vote-front:v1
121121
```
122122
123-
Next, use the [kubectl apply][kubectl-apply] command to deploy the application to your AKS cluster:
123+
Next, use the [kubectl apply](https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#apply) command to deploy the application to your AKS cluster:
124124
125125
```console
126126
kubectl apply -f azure-vote-all-in-one-redis.yaml
127127
```
128128

129-
A Kubernetes load balancer service is created to expose the application to the internet. This process can take a few minutes. To monitor the progress of the load balancer deployment, use the [kubectl get service][kubectl-get] command with the `--watch` argument. Once the *EXTERNAL-IP* address has changed from *pending* to an *IP address*, use `Control + C` to stop the kubectl watch process.
129+
A Kubernetes load balancer service is created to expose the application to the internet. This process can take a few minutes. To monitor the progress of the load balancer deployment, use the [kubectl get service](https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#get) command with the `--watch` argument. Once the *EXTERNAL-IP* address has changed from *pending* to an *IP address*, use `Control + C` to stop the kubectl watch process.
130130

131131
```console
132132
$ kubectl get service azure-vote-front --watch
@@ -138,7 +138,7 @@ azure-vote-front LoadBalancer 10.0.215.27 40.117.57.239 80:30747/TCP 2
138138

139139
To see the application in action, open a web browser to the external IP address of your service. The Azure vote application is displayed, as shown in the following example:
140140

141-
![Azure sample vote application running in AKS](media/aks-jenkins/azure-vote.png)
141+
![Azure sample vote application running in AKS](media/jenkins-continuous-deployment/azure-vote.png)
142142

143143
## Deploy Jenkins to an Azure VM
144144

@@ -178,7 +178,7 @@ A Jenkins environment variable is used to hold the ACR login server name. This v
178178
- On the left-hand side of the Jenkins portal, select **Manage Jenkins** > **Configure System**
179179
- Under **Global Properties**, select **Environment variables**. Add a variable with the name `ACR_LOGINSERVER` and the value of your ACR login server.
180180

181-
![Jenkins environment variables](media/aks-jenkins/env-variables.png)
181+
![Jenkins environment variables](media/jenkins-continuous-deployment/env-variables.png)
182182

183183
- When complete, click **Save** at the bottom of the Jenkins configuration page.
184184

@@ -188,7 +188,7 @@ To allow Jenkins to build and then push updated container images to ACR, you nee
188188

189189
### Create a service principal for Jenkins to use ACR
190190

191-
First, create a service principal using the [az ad sp create-for-rbac][az-ad-sp-create-for-rbac] command:
191+
First, create a service principal using the [az ad sp create-for-rbac](/cli/azure/ad/sp#az-ad-sp-create-for-rbac) command:
192192

193193
```azurecli
194194
$ az ad sp create-for-rbac --skip-assignment
@@ -204,7 +204,7 @@ $ az ad sp create-for-rbac --skip-assignment
204204

205205
Make a note of the *appId* and *password* shown in your output. These values are used in following steps to configure the credential resource in Jenkins.
206206

207-
Get the resource ID of your ACR registry using the [az acr show][az-acr-show] command, and store it as a variable. Provide your resource group name and ACR name:
207+
Get the resource ID of your ACR registry using the [az acr show](/cli/azure/acr#az-acr-show) command, and store it as a variable. Provide your resource group name and ACR name:
208208

209209
```azurecli
210210
ACR_ID=$(az acr show --resource-group myResourceGroup --name <acrLoginServer> --query "id" --output tsv)
@@ -230,7 +230,7 @@ Ensure that the credential kind is **Username with password** and enter the foll
230230

231231
When complete, the credentials form looks like the following example:
232232

233-
![Create a Jenkins credential object with the service principal information](media/aks-jenkins/acr-credentials.png)
233+
![Create a Jenkins credential object with the service principal information](media/jenkins-continuous-deployment/acr-credentials.png)
234234

235235
Click **OK** and return to the Jenkins portal.
236236

@@ -247,7 +247,7 @@ From the home page of your Jenkins portal, select **New item** on the left-hand
247247
1. Under **Bindings**, select **Add** > **Username and password (separated)**
248248
- Enter `ACR_ID` for the **Username Variable**, and `ACR_PASSWORD` for the **Password Variable**
249249

250-
![Jenkins bindings](media/aks-jenkins/bindings.png)
250+
![Jenkins bindings](media/jenkins-continuous-deployment/bindings.png)
251251

252252
1. Choose to add a **Build Step** of type **Execute shell** and use the following text. This script builds a new container image and pushes it to your ACR registry.
253253

@@ -275,7 +275,7 @@ Before you automate the job based on GitHub commits, first manually test the Jen
275275

276276
On the left-hand menu of the project, select **Build Now**.
277277

278-
![Jenkins test build](media/aks-jenkins/test-build.png)
278+
![Jenkins test build](media/jenkins-continuous-deployment/test-build.png)
279279

280280
The first build takes a minute or two as the Docker image layers are pulled down to the Jenkins server. Subsequent builds can use the cached image layers to improve the build times.
281281

@@ -292,7 +292,7 @@ With a successful manual build complete, now integrate GitHub into the Jenkins b
292292
1. Choose to **Add webhook**. For the *Payload URL*, enter `http://<publicIp:8080>/github-webhook/`, where `<publicIp>` is the IP address of the Jenkins server. Make sure to include the trailing /. Leave the other defaults for content type and to trigger on *push* events.
293293
1. Select **Add webhook**.
294294

295-
![Create a GitHub webhook for Jenkins](media/aks-jenkins/webhook.png)
295+
![Create a GitHub webhook for Jenkins](media/jenkins-continuous-deployment/webhook.png)
296296

297297
## Test the complete CI/CD pipeline
298298

@@ -318,30 +318,9 @@ When updated, save the file, commit the changes, and push these to your fork of
318318

319319
Once the build is complete, refresh your web browser of the sample Azure vote application. Your changes are displayed, as shown in the following example:
320320

321-
![Sample Azure vote in AKS updated by the Jenkins build job](media/aks-jenkins/azure-vote-updated.png)
321+
![Sample Azure vote in AKS updated by the Jenkins build job](media/jenkins-continuous-deployment/azure-vote-updated.png)
322322

323323
## Next steps
324324

325-
In this article, you learned how to use Jenkins as part of a CI/CD solution. AKS can integrate with other CI/CD solutions and automation tools, such as the [Azure DevOps Project][azure-devops] or [creating an AKS cluster with Ansible][aks-ansible].
326-
327-
<!-- LINKS - external -->
328-
[docker-images]: https://docs.docker.com/engine/reference/commandline/images/
329-
[docker-tag]: https://docs.docker.com/engine/reference/commandline/tag/
330-
[git-access-token]: https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/
331-
[kubectl-apply]: https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#apply
332-
[kubectl-get]: https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#get
333-
[docker-install]: https://docs.docker.com/install/
334-
[kubectl-install]: https://kubernetes.io/docs/tasks/tools/install-kubectl/
335-
336-
<!-- LINKS - internal -->
337-
[az-acr-list]: /cli/azure/acr#az-acr-list
338-
[acr-authentication]: cluster-container-registry-integration.md
339-
[acr-quickstart]: ../container-registry/container-registry-get-started-azure-cli.md
340-
[aks-credentials]: /cli/azure/aks#az-aks-get-credentials
341-
[aks-quickstart]: kubernetes-walkthrough.md
342-
[azure-cli-install]: /cli/azure/install-azure-cli
343-
[install-azure-cli]: /cli/azure/install-azure-cli
344-
[az-ad-sp-create-for-rbac]: /cli/azure/ad/sp#az-ad-sp-create-for-rbac
345-
[az-acr-show]: /cli/azure/acr#az-acr-show
346-
[azure-devops]: ../devops-project/azure-devops-project-aks.md
347-
[aks-ansible]: ../ansible/ansible-create-configure-aks.md
325+
> [!div class="nextstepaction"]
326+
> [Jenkins on Azure](/azure/jenkins)

0 commit comments

Comments
 (0)