- date=`date +%Y%m%d_%H%M%S`
- cd /home/jenkins/workspace/frontend
- docker build -t feick/diagnosis-frontend:$date .
- echo "frontend current tag is $date"
- sed -i "s/\${date}/$(echo $date)/g" deployment.yaml
- kubectl apply -f deployment.yaml
- sed -i "s/\${date}/$(echo $date)/g" deployment-prod.yaml
- kubectl apply -f deployment-prod.yaml
- echo "build finish."
|