Comments (3)
Just wondering what is use case behind destroying after some build numbers?
from ec2-spot-jenkins-plugin.
@terma Our team has a need for instances in EC2 that we only want to run one time (because we alter system configuration and install packages inside the instance). We also find that we end up with a mess in /tmp
or other directories after lots of jobs run, so it would be nice to stop the instance after a certain number of builds as well.
If there's a better way to destroy our running instance when the job is done, that would work for me, too.
from ec2-spot-jenkins-plugin.
Here's a workaround to add into your Jenkins job's Build: Execute shell:
#!/bin/bash -x
if [ "${BUILD_NUMBER}" -ge "100" ]; then
INSTANCE_ID=$(wget -q -O - http://169.254.169.254/latest/meta-data/instance-id)
aws ec2 terminate-instances --instance-ids ${INSTANCE_ID}
fi
for
• Destroy an instance when it has processed 100 builds (whether it is idle or not) (this does not exist today)
from ec2-spot-jenkins-plugin.
Related Issues (13)
- Multiple Spot Fleets Supported? HOT 1
- Deadlocking while spinning up a large spot fleet HOT 2
- Can you update jenkins-ci.org with latest code?
- Passing Credentials in Jenkins Slaves Launched Using Amazon EC2 Plugin
- The way to create on-demand instance? HOT 1
- Windows HOT 1
- Help !!! HOT 1
- Getting `Key value does not parse into a valid ssh-rsa key`
- Is the plugin deprecated? HOT 2
- Document IAM policy for Jenkins IAM role HOT 1
- Removed instances turn idle, triggering terminate, which crashes HOT 1
- Multiple fleets cause very strange behavior HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ec2-spot-jenkins-plugin.