-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathtostaging.sh
More file actions
executable file
·34 lines (33 loc) · 825 Bytes
/
tostaging.sh
File metadata and controls
executable file
·34 lines (33 loc) · 825 Bytes
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
33
34
#!/bin/bash
STAGE_DIR=/data1/staging
VER=$(cat version.txt)
sudo docker save --output=$STAGE_DIR/pg.$VER.tar pg:$VER
sudo docker save --output=$STAGE_DIR/pgpool.$VER.tar pgpool:$VER
ID=$(sudo docker images -q pg:$VER | head -1)
cat <<EOF > $STAGE_DIR/content.yml
postgres:
name: pg
tag: $VER
file: pg.$VER.tar
id: $ID
EOF
ID=$(sudo docker images -q pgpool:$VER | head -1)
cat <<EOF >> $STAGE_DIR/content.yml
pgpool:
name: pgpool
tag: $VER
file: pgpool.$VER.tar
id: $ID
EOF
VER=$(cat manager/version.txt)
sudo docker save --output=$STAGE_DIR/manager.$VER.tar manager:$VER
ID=$(sudo docker images -q manager:$VER | head -1)
cat <<EOF >> $STAGE_DIR/content.yml
manager:
name: manager
tag: $VER
file: manager.$VER.tar
id: $ID
EOF
sudo chown pierre:pierre /data1/staging/*
sudo chmod 777 /data1/staging/*