Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running skaffold dev in git repository without any commit fails #793

Closed
rvrignaud opened this issue Jul 4, 2018 · 1 comment
Closed
Assignees
Labels
kind/bug Something isn't working tagger/git

Comments

@rvrignaud
Copy link

Expected behavior

Running skaffold dev in directory after only git init but no git commit should work.

Actual behavior

skaffold dev fails if directory is git initialized but without any commit.

rvrignaud@cloudshell:~/awesomeapp (compute-demo-rvrignaud)$ git init
Initialized empty Git repository in /home/rvrignaud/awesomeapp/.git/
rvrignaud@cloudshell:~/awesomeapp (compute-demo-rvrignaud)$ skaffold dev
Starting build...
Building [eu.gcr.io/compute-demo-rvrignaud/awesomeapp]...
Sending build context to Docker daemon  3.072kB
Step 1/6 : FROM golang:1.10.1-alpine3.7 as builder
 ---> 52d894fca6d4
Step 2/6 : COPY main.go .
 ---> Using cache
 ---> 5b3ffcb7bc1f
Step 3/6 : RUN go build -o /app main.go
 ---> Using cache
 ---> a1d84c1ebe7c
Step 4/6 : FROM alpine:3.7
 ---> 3fd9065eaf02
Step 5/6 : CMD ./app
 ---> Using cache
 ---> ce226a815e25
Step 6/6 : COPY --from=builder /app .
 ---> Using cache
 ---> 49467bc49979
Successfully built 49467bc49979
Successfully tagged 65eded70661190241cccae3542c3b859:latest
Watching for changes...
ERRO[0000] dev: dev step: first run: exiting dev mode because the first build failed: generating tag: getting current revision: Running [git rev-parse HEAD]: stdout HEAD
, stderr: fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
, err: exit status 128: exit status 128
Cleaning up...
Cleanup complete in 130.510766ms

Information

  • Skaffold version: v0.9.0
  • Operating system: linux
  • Contents of skaffold.yaml:
apiVersion: skaffold/v1alpha2
kind: Config
build:
  artifacts:
  - imageName: eu.gcr.io/compute-demo-rvrignaud/awesomeapp
deploy:
  kubectl:
    manifests:
      - k8s-*
profiles:
  - name: gcb
    build:
      googleCloudBuild:
        projectId: compute-demo-rvrignaud

Steps to reproduce the behavior

1. cd skaffold_configured_directory
2. git init
3. skaffold dev
@rvrignaud rvrignaud changed the title Running skaffold dev in git repository without any commit fails Running skaffold dev in git repository without any commit fails Jul 4, 2018
@r2d4
Copy link
Contributor

r2d4 commented Jul 4, 2018

Looks like we solved the case where theres no repo, but didn't account for the case where theres a repo without a commit. Ref #663

@r2d4 r2d4 added kind/bug Something isn't working tagger/git labels Jul 4, 2018
@dgageot dgageot self-assigned this Jul 5, 2018
dgageot added a commit to dgageot/skaffold that referenced this issue Jul 5, 2018
@r2d4 r2d4 closed this as completed in #794 Jul 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working tagger/git
Projects
None yet
Development

No branches or pull requests

3 participants