Visual Studio Team Services (VSTS) has quickly become one for enterprise and indie developers the tool of choice for managing code repositories, processes, and test, and builds. With the rise of Solidity as the language of choice, Inevitably the need for CI/CD pipelines for Solidity smart contracts will grow. This short tutorial outlines how to use VSTS to create a simple pipeline for Solidity and Truffle.
install -g truffle ganache-cli
into Command and arguments.
#!/bin/bash
# Starts the Ganache blockchain in the background.
ganache-cli > /dev/null &
# Deploys the contracts to the Ganache network
truffle deploy --reset --network test
# Tuns the tests for the contracts
truffle test --network test
# Kills the Ganache blockchain running in the background.
kill -KILL $(jobs -p)
exit 0
Note: the network test
is defined in the truffle.js
file in the root of the truffle project that is checked in. Edit the truffle.json file and add the test
network if you don’t already have a ganache-cli network defined in the truffle.js
file. It needs to have the host
set to 127.0.0.1
, the port
to 8545
, and network_id
to *
.
module.exports = {
networks: {
test: {
host: "127.0.0.1",
port: 8545,
network_id: "*" // Match any network id
}
}
};
That’s it. You can now test it by queuing a new build and watching the output. Also, you can add any additional tasks related to your CI/CD pipeline or turn on Enable Continuous Integration under the Triggers tab so that the build definition fires when new code is checked into the repository.
Cloud management is difficult to do manually, especially if you work with multiple cloud…
Azure’s scalable infrastructure is often cited as one of the primary reasons why it's the…
https://www.youtube.com/watch?v=wDzCN0d8SeA Watch our "Unlocking the Power of AI in your Software Development Life Cycle (SDLC)"…
FinOps is a strategic approach to managing cloud costs. It combines financial management best practices…
Using Kubernetes with Azure combines the power of Kubernetes container orchestration and the cloud capabilities…
In the intricate landscape of modern business, compliance is both a cornerstone of operational integrity…