forked from magma/magma
-
Notifications
You must be signed in to change notification settings - Fork 2
108 lines (93 loc) · 3.4 KB
/
agw-build-publish-container.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
# Copyright 2022 The Magma Authors.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: AGW Build & Publish Container
on:
push:
branches:
- master
- 'v1.*'
pull_request_target:
types: [ opened, reopened, synchronize ]
branches:
- master
- 'v1.*'
jobs:
agw-collect-matrix-success:
runs-on: ubuntu-latest
if: success()
needs: build-containers
steps:
- run: echo "Successfully built AGW containers."
agw-check-matrix-success:
runs-on: ubuntu-latest
if: always()
needs: agw-collect-matrix-success
steps:
- name: Check completion of all build steps
run: |
if [ "${{ needs.agw-collect-matrix-success.result }}" = "success" ];
then
exit 0
else
echo "Exit status of some previous job(s) was ${{ needs.agw-collect-matrix-success.result }}"
exit 1
fi
build-containers:
runs-on: ubuntu-latest
env:
DOCKER_REGISTRY: agw-ci.artifactory.magmacore.org
strategy:
fail-fast: false
matrix:
include:
- DOCKER_IMAGE: gateway_go
DOCKER_FILE: feg/gateway/docker/go/Dockerfile
- DOCKER_IMAGE: agw_gateway_python
DOCKER_FILE: lte/gateway/docker/services/python/Dockerfile
- DOCKER_IMAGE: agw_gateway_c
DOCKER_FILE: lte/gateway/docker/services/c/Dockerfile
steps:
- run: echo "DOCKER_REGISTRY=agw-test.artifactory.magmacore.org" >> $GITHUB_ENV
if: github.ref == 'refs/heads/master'
- run: echo "Publishing images to ${{ env.DOCKER_REGISTRY }}"
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # [email protected]
- uses: ./.github/workflows/composite/docker-builder-agw
with:
REGISTRY_USERNAME: ${{ secrets.JFROG_USERNAME }}
REGISTRY_PASSWORD: ${{ secrets.JFROG_PASSWORD }}
REGISTRY: ${{ env.DOCKER_REGISTRY }}
IMAGE: ${{ matrix.DOCKER_IMAGE }}
FILE: ${{ matrix.DOCKER_FILE }}
build-containers-ghz:
runs-on: ubuntu-latest
needs: build-containers
env:
DOCKER_REGISTRY: agw-ci.artifactory.magmacore.org
strategy:
fail-fast: false
matrix:
include:
- DOCKER_IMAGE: ghz_gateway_python
DOCKER_CONTEXT: lte/gateway/docker/ghz
- DOCKER_IMAGE: ghz_gateway_c
DOCKER_CONTEXT: lte/gateway/docker/ghz
steps:
- run: echo "DOCKER_REGISTRY=agw-test.artifactory.magmacore.org" >> $GITHUB_ENV
if: github.ref == 'refs/heads/master'
- run: echo "Publishing images to ${{ env.DOCKER_REGISTRY }}"
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # [email protected]
- uses: ./.github/workflows/composite/docker-builder-agw
with:
REGISTRY_USERNAME: ${{ secrets.JFROG_USERNAME }}
REGISTRY_PASSWORD: ${{ secrets.JFROG_PASSWORD }}
REGISTRY: ${{ env.DOCKER_REGISTRY }}
IMAGE: ${{ matrix.DOCKER_IMAGE }}
CONTEXT: ${{ matrix.DOCKER_CONTEXT }}