-
Notifications
You must be signed in to change notification settings - Fork 4
102 lines (95 loc) · 3.57 KB
/
docker.yml
File metadata and controls
102 lines (95 loc) · 3.57 KB
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
name: docker
on:
push:
paths:
- Dockerfile
- .github/workflows/docker.yml
- Makefile
# Rebuild it every monday at 3:25 AM for updating tools
schedule:
- cron: "25 3 * * 1"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Trigger for new openremote-cli version from the other workflow
repository_dispatch:
types: [image-build-event]
jobs:
# Cancel previous builds in case of a new build trigger
cleanup-runs:
runs-on: ubuntu-latest
steps:
- uses: rokroskar/workflow-run-cleanup-action@master
env:
GITHUB_TOKEN: "${{ secrets.REPO_ACCESS_TOKEN }}"
if: "!startsWith(github.ref, 'refs/tags/')"
build_image:
strategy:
fail-fast: false
max-parallel: 1
matrix:
python-version: [3.7]
poetry-version: [1.1.4]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: set up QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: all
- name: install buildx
id: buildx
uses: docker/setup-buildx-action@v1
with:
version: latest
install: true
- name: available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: login to docker hub
run: docker login --username "${{ secrets.DOCKERHUB_USER }}" --password "${{ secrets.DOCKERHUB_PASSWORD }}"
- name: build and push images
run: |
make multi-image
- name: push to AWS ECR
env:
AWS_REPOSITORY_URL: ${{ secrets.AWS_REPOSITORY_URL }}
run: |
aws configure set aws_access_key_id "${{ secrets.AWS_ID }}"
aws configure set aws_secret_access_key "${{ secrets.AWS_SECRET }}"
aws configure set default.region eu-west-1
docker login --username AWS --password $(aws ecr get-login-password --region eu-west-1) $AWS_REPOSITORY_URL
make lambda
- name: push to GitLab
run: |
docker login --username openremote --password ${{ secrets.GITLAB_PASSWORD}} registry.gitlab.com
docker tag openremote/openremote-cli:latest registry.gitlab.com/developers110/overview
docker push registry.gitlab.com/developers110/overview
test_image:
runs-on: ubuntu-latest
needs: [build_image]
steps:
- name: test docker image
run: |
docker run --rm openremote/openremote-cli --version --dry-run --no-telemetry
# docker run --rm -v $(pwd):/root/.openremote openremote/openremote-cli manager -t --quit -v --test-http-rest --quiet --login -p ${{ secrets.SETUP_ADMIN_PASSWORD }} --dnsname staging.demo.openremote.io
# # This is a shortcut to the above command
# docker run --rm --entrypoint or-test-http-rest -v $(pwd):/root/.openremote openremote/openremote-cli
# cat config.ini
- uses: actions/setup-python@v2
with:
python-version: 3.9
- name: install openremote-cli
run: |
pip3 install openremote-cli
openremote-cli -V -t
- name: deploy openremote stack on localhost and run UI test
run: |
wget -nc https://raw.githubusercontent.com/openremote/openremote/master/docker-compose.yml
docker-compose up -d
# openremote-cli deployment to localhost is broken (TODO check env variables)
# openremote-cli deploy -t -v
sleep 60
docker ps
or-test-http-rest --dnsname localhost --password secret -vv
timeout-minutes: 30
continue-on-error: true