-
Notifications
You must be signed in to change notification settings - Fork 2
126 lines (115 loc) · 3.73 KB
/
ci.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
#
# K2HDKC DBaaS based on Trove
#
# Copyright 2024 Yahoo Japan Corporation
#
# K2HDKC DBaaS is a Database as a Service compatible with Trove which
# is DBaaS for OpenStack.
# Using K2HR3 as backend and incorporating it into Trove to provide
# DBaaS functionality. K2HDKC, K2HR3, CHMPX and K2HASH are components
# provided as AntPickax.
#
# For the full copyright and license information, please view
# the license file that was distributed with this source code.
#
# AUTHOR: Takeshi Nakatani
# CREATE: Fri Dec 13 2024
# REVISION:
#
#------------------------------------------------------------------------------------
# Github Actions
#------------------------------------------------------------------------------------
name: AntPickax CI
#
# Events
#
on:
push:
pull_request:
#
# CRON event is fire on every sunday(UTC).
#
schedule:
- cron: '0 15 * * 0'
#
# Jobs
#
jobs:
troveimage:
runs-on: ubuntu-latest
#
# build matrix for containers
#
strategy:
#
# do not stop jobs automatically if any of the jobs fail
#
fail-fast: false
#
# matrix for containers
#
matrix:
#
# Specify the docker image type
#
imagetype:
- ubuntu
- alpine
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
#
# Login to avoid the Docker Hub rate limit
#
# Github Secret cannot be read in the case of Pull Request, so that process
# here will fail, so we need to skip it. Even if we skip this process, if we
# are using the official Runner of Github Actions, the IP address rate will
# not be limited and we will not get an error.
# However, this restriction release is based on the contract between Github
# and DockerHub, so if we skip this process, we may get an error.
#
- name: Login to DockerHub
if: ${{ github.event_name != 'pull_request' }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESSTOKEN }}
#
# Set environments from secrets
#
# [NOTE] Secrets
# Use Secrets parameters to trove_build_helper.sh for checking, testing, building
# and pushing.
#
# The available Secret variables are listed below:
# OSTYPE_VARS_FILE : specify custom variables file
# FORCE_PUBLISH : true means force to publish packages, false means never publish
# USE_PRIVATE_DH_ORG : true means use private organization on DockerHub for pushing image
# * DOCKER_HUB_USERNAME : Docker Hub username to read/push the docker images
# * DOCKER_HUB_ACCESSTOKEN : Docker Hub user's Access Token
#
# [REQUIRED]
# DOCKER_HUB_USERNAME and DOCKER_HUB_ACCESSTOKEN is required to read and push docker images!
#
- name: Set environments from secrets
run: |
echo "ENV_DOCKER_IMAGE_TYPE=${{ matrix.imagetype }}" >> "${GITHUB_ENV}"
echo "ENV_OSTYPE_VARS_FILE=${{ secrets.OSTYPE_VARS_FILE }}" >> "${GITHUB_ENV}"
echo "ENV_FORCE_PUBLISH=${{ secrets.FORCE_PUBLISH }}" >> "${GITHUB_ENV}"
echo "ENV_USE_PRIVATE_DH_ORG=${{ secrets.USE_PRIVATE_DH_ORG }}" >> "${GITHUB_ENV}"
#
# Run all process
#
- name: Run all process
run: |
/bin/sh -c "$GITHUB_WORKSPACE/.github/workflows/trove_build_helper.sh --imagetype ${{ matrix.imagetype }}"
#
# Local variables:
# tab-width: 4
# c-basic-offset: 4
# End:
# vim600: noexpandtab sw=4 ts=4 fdm=marker
# vim<600: noexpandtab sw=4 ts=4
#