Skip to content

Commit

Permalink
test build_files
Browse files Browse the repository at this point in the history
  • Loading branch information
chendelin1982 authored Dec 5, 2023
1 parent b9ec329 commit 3760772
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build_files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ jobs:
- name: Run variables_files.py
run: python3 build/variables_files.py "${{ env.VARIABLES_FILES }}"
if: env.VARIABLES_FILES != ''

- name: Run compose_files.py
run: python3 build/compose_files.py "${{ env.COMPOSE_FILES }}"
if: env.COMPOSE_FILES != ''

- name: Commit and push if changed
uses: stefanzweifel/git-auto-commit-action@v4
Expand Down
2 changes: 1 addition & 1 deletion apps/activemq/docker-compose-artemis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# only for artemis Activemq
# only for artemis activemq

version: "3.8"

Expand Down
2 changes: 1 addition & 1 deletion apps/activemq/docker-compose-classic.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# only for classic Activemq
# only for classic activemq
version: "3.8"

services:
Expand Down
5 changes: 3 additions & 2 deletions build/compose_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@
name_part = basename.split('-')[2].split('.')[0] # 从 'docker-compose-*.yml' 中提取 '*'

# 构造新的文件名
new_filename = os.path.join(directory, f'docker-compose-{name_part}-merged.yml')
new_filename = os.path.join(directory, f'{name_part}.yml')

# 构造 docker-compose 命令
cmd = ['docker-compose', '-f', 'docker-compose.yml', '-f', filename, 'config', '>', new_filename]
docker_compose_file = os.path.join(directory, 'docker-compose.yml')
cmd = ['docker-compose', '-f', docker_compose_file, '-f', filename, 'config', '>', new_filename]

# 执行命令
subprocess.run(' '.join(cmd), shell=True, check=True)

0 comments on commit 3760772

Please sign in to comment.