Code Monkey home page Code Monkey logo

Comments (3)

terma avatar terma commented on August 17, 2024

Just wondering what is use case behind destroying after some build numbers?

from ec2-spot-jenkins-plugin.

major avatar major commented on August 17, 2024

@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.

lloydchang avatar lloydchang commented on August 17, 2024

Hi, @major; Cc: @terma

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.