Travis script not picking up file

  docker, travis-ci

I’m running a travis script as follows:

1   sudo: required
  1 language: clojure
  2 services:
  3   - docker
  4 env:
  5   global:
  6     - SHA=$(git rev-parse HEAD)
  7     - CLOUDSDK_CORE_DISABLE_PROMPTS=1
  8 before_install:
  9   - openssl aes-256-cbc -K $encrypted_9f3b5599b056_key -iv $encrypted_9f3b55    99b056_iv -in service-account.json.enc -out service-account.json -d
 10   - curl https://sdk.cloud.google.com | bash > /dev/null;
 11   - source $HOME/google-cloud-sdk/path.bash.inc
 12   - gcloud components update kubectl
 13   - gcloud auth activate-service-account --key-file=service-account.json
 14   - gcloud config set project humboi-299117
 15   - gcloud config set compute/zone us-west1-a
 16   - gcloud container clusters get-credentials humboi-cluster
 17   - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-    stdin
 18 deploy:
 19   provider: script
 20   script: bash ./deploy.sh
 21   on:
 22     branch: contract

where deploy.sh is:

1   lein uberjar
  1 docker build . -t prikshet/main-server:latest -t prikshet/main-server:$SHA -    f deployment/Dockerfile
  2 docker push prikshet/main-server:latest
  3 docker push prikshet/main-server:$SHA
  4 kubectl apply -f deployment/k8s
  5 kubectl set image deployments/main-server-deployment server=prikshet/main-server:$SHA

And basically lein uberjar is supposed to create a jar that the prikshet/main-server image is supposed to pick up:

1   FROM openjdk:11
  1 RUN apt-get update
  2 RUN apt-get -y install npm
  3 RUN npm install -g shadow-cljs
  4 COPY target/uberjar/humboi.jar .
  5 CMD java -jar humboi.jar

However I get this error in travis:

Step 5/6 : COPY target/uberjar/humboi.jar .
COPY failed: stat /var/lib/docker/tmp/docker-builder693597080/target/uberjar/humboi.jar: no such file or directory

How to fix this?

Source: Docker Questions

LEAVE A COMMENT