i'm new to skaffold and have setup the yaml file as below which should sync any changes in the src folder in my project to goolge cloud build. Please note Im not using git.
When I run skaffold dev any changes in the src folder on the local machine (macos) are synced to google cloud build i.e the image is updated and deployed.
If I make any changes within src folder while skaffold dev is running, I notice skaffold identifies the changes but are not deployed to google cloud build.
How can i update the below yaml file which will also deploy the changes to google cloud build everytime i make a change any file within src folder. Currently I have to stop skaffold and rerun it for the changes to be deployed in google cloud build.
package.json
{
"name": "auth",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "ts-node-dev src/index.ts"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@types/express": "^4.17.12",
"express": "^4.17.1",
"express-validator": "^6.12.0",
"ts-node-dev": "^1.1.6",
"typescript": "^4.3.4"
}
}
skaffold.yaml
apiVersion: skaffold/v2alpha3
kind: Config
deploy:
kubectl:
manifests:
- ./infra/k8s/*
build:
# local:
# push: false
googleCloudBuild:
projectId: ticketing-dev
artifacts:
- image: gcr.io/ticketing-dev/auth
context: auth
docker:
dockerfile: Dockerfile
sync:
manual:
- src: 'src/**/*.ts'
dest: .
Docker File
FROM node:alpine
#create working dir within image called app
WORKDIR /app
COPY package.json .
RUN npm install
COPY . .
CMD ["npm", "start"]
Below is auth-depl.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: auth-depl
spec:
replicas: 1
selector:
matchLabels:
app: auth
template:
metadata:
labels:
app: auth
spec:
containers:
- name: auth
image: gcr.io/ticketing-dev/auth
---
apiVersion: v1
kind: Service
metadata:
name: auth-srv
spec:
selector:
app: auth
ports:
- name: auth
protocol: TCP
port: 3000
targetPort: 3000