Pushes the locally constructed Docker image to the supplied respository
@param repository tag, for example: 111111111.dkr.ecr.us-east-1.amazonaws.com/sample
@returns {Promise<any>}
18532
function pushImage(repository) {
    const commandLine = `docker push ${repository}`;
    return new Promise((resolve, reject) =>
        command(commandLine, (err, stdout) => {
            if (err) {
                reject(err);
            }
            resolve(stdout);
        })
    );
}
68354
def tag_image(self, repository=None, tag=None):
        
        if not (repository or tag):
            raise ValueError("You need to specify either repository or tag.")
        r = repository or self.name
        t = "latest" if not tag else tag
        self.d.tag(image=self.get_full_name(), repository=r, tag=t)
        return DockerImage(r, tag=t)
819738
def link_blob_into_repository(self, session, digest, source_repo, target_repo):
        
        self.log.debug("%s: Linking blob %s from %s to %s",
                       session.registry, digest, source_repo, target_repo)

        # Check that it exists in the source repository
        url = "/v2/{}/blobs/{}".format(source_repo, digest)
        result = session.head(url)
        if result.status_code == requests.codes.NOT_FOUND:
            self.log.debug("%s: blob %s, not present in %s, skipping",
                           session.registry, digest, source_repo)
            # Assume we don't need to copy it - maybe it's a foreign layer
            return
        result.raise_for_status()

        url = "/v2/{}/blobs/uploads/?mount={}&from={}".format(target_repo, digest, source_repo)
        result = session.post(url, data='')
        result.raise_for_status()

        if result.status_code != requests.codes.CREATED:
            # A 202-Accepted would mean that the source blob didn't exist and
            # we're starting an upload - but we've checked that above
            raise RuntimeError("Blob mount had unexpected status {}".format(result.status_code))
1348327
def build_from_dir(dir)
      image(::Docker::Image.build_from_dir(dir, &build_block))
      add_repository_tag
    rescue ::Docker::Error::DockerError => e
      DockerExceptionParser.new(e)
    end
422072
function(tag, confImage, callback) {

      grunt.log.subhead(actioning[action] + ' image [' + tag + ']');

      async.waterfall([

      // Step 1: search for a running container with the same image
      function(cb) {
        docker.listContainers({
          all : 1,
        // filters: (action !== 'unpause') ? '{"status":["running"]}' : null
        }, function(err, containers) {

          if (err) {
            return cb(err);
          }

          var container = null;

          for (var c = 0; c < containers.length; c++) {
            if (containers[c].Image.indexOf(utils.qualifiedImageName(tag,
                  options.registry, null)) === 0) {
              container = containers[c];
              break;
            }
          }

          cb(null, container);
        });
      },

      // Step 2: stop it
      function(container, cb) {
        if (container) {
          grunt.log.writeln("Found a matched container, " + action + " it.");

          var dockcontainer = docker.getContainer(container.Id);

          var opts = confImage.options && confImage.options[action] || {};
          dockcontainer[action](opts, function(e, stream) {
            if (stream && stream.readable) {
              stream.setEncoding('utf8');
              stream.on('error', cb);
              stream.on('end', cb);
              stream.on('data', grunt.log.write);
            } else {
              cb(e);
            }

          });
        } else {
          grunt.log.writeln("No matched container with this image.");
          cb(null);
        }
      }, ], callback);

    }
388694
function createTag(cb) {
  var newTagName = 'v1.0.0';

  git.tag({tag: newTagName, message: newTagName + ' release', annotated: true}, function(err) {
    if (err) {
      return cb(err);
    }
    
    git.push({tag: newTagName, remote: remote}, cb);
  });
}
1228971
public void pullImage(DockerImagePullStrategy pullStrategy, String imageName) throws InterruptedException {
        LOG.info("Pulling image {} with {} strategy...", imageName, pullStrategy);
        final List<Image> images = getDockerCli().listImagesCmd().withShowAll(true).exec();

        NameParser.ReposTag repostag = NameParser.parseRepositoryTag(imageName);
        // if image was specified without tag, then treat as latest
        final String fullImageName = repostag.repos + ":" + (repostag.tag.isEmpty() ? "latest" : repostag.tag);

        boolean hasImage = Iterables.any(
                images, image ->
                        nonNull(image.getRepoTags()) &&
                                Arrays.asList(image.getRepoTags()).contains(fullImageName)

        );

        boolean pull = hasImage ?
                pullStrategy.pullIfExists(imageName) :
                pullStrategy.pullIfNotExists(imageName);

        if (pull) {
            LOG.info("Pulling image '{}' {}. This may take awhile...", imageName,
                    hasImage ? "again" : "since one was not found");

            long startTime = System.currentTimeMillis();
            //Identifier amiId = Identifier.fromCompoundString(ami);
            getDockerCli().pullImageCmd(imageName).exec(new PullImageResultCallback()).awaitSuccess();
            long pullTime = System.currentTimeMillis() - startTime;
            LOG.info("Finished pulling image '{}', took {} ms", imageName, pullTime);
        }
    }
594011
function tag() {
  var v = 'v' + pkg.version;
  var message = 'Release ' + v;

  return gulp.src(["./package.json", "./bower.json"])
    .pipe(git.commit(message))
    .pipe(git.tag(v, message))
    ;
    // .pipe(git.push(remote, branch, {args: '--tags'}))
}
124203
async def tag(self, name: str, repo: str, *, tag: str = None) -> bool:
        
        params = {"repo": repo}

        if tag:
            params["tag"] = tag

        await self.docker._query(
            "images/{name}/tag".format(name=name),
            "POST",
            params=params,
            headers={"content-type": "application/json"},
        )
        return True
247804
def _push_new_tag_to_git(self):
        
        print("Pushing new version to git")            

        ## stage the releasefile and initfileb
        subprocess.call(["git", "add", self.release_file])
        subprocess.call(["git", "add", self.init_file])
        subprocess.call([
            "git", "commit", "-m", "Updating {}/__init__.py to version {}"\
            .format(self.package, self.tag)])

        ## push changes to origin <tracked branch>
        subprocess.call(["git", "push", "origin", self.branch])

        ## create a new tag for the version number on deploy
        if self.deploy:
            subprocess.call([
                "git", "tag", "-a", self.tag,
                "-m", "Updating version to {}".format(self.tag),
                ])
            subprocess.call(["git", "push", "origin"])
1138494
def __git_tag_push():
        
        command = ['git', 'push', 'origin', '--tags']
        Shell.msg('Pushing tags...')

        if APISettings.DEBUG:
            Git.__debug(command, True)

        if not call(command):
            return True
        return False
856689
function push() {
		Release.chdir( Release.dir.dist );

		console.log( "Pushing release to dist repo..." );
		Release.exec( "git push " + distRemote + " master --tags",
			"Error pushing master and tags to git repo." );

		// Set repo for npm publish
		Release.dir.origRepo = Release.dir.repo;
		Release.dir.repo = Release.dir.dist;
	}
970552
async function getTagCommit(githubRepo, tag) {
  const cachedResult = await renovateCache.get(
    cacheNamespace,
    getCacheKey(githubRepo, `tag-${tag}`)
  );
  // istanbul ignore if
  if (cachedResult) {
    return cachedResult;
  }
  let digest;
  try {
    const url = `https://api.github.com/repos/${githubRepo}/git/refs/tags/${tag}`;
    digest = (await ghGot(url)).body.object.sha;
  } catch (err) {
    logger.info(
      { githubRepo, err },
      'Error getting tag commit from GitHub repo'
    );
  }
  if (!digest) {
    return null;
  }
  const cacheMinutes = 120;
  await renovateCache.set(
    cacheNamespace,
    getCacheKey(githubRepo, `tag-${tag}`),
    digest,
    cacheMinutes
  );
  return digest;
}
826475
function _createManifest(){
        let file = repositoryPath + '/manifest.json';
        let manifest = {
            machines: {}
        };

        return new Promise(function(resolve, reject) {
            debug("Creating manifest file");
            jsonfile.writeFile(file, manifest, function (err) {
                if(err){
                    debug("Failed to create the manifest file");
                    reject(err);
                    return;
                }
                resolve();
            });
        });
    }
666792
protected void updateRepository(Repository value, String xmlTag, Counter counter, Element element)
   {
      Element root = element;
      Counter innerCount = new Counter(counter.getDepth() + 1);
      updateRepositoryPolicy(value.getReleases(), "releases", innerCount, root);
      updateRepositoryPolicy(value.getSnapshots(), "snapshots", innerCount, root);
      findAndReplaceSimpleElement(innerCount, root, "id", value.getId(), null);
      findAndReplaceSimpleElement(innerCount, root, "name", value.getName(), null);
      findAndReplaceSimpleElement(innerCount, root, "url", value.getUrl(), null);
      findAndReplaceSimpleElement(innerCount, root, "layout", value.getLayout(), "default");
   }
848393
public void addRemoteRepositoryByUrl(String url) throws NaetherException {
        try {
            addRemoteRepository(RepoBuilder.remoteRepositoryFromUrl(url));
        } catch (MalformedURLException e) {
            log.error( "Malformed url: {}", url, e);
            throw new NaetherException(e);
        }
    }
477617
async function fetch(repositoryUrl, execaOpts) {
  try {
    await execa('git', ['fetch', '--unshallow', '--tags', repositoryUrl], execaOpts);
  } catch (error) {
    await execa('git', ['fetch', '--tags', repositoryUrl], execaOpts);
  }
}