You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This demo is a Python script that performs the following sequence of actions when run with the `install` command:
4
+
This demo is a Python script that, when run with the `install` command, will:
5
5
6
6
1. Installs Jenkins if it isn't already available.
7
+
8
+
Running the `pipeline` command will:
9
+
7
10
2. Sets up a series of build jobs, the necessary credentials and a [Build Pipeline](https://wiki.jenkins-ci.org/display/JENKINS/Build+Pipeline+Plugin) view to demonstrate a basic continuous delivery pipeline. Jenkins will:
8
11
+ Spin up a new Jenkins slave using the Mesos plugin. This slave runs inside a Docker container on one of our DCOS agents.
9
12
+ Clone the git repository
10
13
+ Build a Docker container based off the [Jekyll Docker image](https://hub.docker.com/r/jekyll/jekyll/) that includes the content stored in [/site](/site) and push it to DockerHub.
11
14
+ Run the newly created container and a [Linkchecker container](https://github.com/mesosphere/docker-containers/blob/master/utils/linkchecker/Dockerfile) that runs a basic integration test against the container, checking that the webserver comes up correctly and that all links being served are valid (i.e. no 404s).
12
15
+ Manually trigger a Marathon deployment of the newly created container to the DCOS base Marathon instance. If the application already exists, Marathon will simply upgrade it.
13
-
+ Make the application available on a public slave at port 80.
16
+
+ Make the application available on a public slave at port 80 using Marathon-lb.
17
+
18
+
When run with the `dynamic-slaves` command, it will:
19
+
14
20
3. Creates 50 build jobs that take a random amount of time between 1 and 2 minutes. These jobs will randomly fail.
15
21
+ The Mesos plugin will spin up build slaves on demand for these jobs, using as much capacity as your cluster has available.
16
22
+ When these jobs are finished, the Jenkins tasks will terminate and the resources will be relinquished back to other users of your cluster.
@@ -31,38 +37,64 @@ When run with the `uninstall` command, it will:
2. [Set up the DCOS CLI](https://docs.mesosphere.com/administration/introcli/cli/) locally.
35
-
3. Ensure you have a DCOS cluster available. 1 node will work but more than 1 node is preferable to demonstrate build parallelism. If you already had the CLI installed, make sure you set the new cluster URL and authenticate against it:
47
+
48
+
3. Ensure you have a DCOS cluster available. 1 node will work but more than 1 node is preferable to demonstrate build parallelism. If you already had the CLI installed, make you sure you set the new cluster URL and authenticate against it (else the script will complain):
36
49
37
50
```
38
51
dcos config set core.dcos_url http://my.dcos.cluster/
39
52
dcos auth login
40
53
```
54
+
4. Export the password to an environment variable (ideally put it in your ~/.bashrc). You will need to replace the password here with the password for the `cddemo` user with permission to push to `mesosphere/cd-demo-app` (or your own repo, if you override the `--org` and `--username` flags later):
55
+
56
+
```
57
+
export PASSWORD=mypass123
58
+
```
41
59
42
60
### Running Demo
43
61
44
-
1. Run the demo script. You will need to replace the password here with the password for the `cddemo` user with permission to push to `mesosphere/cd-demo-app`:
62
+
1. Run the install command. This is mainly a wrapper for the `dcos package install` command but will also check to see if you're authenticated.
NOTE: You must use the domain name for your cluster; the IP address will fail.
69
+
70
+
2. Check that the Jenkins UI is running before proceeding. You can now run either the pipeline demo or the dynamic slaves demo. To run the pipeline demo, grab the ELB address (`Public Slave`), and make sure to specify the branch to run against:
NOTE: Depending on your environment you may need to prepend the above command with `python` Also you must use the domain name for your cluster; the IP address will fail.
50
-
51
-
2. The script will install Jenkins and pause. Check that the Jenkins UI is running before hitting enter to proceed.
52
-
3. The script will now use the Jenkins HTTP API to install jobs, necessary credentials and a view. It will automatically trigger the initial build before pausing.
53
-
4. Navigate to the Jenkins UI to see the builds in progress. After a few seconds, you should see a build executor spinning up on Mesos. If you navigate to the configured view, you'll see the pipeline in progress.
54
-
5. Once the tests have completed successfully, you will need to manually deploy the build using the button in the bottom right of the "deploy" box on the view.
55
-

56
-
6. The deploy will happen almost instantaneously. After a few seconds, you should be able to load the application by navigating to your public slave's IP address in your browser.
75
+
76
+
3. The script will first install Marathon-lb if it looks like it isn't available. It will also update the `marathon.json` in the branch you specified to include the ELB hostname so that Marathon-lb can route to it.
77
+
4. The script will then use the Jenkins HTTP API to install jobs, necessary credentials and a view. It will automatically trigger the initial build before finishing.
78
+
5. Navigate to the Jenkins UI to see the builds in progress. After a few seconds, you should see a build executor spinning up on Mesos. If you navigate to the configured view, you'll see the pipeline in progress.
79
+
6. The deploy will happen almost instantaneously. After a few seconds, you should be able to load the application by navigating to the ELB hostname you provided earlier in your browser.
57
80

58
-
7. Hit Enter to proceed to the next step of the demo. It will create 50 jobs that will randomly fail.
81
+
7. Now let's run the dynamic slaves demo. It will create 50 jobs that will randomly fail.
8. Navigate back to the Jenkins and/or DCOS UI to show build slaves spinning up manually.
60
-
9. Hit enter to complete the demo.
61
88
62
89
### Uninstalling
63
90
64
91
1. Simply run the uninstall command to remove any persisted configuration and to uninstall the DCOS service itself. This will allow you to run multiple demos on the same cluster but you should recycle clusters if the version of the Jenkins package has changed (to ensure plugins are upgraded):
If you'd like to demonstrate the build running automatically with every commit:
84
-
85
-
1. By default this build operates off the `demo` branch. However, it's recommended that you create your own branches for demo purposes to avoid collisions. Create a new branch in this repository and push it up to origin:
115
+
1. Run the demo to completion with the `--branch` parameter to monitor your branch. The pipeline will continue to monitor your branch after the script finishes:
2. Run the demo to completion with the `--branch` parameter to monitor your branch. The pipeline will continue to monitor your branch after the script finishes:
Only want to run one of the demos? Simply specify `--no-pipeline` to skip the continuous delivery demo, or `--no-dynamic-slaves` to skip the dynamic slaves demo.
0 commit comments