[auto] Fix missing yaml block marker
[releng.git] / jjb / pharos / pharos.yaml
1 ---
2 - project:
3     name: pharos
4
5     project:
6       - '{name}'
7       - '{name}-tools'
8
9     disabled: false
10
11     jobs:
12       - '{project}-verify-basic'
13       - 'backup-pharos-dashboard'
14       - 'deploy-pharos-dashboard':
15           disabled: true
16
17 - job-template:
18     name: 'backup-pharos-dashboard'
19
20     disabled: '{obj:disabled}'
21
22     parameters:
23       - 'pharos-dashboard-defaults'
24
25     triggers:
26       - timed: '@daily'
27
28     builders:
29       - shell: |
30           BACKUP_DIR=$HOME/backups/
31           TMP_DIR=$HOME/tmp/
32           mkdir -p $BACKUP_DIR
33           echo "-- $(date +%Y%m%d) --"
34           echo "Backing up Pharos Dashboard data..."
35           sudo docker run --rm \
36             -v pharos-data:/pharos-data:ro \
37             -v $TMP_DIR:/backup \
38             alpine \
39             tar -czf /backup/pharos-dashboard-db-$(date +%Y%m%d).tar.gz -C /pharos-data ./
40           sudo mv $TMP_DIR/pharos-dashboard-db-$(date +%Y%m%d).tar.gz $BACKUP_DIR
41           sudo chown $USER:$USER $BACKUP_DIR/pharos-dashboard-db-$(date +%Y%m%d).tar.gz
42           echo "...complete"
43
44 - job-template:
45     name: 'deploy-pharos-dashboard'
46
47     disabled: '{obj:disabled}'
48
49     parameters:
50       - project-parameter:
51           project: 'pharos-tools'
52           branch: 'master'
53       - 'pharos-dashboard-defaults'
54
55     scm:
56       - git:
57           choosing-strategy: 'gerrit'
58           refspec: '$GERRIT_REFSPEC'
59           branches:
60             - 'origin/$BRANCH'
61           timeout: 15
62           credentials-id: '$SSH_CREDENTIAL_ID'
63           url: '$GIT_BASE'
64           skip-tag: true
65           wipe-workspace: false
66
67     triggers:
68       - gerrit:
69           server-name: 'gerrit.opnfv.org'
70           trigger-on:
71             - ref-updated-event
72             - comment-added-contains-event:
73                 comment-contains-value: '^redeploy$'
74           projects:
75             - project-compare-type: 'ANT'
76               project-pattern: 'pharos-tools'
77               branches:
78                 - branch-compare-type: 'ANT'
79                   branch-pattern: '**/master'
80
81     builders:
82       - shell: |
83           cp $HOME/config.env $WORKSPACE/dashboard
84           cp $HOME/rsa.pub $WORKSPACE/dashboard
85           cp $HOME/rsa.pem $WORKSPACE/dashboard
86           cd $WORKSPACE/dashboard
87           sudo docker-compose build
88           sudo docker-compose up -d