-
Notifications
You must be signed in to change notification settings - Fork 3
168 lines (138 loc) · 5.09 KB
/
release.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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
name: Production Build
on:
push:
# Publish semver tags as releases.
tags: [ '*.*.*' ]
jobs:
consumer-gateway:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Build consumer_gateway
run: |
ls -la
export BUILD_NF_COMPOSE_DOCKER_TAG=$(bash version.sh)
cd consumer_gateway
ARGS='--no-cache' exec bash build_production.sh
- name: Push consumer_gateway
run: |
ls -la
export BUILD_NF_COMPOSE_DOCKER_TAG=$(bash version.sh)
cd consumer_gateway
ARGS='--no-cache' exec bash push_production.sh
skipper-proxy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Build skipper_proxy
run: |
ls -la
export BUILD_NF_COMPOSE_DOCKER_TAG=$(bash version.sh)
cd skipper_proxy
ARGS='--no-cache' exec bash build_production.sh
- name: Push skipper_proxy
run: |
ls -la
export BUILD_NF_COMPOSE_DOCKER_TAG=$(bash version.sh)
cd skipper_proxy
ARGS='--no-cache' exec bash push_production.sh
skipper:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Print environment variables
run: |
printenv
# build this here (without pushing, so the integration tests work)
- name: Build skipper_proxy
run: |
ls -la
export BUILD_NF_COMPOSE_DOCKER_TAG=$(bash version.sh)
cd skipper_proxy
ARGS='--no-cache' exec bash build_production.sh
- name: Setup Devenv
run: |
bash setup_devenv.sh
- name: "Run Setup for CI"
run: |
cd skipper
exec python3 build.py setup
- name: "Build Skipper"
run: |
echo "will build version $(bash version.sh)"
export SKIPPER_DOCKER_IMAGE="ghcr.io/${{ github.repository_owner }}/nfcompose-skipper:$RELEASE_VERSION"
export SKIPPER_PROXY_DOCKER_IMAGE="ghcr.io/${{ github.repository_owner }}/nfcompose-skipper-proxy:$RELEASE_VERSION"
cd skipper
exec python3 build.py \
build \
--imageName ghcr.io/${{ github.repository_owner }}/nfcompose-skipper \
--buildBase
- name: "Run client Tests"
run: |
export NFCOMPOSE_SETUP_SKIP_PULL="yes"
export COMPOSE_PROJECT_NAME="ci_test_unit_tests"
export SKIPPER_DOCKER_IMAGE="ghcr.io/${{ github.repository_owner }}/nfcompose-skipper:$RELEASE_VERSION"
export SKIPPER_PROXY_DOCKER_IMAGE="ghcr.io/${{ github.repository_owner }}/nfcompose-skipper-proxy:$RELEASE_VERSION"
cd client
bash ci_test.sh || exit 1
- name: Push skipper_proxy
run: |
ls -la
export BUILD_NF_COMPOSE_DOCKER_TAG=$(bash version.sh)
cd skipper_proxy
ARGS='--no-cache' exec bash push_production.sh
- name: "Build client source release"
run: |
cd client
python3 -m venv venv
source venv/bin/activate
(bash install_dev_dependencies.sh && python3 setup.py sdist) || exit 1
# copy into separate file to prevent issues where the source and target are the same
mv dist/compose_client-2.3.1*.tar.gz dist/release.tar.gz
mv dist/release.tar.gz dist/compose_client-$RELEASE_VERSION.tar.gz
- name: "zip deploy/local folder"
run: |
cd deploy/local
zip -r deploy-local-$RELEASE_VERSION.zip ./
- name: "zip deploy/production folder"
run: |
cd deploy/production/docker-compose
zip -r deploy-production-docker-compose-$RELEASE_VERSION.zip ./
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
./client/dist/compose_client-*.tar.gz
deploy/local/deploy-local-*.zip
deploy/production/docker-compose/deploy-production-docker-compose-*.zip