How to use the taskcluster-client.PurgeCache function in taskcluster-client

To help you get started, we’ve selected a few taskcluster-client examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github taskcluster / taskcluster-tools / src / task-group-inspector / actions / index.js View on Github external
export const purge = (provisionerId, workerType, selectedCaches, successMessage) => {
  // Setup purgeCache
  const purgeCache = localStorage.credentials ?
    new taskcluster.PurgeCache({credentials: JSON.parse(localStorage.credentials)}) :
    new taskcluster.PurgeCache();

  return async dispatch => {
    dispatch(taskActionsInProgress(true));

    try {
      const promises = selectedCaches
        .map(cacheName => purgeCache.purgeCache(provisionerId, workerType, {cacheName}));

      await Promise.all(promises);

      dispatch(renderActionSuccess(successMessage));
      dispatch(taskActionsInProgress(false));
    } catch (err) {
      dispatch(renderActionError(err));
      dispatch(taskActionsInProgress(false));
github taskcluster / taskcluster / infrastructure / tooling / src / smoketest / checks / purgeCache.js View on Github external
run: async () => {
    let purge = new taskcluster.PurgeCache(taskcluster.fromEnvVars());
    const provisionerId = 'built-in';
    const workerType = 'succeed';
    const payload = {
      cacheName: 'smoketest-cache',
    };
    await purge.purgeCache(provisionerId, workerType, payload);
    const pretendWorker = await purge.purgeRequests(provisionerId, workerType);
    assert.equal(pretendWorker.requests[0].cacheName, payload.cacheName, "Error");
  },
});
github taskcluster / taskcluster / services / purge-cache / bin / verify-prod.js View on Github external
let config = require('typed-env-config');
let taskcluster = require('taskcluster-client');

let cfg = config({profile: 'verify'});

let purgeCache = new taskcluster.PurgeCache({
  ...cfg.taskcluster,
});

purgeCache.purgeCache(
  'verifyprovisioner',
  'verifyworker',
  {cacheName: 'verifycache'}
).catch(function(err) {console.log(err);});
github taskcluster / taskcluster / services / web-server / src / clients.js View on Github external
module.exports = options => ({
  auth: new Auth(options),
  github: new Github(options),
  hooks: new Hooks(options),
  index: new Index(options),
  purgeCache: new PurgeCache(options),
  queue: new Queue(options),
  secrets: new Secrets(options),
  queueEvents: new QueueEvents(options),
  notify: new Notify(options),
  workerManager: new WorkerManager(options),
});