Free Style Pipeline in Jenkins
Step 1: Install Jenkins and Access the Dashboard
- Ensure Jenkins is installed and running. You can access it via
http://<your_server_ip>:8080(default port). - Log in to the Jenkins dashboard with your credentials.
Step 2: Create a New Job
- On the Jenkins dashboard, click "New Item".
- In the "Enter an item name" field, provide a name for your pipeline (e.g.,
MyFreestylePipeline). - Select "Freestyle project" and click "OK".
Step 3: Configure the Job
- In the General section, add a description (optional).
- Check "Discard old builds" if you want to limit the number of builds stored.
- (Optional) Check "Restrict where this project can be run" and specify a label if you want to run this job on specific nodes.
Step 4: Configure Source Code Management
- In the Source Code Management section:
- Select "Git" (or other version control).
- Enter your repository URL.
- Provide credentials if necessary
Step 5: Add Build Steps
- In the Build section, click "Add build step".
- Choose a build step based on your requirements:
- Execute shell: Use shell commands (Linux/Mac).
- Execute Windows batch command: Use batch commands (Windows).
- Invoke Ant/Gradle: For Java-based builds.
Example for a shell script:
Comments
Post a Comment