Skip to content

Commit

Permalink
Updated configuration to no longer have to manage snowflake as a sepa…
Browse files Browse the repository at this point in the history
…rate extension since it is available in liquibase-core as of 4.12.0
  • Loading branch information
nvoxland committed Jun 8, 2022
1 parent 5f2a66c commit 4ca6da3
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 66 deletions.
45 changes: 0 additions & 45 deletions .github/workflows/release-automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,48 +35,3 @@ jobs:
with:
repo-token: ${{ secrets.BOT_TOKEN }}

# automation steps for liquibase-snowflake extension
- name: Get SNOWFLAKE_TARGET_VERSION from PR
if: ${{ steps.metadata.outputs.dependency-name == 'org.liquibase.ext:liquibase-snowflake' }}
run: |
echo 'SNOWFLAKE_TARGET_VERSION<<EOF' >> $GITHUB_ENV
gh pr view "$PR_URL" | grep "Bump liquibase-snowflake" | awk '{ print $7 }' >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.BOT_TOKEN}}

- name: Compute sha1 for snowflake-extension.jar
if: ${{ steps.metadata.outputs.dependency-name == 'org.liquibase.ext:liquibase-snowflake' }}
run: |
echo 'SNOWFLAKE_TARGET_SHA<<EOF' >> $GITHUB_ENV
curl -LsS https://repo1.maven.org/maven2/org/liquibase/ext/liquibase-snowflake/$SNOWFLAKE_TARGET_VERSION/liquibase-snowflake-$SNOWFLAKE_TARGET_VERSION.jar | sha1sum | awk '{ print $1 }' >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- name: edit liquibase-snowflake Dockerfile
if: ${{ steps.metadata.outputs.dependency-name == 'org.liquibase.ext:liquibase-snowflake' }}
run: |
sed -i 's/^FROM liquibase/liquibase:.*/FROM liquibase/liquibase:'"$SNOWFLAKE_TARGET_VERSION"'/' ${{ github.workspace }}/snowflake/Dockerfile
sed -i 's/^ARG SNOWFLAKE_EXTENSION_VERSION=.*/ARG SNOWFLAKE_EXTENSION_VERSION='"$SNOWFLAKE_TARGET_VERSION"'/' ${{ github.workspace }}/snowflake/Dockerfile
sed -i 's/^ARG SNOWFLAKE_EXTENSION_SHA1=.*/ARG SNOWFLAKE_EXTENSION_SHA1='"$SNOWFLAKE_TARGET_SHA"'/' ${{ github.workspace }}/snowflake/Dockerfile
- name: push Dockerfile edit back to PR
if: ${{ steps.metadata.outputs.dependency-name == 'org.liquibase.ext:liquibase-snowflake' }}
run: |
git config --global user.name "github_actions"
git config --global user.email "[email protected]"
git add .
git commit -m "auto-update liquibase-snowflake Dockerfile"
git push -u origin HEAD:"$GITHUB_HEAD_REF"
env:
GITHUB_HEAD_REF: ${{github.head_ref}}

- name: Bump version and push tag
if: ${{ steps.metadata.outputs.dependency-name == 'org.liquibase.ext:liquibase-snowflake' }}
id: tag_version2
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.BOT_TOKEN }}
create_annotated_tag: true
custom_tag : ${{env.SNOWFLAKE_TARGET_VERSION}}

1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ RUN export LIQUIBASE_HOME=/liquibase

# Install Drivers
RUN lpm update
RUN lpm add snowflake liquibase-snowflake --global
RUN /liquibase/liquibase --version

COPY --chown=liquibase:liquibase docker-entrypoint.sh /liquibase/
Expand Down
10 changes: 0 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,4 @@
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>

<dependencies>
<dependency>
<groupId>org.liquibase.ext</groupId>
<artifactId>liquibase-snowflake</artifactId>
<version>4.9.0</version>
</dependency>

</dependencies>

</project>
10 changes: 0 additions & 10 deletions snowflake/Dockerfile

This file was deleted.

0 comments on commit 4ca6da3

Please sign in to comment.