mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-02-03 05:02:23 +00:00
Only grab the last part of the docker repo name
This commit is contained in:
parent
c14d65cf3e
commit
e0b2084f42
1 changed files with 3 additions and 1 deletions
|
@ -3,6 +3,7 @@ package publish
|
|||
import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/drone/drone/pkg/build/buildfile"
|
||||
"github.com/drone/drone/pkg/build/repo"
|
||||
|
@ -48,7 +49,8 @@ func (d *Docker) Write(f *buildfile.Buildfile, r *repo.Repo) {
|
|||
f.WriteCmd("sudo apt-get --yes install lxc-docker-" + d.DockerVersion)
|
||||
|
||||
dockerServerUrl := d.Server + ":" + strconv.Itoa(d.Port)
|
||||
dockerRepo := d.RepoBaseName + "/" + r.Name
|
||||
splitRepoName := strings.Split(r.Name, "/")
|
||||
dockerRepo := d.RepoBaseName + "/" + splitRepoName[len(splitRepoName) - 1]
|
||||
// Run the command commands to build and deploy the image. Note that the image is tagged
|
||||
// with the git hash.
|
||||
f.WriteCmd(fmt.Sprintf("docker -H %s build -t %s:$(git rev-parse --short HEAD) - < %s",
|
||||
|
|
Loading…
Reference in a new issue