Skip to content

Commit

Permalink
docker config
Browse files Browse the repository at this point in the history
  • Loading branch information
vggonzal authored and vggonzal committed Oct 18, 2023
1 parent 3216209 commit 46fe0e3
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ jobs:
echo "TARGET_ENV_UPPERCASE=SIT" >> $GITHUB_ENV
- name: Run Snyk as a blocking step
if: ${{ startsWith(github.ref, 'test') }}
uses: snyk/actions/python-3.9@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
Expand All @@ -124,7 +123,6 @@ jobs:
--severity-threshold=high
--fail-on=all
- name: Run Snyk on Python
if: ${{ startsWith(github.ref, 'test') }}
uses: snyk/actions/python-3.9@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
Expand Down Expand Up @@ -159,13 +157,21 @@ jobs:
poetry build
- name: Test with pytest
if: ${{ startsWith(github.ref, 'test') }}
run: |
poetry run pytest tests/test_api.py -k 'test_gettimeseries_get'
poetry run pytest tests/test_hydrocron_database.py
poetry run pytest tests/test_io_swot_reach_node_shp.py
poetry run pytest tests/test_api.py -k 'test_getsubset_get'
## Set environment variables
- name: Configure Initial YAML file and environment variables
run: |
echo "THE_VERSION=${{ env.software_version }}" >> $GITHUB_ENV;
echo "GIT_BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV;
GITHUB_REF_READABLE="${GITHUB_REF//\//-}"
echo "GITHUB_REF_READABLE=${GITHUB_REF_READABLE}" >> $GITHUB_ENV
echo "THE_ENV=sit" >> $GITHUB_ENV
echo "TARGET_ENV_UPPERCASE=SIT" >> $GITHUB_ENV
# Setup docker to build and push images
Expand Down Expand Up @@ -238,12 +244,12 @@ jobs:
AWS_SECRET_ACCESS_KEY: ${{ secrets[format('AWS_SECRET_ACCESS_KEY_SERVICES_{0}', env.TARGET_ENV_UPPERCASE)] }}
AWS_DEFAULT_REGION: us-west-2

TF_VAR_hydrocronapi_api_docker_image: "ghcr.io/podaac/hydrocron:${{ env.THE_VERSION }}"

run: |
echo "-------"
echo ${{ env.THE_ENV }}
echo ${{ env.THE_VERSION }}
export docker_tag=$(source docker/build-docker.sh -n podaac-hydrocron -v 1.0.0)
source docker/push-docker-ecr.sh -v ${{ env.THE_ENV }} -t $docker_tag
terraform init -reconfigure -backend-config="bucket=podaac-services-sit-terraform" -backend-config="region=us-west-2"
terraform plan -var-file=tfvars/${{ env.THE_ENV }}.tfvars -var="app_version=${{ env.THE_VERSION }}" -out="tfplan"
terraform apply -auto-approve tfplan
terraform apply -auto-approve tfplan

0 comments on commit 46fe0e3

Please sign in to comment.