~mser/emote-server

ref: 1.2.0 emote-server/.build.yml -rw-r--r-- 979 bytes
671a8f4cMichael Serajnik Merge branch 'release/1.2.0' 7 months ago
                                                                                
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
image: alpine/latest
packages:
  - docker
  - nodejs
sources:
  - https://git.sr.ht/~mser/emote-server
environment:
  project: emote-server
  docker_image: mserajnik/emote-server
  docker_username: mserajnik
secrets:
  - 2be455df-9ff9-4803-bf5e-2c65d9d986a5
tasks:
  - skip_if_not_release: |
      cd $project
      git describe --exact-match HEAD || complete-build
  - setup: |
      sudo addgroup $(whoami) docker
      sudo service docker start
  - build: |
      cd $project

      version=$(node -e "console.log(require('./package.json').version)")

      set +e

      docker_ps_return=1
      until [ ${docker_ps_return} -eq 0 ]; do
        docker ps >/dev/null 2>&1
        docker_ps_return=$?
        sleep 1
      done

      set -e

      docker build . -t $docker_image:latest -t $docker_image:$version
  - publish: |
      cat ~/.docker-hub-personal-access-token | docker login --username $docker_username --password-stdin
      docker push $docker_image --all-tags