forked from Ivasoft/github-actions
Test if docker API 1.25 has Mounts. Upgrade act so that --container-options is supported
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -3,7 +3,7 @@ FROM docker:dind
|
|||||||
ENV DOCKER_HOST=unix:///var/run/docker.sock
|
ENV DOCKER_HOST=unix:///var/run/docker.sock
|
||||||
|
|
||||||
RUN apk add --no-cache ca-certificates curl
|
RUN apk add --no-cache ca-certificates curl
|
||||||
RUN curl -s https://raw.githubusercontent.com/nektos/act/master/install.sh | sh -s v0.2.34
|
RUN curl -s https://raw.githubusercontent.com/nektos/act/master/install.sh | sh -s v0.2.48
|
||||||
|
|
||||||
ADD release/linux/amd64/plugin /bin/
|
ADD release/linux/amd64/plugin /bin/
|
||||||
ENTRYPOINT ["/usr/local/bin/dockerd-entrypoint.sh", "/bin/plugin"]
|
ENTRYPOINT ["/usr/local/bin/dockerd-entrypoint.sh", "/bin/plugin"]
|
||||||
@@ -133,7 +133,7 @@ func trace(cmd *exec.Cmd) {
|
|||||||
|
|
||||||
func getWorkDirPath(p Plugin, ctx context.Context) (string, string, error) {
|
func getWorkDirPath(p Plugin, ctx context.Context) (string, string, error) {
|
||||||
// Connect to the docker
|
// Connect to the docker
|
||||||
docker, err := docker.NewClient("unix://" + daemon.StdDockerSocketPath, "v1.40", nil, nil)
|
docker, err := docker.NewClient("unix://" + daemon.StdDockerSocketPath, "v1.25", nil, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", "", errors.Wrap(err, "failed to create docker client")
|
return "", "", errors.Wrap(err, "failed to create docker client")
|
||||||
}
|
}
|
||||||
@@ -145,24 +145,17 @@ func getWorkDirPath(p Plugin, ctx context.Context) (string, string, error) {
|
|||||||
return "", "", errors.Wrap(err, "failed to get our container id")
|
return "", "", errors.Wrap(err, "failed to get our container id")
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Fprintf(os.Stdout, "Container ID = %s\n", cntrId);
|
|
||||||
|
|
||||||
// Find the proper mount
|
// Find the proper mount
|
||||||
cwd, err := os.Getwd()
|
cwd, err := os.Getwd()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", "", errors.Wrap(err, "failed to locate the working directory in the container")
|
return "", "", errors.Wrap(err, "failed to locate the working directory in the container")
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Fprintf(os.Stdout, "CWD = %s\n", cwd);
|
|
||||||
|
|
||||||
cntr, err := docker.ContainerInspect(ctx, cntrId)
|
cntr, err := docker.ContainerInspect(ctx, cntrId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", "", errors.Wrap(err, "failed to inspect ourselves as a container")
|
return "", "", errors.Wrap(err, "failed to inspect ourselves as a container")
|
||||||
}
|
}
|
||||||
fmt.Fprintf(os.Stdout, "Container = %+v\n", cntr);
|
|
||||||
fmt.Fprintf(os.Stdout, "Mounts = %+v\n", cntr.Mounts);
|
|
||||||
for _, i := range cntr.Mounts {
|
for _, i := range cntr.Mounts {
|
||||||
fmt.Fprintf(os.Stdout, "\tDestination = %s\n", i.Destination);
|
|
||||||
if i.Destination == cwd {
|
if i.Destination == cwd {
|
||||||
return i.Source, i.Destination, nil
|
return i.Source, i.Destination, nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user