-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update deployment scripts to use standardised env vars #1608
Changes from all commits
c8e9b03
f66a5f7
5419c52
c868b7a
6ba4fd5
5dd3b15
bbdce17
715cdb5
4663c7d
1be6308
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,7 +32,14 @@ on: | |
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: ${{ github.event.inputs.testnet_type }} | ||
steps: | ||
- name: 'Print GitHub variables' | ||
# This is a useful record of what the environment variables were at the time the job ran, for debugging and reference | ||
run: | | ||
echo "GitHub Variables = ${{ toJSON(vars) }}" | ||
|
||
- run: echo "Workflow_dispatch inputs ${{ github.event.inputs.testnet_type }}" | ||
- run: echo "Workflow_call inputs ${{ inputs.testnet_type }}" | ||
|
||
|
@@ -41,27 +48,6 @@ jobs: | |
- name: 'Set up Docker' | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: 'Sets env vars for testnet' | ||
if: ${{ inputs.testnet_type == 'uat-testnet' }} | ||
run: | | ||
echo "FAUCET_BUILD_TAG=testnetobscuronet.azurecr.io/obscuronet/faucet_uat_testnet:latest" >> $GITHUB_ENV | ||
echo "TESTNET_ADDR=erpc.uat-testnet.obscu.ro" >> $GITHUB_ENV | ||
echo "DEFAULT_FAUCET_AMOUNT=100" >> $GITHUB_ENV | ||
|
||
- name: 'Sets env vars for dev-testnet' | ||
if: ${{ inputs.testnet_type == 'dev-testnet' }} | ||
run: | | ||
echo "FAUCET_BUILD_TAG=testnetobscuronet.azurecr.io/obscuronet/faucet_dev_testnet:latest" >> $GITHUB_ENV | ||
echo "TESTNET_ADDR=erpc.dev-testnet.obscu.ro" >> $GITHUB_ENV | ||
echo "DEFAULT_FAUCET_AMOUNT=100" >> $GITHUB_ENV | ||
|
||
- name: 'Sets env vars for sepolia-testnet' | ||
if: ${{ inputs.testnet_type == 'sepolia-testnet' }} | ||
run: | | ||
echo "FAUCET_BUILD_TAG=testnetobscuronet.azurecr.io/obscuronet/faucet_sepolia_testnet:latest" >> $GITHUB_ENV | ||
echo "TESTNET_ADDR=erpc.sepolia-testnet.obscu.ro" >> $GITHUB_ENV | ||
echo "DEFAULT_FAUCET_AMOUNT=0.5" >> $GITHUB_ENV | ||
|
||
- name: 'Login to Azure docker registry' | ||
uses: azure/docker-login@v1 | ||
with: | ||
|
@@ -76,20 +62,20 @@ jobs: | |
|
||
- name: Build and Push Docker Image | ||
run: | | ||
DOCKER_BUILDKIT=1 docker build -t ${{env.FAUCET_BUILD_TAG}} -f tools/faucet/Dockerfile . | ||
docker push ${{env.FAUCET_BUILD_TAG}} | ||
DOCKER_BUILDKIT=1 docker build -t ${{ vars.DOCKER_BUILD_TAG_FAUCET }} -f tools/faucet/Dockerfile . | ||
docker push ${{ vars.DOCKER_BUILD_TAG_FAUCET }} | ||
|
||
- name: 'Deploy to Azure Container Instances' | ||
uses: 'azure/aci-deploy@v1' | ||
with: | ||
resource-group: ${{ secrets.RESOURCE_GROUP }} | ||
dns-name-label: ${{ inputs.testnet_type }}-faucet | ||
image: ${{ env.FAUCET_BUILD_TAG }} | ||
image: ${{ vars.DOCKER_BUILD_TAG_FAUCET }} | ||
name: ${{ inputs.testnet_type }}-faucet | ||
location: 'uksouth' | ||
restart-policy: 'Never' | ||
environment-variables: PORT=80 | ||
command-line: ./faucet --nodeHost ${{ env.TESTNET_ADDR }} --pk ${{ secrets.FAUCET_PK }} --jwtSecret ${{ secrets.FAUCET_JWT_SECRET }} --defaultAmount ${{ env.DEFAULT_FAUCET_AMOUNT }} | ||
command-line: ./faucet --nodeHost ${{ vars.L2_RPC_URL_VALIDATOR }} --pk ${{ secrets.FAUCET_PK }} --jwtSecret ${{ secrets.FAUCET_JWT_SECRET }} --defaultAmount ${{ vars.FAUCET_PAY_AMOUNT }} | ||
ports: '80' | ||
cpu: 2 | ||
memory: 2 | ||
Comment on lines
62
to
81
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The new hunk changes the Docker build and push commands and the Azure Container Instances deployment command to use the new environment variable names. However, the - DOCKER_BUILDKIT=1 docker build -t ${{ vars.DOCKER_BUILD_TAG_FAUCET }} -f tools/faucet/Dockerfile .
- docker push ${{ vars.DOCKER_BUILD_TAG_FAUCET }}
+ DOCKER_BUILDKIT=1 docker build -t ${{ env.DOCKER_BUILD_TAG_FAUCET }} -f tools/faucet/Dockerfile .
+ docker push ${{ env.DOCKER_BUILD_TAG_FAUCET }}
- image: ${{ vars.DOCKER_BUILD_TAG_FAUCET }}
+ image: ${{ env.DOCKER_BUILD_TAG_FAUCET }}
- command-line: ./faucet --nodeHost ${{ vars.L2_RPC_URL_VALIDATOR }} --pk ${{ secrets.FAUCET_PK }} --jwtSecret ${{ secrets.FAUCET_JWT_SECRET }} --defaultAmount ${{ vars.FAUCET_PAY_AMOUNT }}
+ command-line: ./faucet --nodeHost ${{ env.L2_RPC_URL_VALIDATOR }} --pk ${{ secrets.FAUCET_PK }} --jwtSecret ${{ secrets.FAUCET_JWT_SECRET }} --defaultAmount ${{ env.FAUCET_PAY_AMOUNT }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new hunk introduces an environment variable based on the
testnet_type
input and a step to print GitHub variables for debugging. However, thevars
object used in line 41 is not defined anywhere. This will cause an error when the workflow runs. You should replacevars
withgithub
to print all GitHub context variables.