-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathdocker_build.sh
executable file
·32 lines (23 loc) · 982 Bytes
/
docker_build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/sh
# perform flutter clean to clean all the current build
flutter clean
# perform the flutter pub get
# flutter pub get
# perform the flutter pub upgrade
# flutter pub upgrade
# rebuild the flutter web apps
# flutter build web --release --wasm -t lib/main.prod.dart --verbose
flutter build web --release -t lib/main.prod.dart --verbose
# build the docker based on the build
docker build -t adimartha/my_expense .
# once finished build then get the current tag from the environment file
tag=`cat conf/.prod.env | sed '2q;d' | awk -F "=" '{print $2}' | sed "s/['\"]//g" | awk -F "-" '{print $1}'`
echo current tag is $tag
# then tag the latest docker image to the current tag
echo tag latest image to $tag
docker image tag adimartha/my_expense:latest adimartha/my_expense:$tag
# push both of the image to the docker repo
echo push latest docker image
docker image push adimartha/my_expense:latest
echo push $tag docker image
docker image push adimartha/my_expense:$tag