-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwercker.yml
124 lines (112 loc) · 4.01 KB
/
wercker.yml
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# Build definition
box: golang:1.8.3
build:
# The steps that will be executed on build
steps:
- create-file:
name: write build-manifest
filename: $WERCKER_SOURCE_DIR/build-manifest.yml
overwrite: true
content: |
git_repo: $WERCKER_GIT_REPOSITORY
git_branch: $WERCKER_GIT_BRANCH
git_commit: $WERCKER_GIT_COMMIT
git_owner: $WERCKER_GIT_OWNER
wercker_run: $WERCKER_RUN_URL
wercker_app: $WERCKER_APPLICATION_URL
- create-file:
name: write netrc
filename: $HOME/.netrc
content: machine github.com login $GITHUB_ACCESS_TOKEN
overwrite: true
hide-from-log: true
- setup-go-workspace
- script:
name: go version
code: |
go version
go env
# Get dependencies, test, and build
- script:
name: make (deps, test, build)
code: |
make
- script:
name: Save binaries
code: |
cd $GOPATH/src/$WERCKER_GIT_DOMAIN/$WERCKER_GIT_OWNER/$WERCKER_GIT_REPOSITORY
if [ -d server ]; then cd server; fi
if [ -f $WERCKER_GIT_REPOSITORY ]; then mv -v $WERCKER_GIT_REPOSITORY $WERCKER_OUTPUT_DIR/; fi
if [ -f server ]; then mv -v server $WERCKER_OUTPUT_DIR/$WERCKER_GIT_REPOSITORY; fi
if [ ! -f server && ! -f $WERCKER_GIT_REPOSITORY ]; then false; fi
git rev-parse --short HEAD > $WERCKER_OUTPUT_DIR/$WERCKER_GIT_REPOSITORY.build
git --no-pager show -s --format='%an <%ae>' $(git rev-parse HEAD) > $WERCKER_OUTPUT_DIR/$WERCKER_GIT_REPOSITORY.author
mv conf $WERCKER_OUTPUT_DIR/
mv iron.json $WERCKER_OUTPUT_DIR/
mv nuance/files $WERCKER_OUTPUT_DIR/
ls -laFl $WERCKER_OUTPUT_DIR/
after-steps:
- slack-notifier:
url: $SLACK_URL
notify_on: failed
deploy:
steps:
- script:
name: install iron cli
code: |
apt-get install -y curl
curl -sSL http://get.iron.io/cli | sh
- script:
name: upload to iron
code: |
echo 'Upload to iron'
for LANGUAGE_KEY in $LANGUAGE_KEYS
do
echo "Upload $LANGUAGE_KEY to iron"
iron --env=$IRON_ENV docker login -e $DOCKERHUB_EMAIL -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD
iron --env=$IRON_ENV register --config-file=$IRON_CONFIG --name=$IRON_WORKER_WORKER_NAME-$LANGUAGE_KEY veritone/$WERCKER_GIT_REPOSITORY:$WERCKER_GIT_COMMIT-$LANGUAGE_KEY
done
noop:
box: centos:7
steps:
- script:
name: noop
code: |
echo "noop"
docker-push:
box: centos:7
steps:
- script:
name: install nte
code: |
yum install -y https://s3.amazonaws.com/nuance.veritone.com/3.2.0/nte-3.2.0-201708010842.el6.x86_64.rpm
- script:
name: install language pack
code: |
yum install -y https://s3.amazonaws.com/nuance.veritone.com/language_packs/$LANGUAGE_PACK
- script:
name: transfer application
code: |
mkdir /app
mv $WERCKER_GIT_REPOSITORY /app/
mv files/LAC19856-7361859_nte.lic /usr/local/Nuance/Transcription_Engine/licenses/license.lic
mv files/config.template.yaml /var/local/Nuance/Transcription_Engine/config/config.template.yaml
chown nuance:nuance -R /usr/local/Nuance/Transcription_Engine/
mv files/mime.types /etc/mime.types
mv $WERCKER_GIT_REPOSITORY.build /app/
mv $WERCKER_GIT_REPOSITORY.author /app/
- script:
name: clean container
code: |
yum clean all
rm -f iron.json
ls -laFl
- internal/docker-push:
username: $DOCKERHUB_USERNAME
password: $DOCKERHUB_PASSWORD
tag: $WERCKER_GIT_COMMIT-$LANGUAGE_KEY
cmd: /app/task-nuance-containerized
repository: veritone/$WERCKER_GIT_REPOSITORY
registry: https://registry.hub.docker.com
env: "LANGUAGE_KEY=$LANGUAGE_KEY"
ports: "8080,8078"