Skip to content

Commit

Permalink
address feedback from code review.
Browse files Browse the repository at this point in the history
  • Loading branch information
gagelarsen committed May 23, 2024
1 parent 62d3673 commit 9251957
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 16 deletions.
8 changes: 1 addition & 7 deletions .github/workflows/tethys-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,6 @@ jobs:
run: |
echo "Pushing to docker registry";
docker push ${{ secrets.DOCKER_UPLOAD_URL }}:${{ steps.safetag.outputs.safetag }};
- name: Upload Docker With Latest Tag
if: ${{ steps.version.outputs.prerelease == '' }}
run: |
echo "Updating latest on the docker registry";
docker tag ${{ secrets.DOCKER_UPLOAD_URL }}:${{ steps.safetag.outputs.safetag }} ${{ secrets.DOCKER_UPLOAD_URL }}:latest;
docker push ${{ secrets.DOCKER_UPLOAD_URL }}:latest;
conda-build:
name: Conda Build (${{ matrix.platform }})
Expand Down Expand Up @@ -119,7 +113,7 @@ jobs:
- name: Setup Tethys
run: |
cd ..
bash ./tethys/scripts/install_tethys.sh --partial-tethys-install me -n tethys -s $PWD/tethys
bash ./tethys/scripts/install_tethys.sh --partial-tethys-install me -n tethys -s $PWD/tethys -p "3.8"
. ~/miniconda/etc/profile.d/conda.sh
conda activate tethys
hash -r
Expand Down
16 changes: 7 additions & 9 deletions .github/workflows/tethys.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:
env:
CONDA_BUILD_PIN_LEVEL: minor
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TEST_IMAGE: tethys:dev
TEST_IMAGE: tethys
POSTGRES_DB: tethys_postgis
POSTGRES_PASSWORD: please_dont_use_default_passwords
POSTGRES_PORT: 5432
Expand Down Expand Up @@ -109,15 +109,15 @@ jobs:
# Build the docker for no tag
- name: Build Without Tag
run: |
docker build --build-arg DJANGO_VERSION=${{ matrix.django-version }} --build-arg PYTHON_VERSION=${{ matrix.python-version }} -t ${{ secrets.DOCKER_UPLOAD_URL }}:dev .;
docker tag ${{ secrets.DOCKER_UPLOAD_URL }}:dev ${{ env.TEST_IMAGE }}-${{ matrix.django-version }}-${{ matrix.python-version }};
docker build --build-arg DJANGO_VERSION=${{ matrix.django-version }} --build-arg PYTHON_VERSION=${{ matrix.python-version }} -t ${{ secrets.DOCKER_UPLOAD_URL }}:${{ matrix.python-version }}-${{ matrix.django-version }}-dev .;
docker tag ${{ secrets.DOCKER_UPLOAD_URL }}:${{ matrix.python-version }}-${{ matrix.django-version }}-dev ${{ env.TEST_IMAGE }}:${{ matrix.python-version }}-${{ matrix.django-version }}-dev;
# Upload docker if pull request no tag
- name: Upload Docker No Tag
if: ${{ github.event_name != 'pull_request' }}
run: |
echo "Pushing to docker registry";
echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin;
docker push ${{ secrets.DOCKER_UPLOAD_URL }}:${{ env.TEST_IMAGE }}-${{ matrix.django-version }}-${{ matrix.python-version }};
docker push ${{ secrets.DOCKER_UPLOAD_URL }}:${{ matrix.python-version }}-${{ matrix.django-version }}-dev;
# No Upload if Pull Request
- name: No Upload
if: ${{ github.event_name == 'pull_request' }}
Expand All @@ -127,7 +127,7 @@ jobs:
- name: Upload Docker Artifact
uses: ishworkh/docker-image-artifact-upload@v1
with:
image: ${{ env.TEST_IMAGE }}-${{ matrix.django-version }}-${{ matrix.python-version }}
image: ${{ env.TEST_IMAGE }}:${{ matrix.python-version }}-${{ matrix.django-version }}-dev
retention_days: "1"

startup_test:
Expand Down Expand Up @@ -176,14 +176,12 @@ jobs:
/bin/bash -c "cd /usr/lib/tethys && source ./run.sh --test"
conda-build:
name: Conda Build (${{ matrix.platform }}, ${{ matrix.django-version }}, ${{ matrix.python-version }})
name: Conda Build
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest]
python-version: ["3.10", "3.11", "3.12"]
django-version: ["3.2", "4.2", "5.0"]
steps:
# Checkout the source
- name: Checkout Source
Expand All @@ -194,7 +192,7 @@ jobs:
- name: Setup Tethys
run: |
cd ..
bash ./tethys/scripts/install_tethys.sh --partial-tethys-install me -n tethys -s $PWD/tethys -d ${{ matrix.django-version }} -p ${{ matrix.python-version }}
bash ./tethys/scripts/install_tethys.sh --partial-tethys-install me -n tethys -s $PWD/tethys
. ~/miniconda/etc/profile.d/conda.sh
conda activate tethys
hash -r
Expand Down
2 changes: 2 additions & 0 deletions scripts/install_tethys.sh
Original file line number Diff line number Diff line change
Expand Up @@ -367,12 +367,14 @@ then
then
echo "Updating environment.yml Django version ${DJANGO_VERSION}..."
sudo sed -i.bak "s/django>=.*/django>=${DJANGO_VERSION}/" "${TETHYS_SRC}/environment.yml"
sudo sed -i.bak "s/django>=.*/django>=${DJANGO_VERSION}/" "${TETHYS_SRC}/micro_environment.yml"
fi

if [ -n "${PYTHON_VERSION}" ]
then
echo "Updating environment.yml Python version ${PYTHON_VERSION}..."
sudo sed -i.bak "s/django>=.*/python>=${PYTHON_VERSION}/" "${TETHYS_SRC}/environment.yml"
sudo sed -i.bak "s/django>=.*/python>=${PYTHON_VERSION}/" "${TETHYS_SRC}/micro_environment.yml"
fi

if [ -n "${CREATE_ENV}" ]
Expand Down

0 comments on commit 9251957

Please sign in to comment.