Skip to content

Commit

Permalink
build: fix build pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
JasperHG90 committed Jan 6, 2024
1 parent 492f54c commit 487f623
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 18 deletions.
18 changes: 6 additions & 12 deletions .github/workflows/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: "100"
- name: 'checks'
uses: ./.github/workflows/templates/checks
build:
Expand All @@ -36,19 +38,11 @@ jobs:
with:
# cache0 makes it easy to bust the cache if needed
gha-cache-key: cache0-py310
named-caches-hash: ${{ hashFiles('lockfiles/*.json', '**/something-else.lock') }}
named-caches-hash: ${{ hashFiles('python-default.lock') }}
cache-lmdb-store: 'true'
- name: 'docker login'
run: docker login -u _json_key -p "$ARTIFACT_SA" europe-west4-docker.pkg.dev
env:
ARTIFACT_SA: ${{ secrets.GOOGLE_CREDENTIALS }}
- name: 'build'
run: pants package dags/luchtmeetnet_ingestion
- name: 'add tags'
run: |
docker tag \
europe-west4-docker.pkg.dev/jasperg-dagster/regi-areg-euw4-dagi-prd/luchtmeetnet_ingestion:latest \
europe-west4-docker.pkg.dev/jasperg-dagster/regi-areg-euw4-dagi-prd/luchtmeetnet_ingestion:$(git rev-parse --short HEAD)
- name: 'push to gcr'
run: |
docker push europe-west4-docker.pkg.dev/jasperg-dagster/regi-areg-euw4-dagi-prd/luchtmeetnet_ingestion:latest
docker push europe-west4-docker.pkg.dev/jasperg-dagster/regi-areg-euw4-dagi-prd/luchtmeetnet_ingestion:$(git rev-parse --short HEAD)
- name: 'publish to gcr'
run: VERSION=$(git rev-parse --short HEAD) pants --filter-target-type=docker_image publish dags/luchtmeetnet_ingestion:img
36 changes: 32 additions & 4 deletions .github/workflows/templates/checks/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,42 @@ runs:
gha-cache-key: cache0-py310
named-caches-hash: ${{ hashFiles('lockfiles/*.json', '**/something-else.lock') }}
- name: format
run: just fmt
run: |
pants \
--changed-since=origin/main \
tailor --check \
update-build-files --check \
fmt
shell: bash
- name: lint
run: just lint
run: |
pants \
--changed-since=origin/main \
lint
shell: bash
# - name: type checks
# run: |
# pants \
# --changed-since=origin/main \
# --changed-dependents=transitive \
# check
# shell: bash
- name: test
run: just test
run: |
pants \
--changed-since=origin/main \
--changed-dependents=transitive \
test
shell: bash
- name: package
run: just package
run: |
pants \
--changed-since=origin/main \
package
shell: bash
- name: Upload pants log
uses: actions/upload-artifact@v3
with:
name: pants-log
path: .pants.d/pants.log
if: always()
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ repos:
# hooks:
# - id: pants-check
# name: pants-check
# entry: "pants check --changed-since=HEAD"
# entry: "pants check --changed-since=HEAD --changed-dependents=transitive" # Checks require that we also check dependents
# language: system
# types: [python]
# pass_filenames: false
2 changes: 1 addition & 1 deletion dags/luchtmeetnet_ingestion/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,5 @@ docker_image(
"COPY dags.luchtmeetnet_ingestion/binary-srcs.pex/pyproject.toml /pyproject.toml",
'ENTRYPOINT ["/bin/app/pex"]',
],
image_tags=["latest"],
image_tags=["latest", "{build_args.VERSION}"],
)
1 change: 1 addition & 0 deletions pants.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ use_coverage = true
env_vars = [
"DOCKER_BUILDKIT=0",
]
build_args = ["VERSION"]

[environments-preview.names]
py39_slim = "//:py39-slim"

0 comments on commit 487f623

Please sign in to comment.